From cd82c363e5818a884e76ed3803d82e42a5ab2cff Mon Sep 17 00:00:00 2001 From: Dan Radez Date: Fri, 16 Oct 2015 13:08:14 -0400 Subject: cleaning up some things - clearing out the glance image builds, we download those from RDO - cleaning out the underlay attachment, that should happen in the deployment - no need to start the instack VM back up since the glance images are being downloaded Change-Id: I82098c9e908d58a704ce8b183d902032dd056be5 Signed-off-by: Dan Radez --- build/instack.sh | 46 +++++----------------------------------------- 1 file changed, 5 insertions(+), 41 deletions(-) (limited to 'build/instack.sh') diff --git a/build/instack.sh b/build/instack.sh index 5ac08763..24abb1ae 100755 --- a/build/instack.sh +++ b/build/instack.sh @@ -80,12 +80,6 @@ virsh undefine baremetalbrbm_1 --remove-all-storage 2> /dev/null || echo -n '' NODE_CPU=2 NODE_MEM=8192 instack-virt-setup EOI -# attach undercloud to the underlay network for -# baremetal installations -#if ! ovs-vsctl show | grep brbm; then -# ovs-vsctl add-port brbm em2 -#fi - # let dhcp happen so we can get the ip # just wait instead of checking until we see an address # because there may be a previous lease that needs @@ -128,6 +122,10 @@ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "openstack undercloud install" # Clean cache to reduce the images size ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "yum clean all" +# copy instackenv file for future virt deployments +if [ ! -d stack ]; then mkdir stack; fi +scp ${SSH_OPTIONS[@]} stack@$UNDERCLOUD:instackenv.json stack/instackenv.json + # make a copy of instack VM's definitions, and disk image # it must be stopped to make a copy of its disk image ssh -T ${SSH_OPTIONS[@]} stack@localhost < baremetalbrbm_1.xml virsh dumpxml instack > instack.xml #virsh vol-dumpxml instack.qcow2 --pool default > instack.qcow2.xml virsh net-dumpxml brbm > brbm.xml -virsh start instack EOI # copy off the instack artifacts @@ -162,45 +159,14 @@ scp ${SSH_OPTIONS[@]} stack@localhost:baremetalbrbm_0.xml . scp ${SSH_OPTIONS[@]} stack@localhost:baremetalbrbm_1.xml . scp ${SSH_OPTIONS[@]} stack@localhost:instack.xml . scp ${SSH_OPTIONS[@]} stack@localhost:brbm.xml . + sudo cp /var/lib/libvirt/images/instack.qcow2 ./instack.qcow2_ sudo chown $(whoami):$(whoami) ./instack.qcow2_ virt-sparsify --check-tmpdir=fail ./instack.qcow2_ ./instack.qcow2 rm -f ./instack.qcow2_ -# start the instack VM back up to continue installation -echo "Waiting for instack VM to start" -CNT=10 -while ! ping -c 1 "$UNDERCLOUD" > /dev/null && [ $CNT -gt 0 ]; do - echo -n "." - sleep 5 - CNT=CNT-1 -done -CNT=10 -while ! ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "echo ''" > /dev/null && [ $CNT -gt 0 ]; do - echo -n "." - sleep 3 - CNT=CNT-1 -done - -# inject the already downloaded cloud image so it's not downloaded again -echo "Copying CentOS Cache to instack VM" -ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "mkdir .cache" -ssh -T ${SSH_OPTIONS[@]} stack@localhost "scp -r ${SSH_OPTIONS[@]} /home/stack/.cache/image-create/CentOS-7-x86_64-GenericCloud* \"stack@$UNDERCLOUD\":.cache/" - -### Commented this out for now we'll download the RDO prebuilt ones -### but leaving this here so we can have the option in the future -# build the overcloud images -#echo "Building overcloud images" -#ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <