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 <>
parent 24e05320
......@@ -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
# attach undercloud to the underlay network for
# baremetal installations
#if ! ovs-vsctl show | grep brbm; then
# ovs-vsctl add-port brbm em2
# 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 <<EOI
......@@ -153,7 +151,6 @@ virsh dumpxml baremetalbrbm_1 > 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
# 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"
while ! ping -c 1 "$UNDERCLOUD" > /dev/null && [ $CNT -gt 0 ]; do
echo -n "."
sleep 5
while ! ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "echo ''" > /dev/null && [ $CNT -gt 0 ]; do
echo -n "."
sleep 3
# 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
# pull down the the built images
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+=" ironic-python-agent.initramfs ironic-python-agent.kernel ironic-python-agent.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"
for i in $IMAGES; do
# download prebuilt images from RDO Project
curl$i -z stack/$i -o stack/$i --verbose --silent --location
# used for building the images
#scp ${SSH_OPTIONS[@]} stack@$UNDERCLOUD:$i stack/
# move and Sanitize private keys from instack.json file
......@@ -389,11 +389,11 @@ fi
echo "Copying built OPNFV .iso file to target directory ${BUILD_DIR} ..."
rm -rf ${BUILD_DIR}
mkdir -p ${BUILD_DIR}
ls -s ${BUILD_BASE}/.versions ${BUILD_DIR}
ls -s ${RESULT_DIR}/*.iso* ${BUILD_DIR}
cp ${BUILD_BASE}/.versions ${BUILD_DIR}
cp ${RESULT_DIR}/*.iso* ${BUILD_DIR}
echo "Copying built OPNFV .rpm files to target directory ${BUILD_DIR} ..."
ls -s ${BUILD_BASE}/*.rpm ${BUILD_DIR}
ls -s ${BUILD_BASE}/noarch/*.rpm ${BUILD_DIR}
cp ${BUILD_BASE}/*.rpm ${BUILD_DIR}
cp ${BUILD_BASE}/noarch/*.rpm ${BUILD_DIR}
if [ $POPULATE_CACHE -eq 1 ]; 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