Commit cd82c363 authored by Dan Radez's avatar Dan Radez
Browse files

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: default avatarDan Radez <dradez@redhat.com>
parent 24e05320
...@@ -80,12 +80,6 @@ virsh undefine baremetalbrbm_1 --remove-all-storage 2> /dev/null || echo -n '' ...@@ -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 NODE_CPU=2 NODE_MEM=8192 instack-virt-setup
EOI 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 # let dhcp happen so we can get the ip
# just wait instead of checking until we see an address # just wait instead of checking until we see an address
# because there may be a previous lease that needs # because there may be a previous lease that needs
...@@ -128,6 +122,10 @@ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "openstack undercloud install" ...@@ -128,6 +122,10 @@ ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "openstack undercloud install"
# Clean cache to reduce the images size # Clean cache to reduce the images size
ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "yum clean all" 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 # make a copy of instack VM's definitions, and disk image
# it must be stopped to make a copy of its disk image # it must be stopped to make a copy of its disk image
ssh -T ${SSH_OPTIONS[@]} stack@localhost <<EOI ssh -T ${SSH_OPTIONS[@]} stack@localhost <<EOI
...@@ -153,7 +151,6 @@ virsh dumpxml baremetalbrbm_1 > baremetalbrbm_1.xml ...@@ -153,7 +151,6 @@ virsh dumpxml baremetalbrbm_1 > baremetalbrbm_1.xml
virsh dumpxml instack > instack.xml virsh dumpxml instack > instack.xml
#virsh vol-dumpxml instack.qcow2 --pool default > instack.qcow2.xml #virsh vol-dumpxml instack.qcow2 --pool default > instack.qcow2.xml
virsh net-dumpxml brbm > brbm.xml virsh net-dumpxml brbm > brbm.xml
virsh start instack
EOI EOI
# copy off the instack artifacts # copy off the instack artifacts
...@@ -162,45 +159,14 @@ scp ${SSH_OPTIONS[@]} stack@localhost:baremetalbrbm_0.xml . ...@@ -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:baremetalbrbm_1.xml .
scp ${SSH_OPTIONS[@]} stack@localhost:instack.xml . scp ${SSH_OPTIONS[@]} stack@localhost:instack.xml .
scp ${SSH_OPTIONS[@]} stack@localhost:brbm.xml . scp ${SSH_OPTIONS[@]} stack@localhost:brbm.xml .
sudo cp /var/lib/libvirt/images/instack.qcow2 ./instack.qcow2_ sudo cp /var/lib/libvirt/images/instack.qcow2 ./instack.qcow2_
sudo chown $(whoami):$(whoami) ./instack.qcow2_ sudo chown $(whoami):$(whoami) ./instack.qcow2_
virt-sparsify --check-tmpdir=fail ./instack.qcow2_ ./instack.qcow2 virt-sparsify --check-tmpdir=fail ./instack.qcow2_ ./instack.qcow2
rm -f ./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" <<EOI
#set -e
#export DIB_YUM_REPO_CONF="/etc/yum.repos.d/delorean.repo /etc/yum.repos.d/delorean-current.repo /etc/yum.repos.d/delorean-deps.repo"
#openstack overcloud image build --all
#EOI
# pull down the the built images # pull down the the built images
echo "Copying overcloud resources" echo "Copying overcloud resources"
if [ ! -d stack ]; then mkdir stack; fi
scp ${SSH_OPTIONS[@]} stack@$UNDERCLOUD:instackenv.json stack/instackenv.json
IMAGES="deploy-ramdisk-ironic.initramfs deploy-ramdisk-ironic.kernel" IMAGES="deploy-ramdisk-ironic.initramfs deploy-ramdisk-ironic.kernel"
IMAGES+=" ironic-python-agent.initramfs ironic-python-agent.kernel ironic-python-agent.vmlinuz" IMAGES+=" ironic-python-agent.initramfs ironic-python-agent.kernel ironic-python-agent.vmlinuz"
IMAGES+=" overcloud-full.initrd overcloud-full.qcow2 overcloud-full.vmlinuz" IMAGES+=" overcloud-full.initrd overcloud-full.qcow2 overcloud-full.vmlinuz"
...@@ -208,8 +174,6 @@ IMAGES+=" overcloud-full.initrd overcloud-full.qcow2 overcloud-full.vmlinuz" ...@@ -208,8 +174,6 @@ IMAGES+=" overcloud-full.initrd overcloud-full.qcow2 overcloud-full.vmlinuz"
for i in $IMAGES; do for i in $IMAGES; do
# download prebuilt images from RDO Project # download prebuilt images from RDO Project
curl https://repos.fedorapeople.org/repos/openstack-m/rdo-images-centos-liberty/$i -z stack/$i -o stack/$i --verbose --silent --location curl https://repos.fedorapeople.org/repos/openstack-m/rdo-images-centos-liberty/$i -z stack/$i -o stack/$i --verbose --silent --location
# used for building the images
#scp ${SSH_OPTIONS[@]} stack@$UNDERCLOUD:$i stack/
done done
# move and Sanitize private keys from instack.json file # move and Sanitize private keys from instack.json file
......
...@@ -389,11 +389,11 @@ fi ...@@ -389,11 +389,11 @@ fi
echo "Copying built OPNFV .iso file to target directory ${BUILD_DIR} ..." echo "Copying built OPNFV .iso file to target directory ${BUILD_DIR} ..."
rm -rf ${BUILD_DIR} rm -rf ${BUILD_DIR}
mkdir -p ${BUILD_DIR} mkdir -p ${BUILD_DIR}
ls -s ${BUILD_BASE}/.versions ${BUILD_DIR} cp ${BUILD_BASE}/.versions ${BUILD_DIR}
ls -s ${RESULT_DIR}/*.iso* ${BUILD_DIR} cp ${RESULT_DIR}/*.iso* ${BUILD_DIR}
echo "Copying built OPNFV .rpm files to target directory ${BUILD_DIR} ..." echo "Copying built OPNFV .rpm files to target directory ${BUILD_DIR} ..."
ls -s ${BUILD_BASE}/*.rpm ${BUILD_DIR} cp ${BUILD_BASE}/*.rpm ${BUILD_DIR}
ls -s ${BUILD_BASE}/noarch/*.rpm ${BUILD_DIR} cp ${BUILD_BASE}/noarch/*.rpm ${BUILD_DIR}
if [ $POPULATE_CACHE -eq 1 ]; then if [ $POPULATE_CACHE -eq 1 ]; then
if [ ! -z ${BUILD_CACHE_URI} ]; then if [ ! -z ${BUILD_CACHE_URI} ]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment