path: root/build/
diff options
authorDan Radez <>2015-12-02 17:03:20 -0500
committerDan Radez <>2015-12-07 18:33:09 -0500
commit1504fa90460378597344e91120489225011d5966 (patch)
tree17450e823e3de119137e91c54aceafb8fb17302a /build/
parent95d00c41d2cbaaec78da0937fad37dde501a0f63 (diff)
switching to RDO build undercloud instead of building it ourselves
Change-Id: I9f09c195352d2d88a3da4f42e09424d96d39722b
Diffstat (limited to 'build/')
1 files changed, 35 insertions, 30 deletions
diff --git a/build/ b/build/
index f23df67..182d236 100755
--- a/build/
+++ b/build/
@@ -40,14 +40,6 @@ fi
ssh -T ${SSH_OPTIONS[@]} stack@localhost "rm -f instack*.qcow2"
# Yum repo setup for building the undercloud
-if ! rpm -q epel-release > /dev/null; then
- sudo yum install
-if ! rpm -q rdo-release > /dev/null; then
- sudo yum install -y${RDO_RELEASE}/rdo-release-${RDO_RELEASE}.rpm
if ! rpm -q rdo-release > /dev/null && [ "$1" != "-master" ]; then
sudo yum install -y${RDO_RELEASE}/rdo-release-${RDO_RELEASE}.rpm
sudo rm -rf /etc/yum.repos.d/delorean.repo
@@ -117,6 +109,7 @@ done
# yum repo, triple-o package and ssh key setup for the undercloud
ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" <<EOI
set -e
if ! rpm -q epel-release > /dev/null; then
yum install
@@ -124,26 +117,20 @@ fi
yum -y install yum-plugin-priorities
curl -o /etc/yum.repos.d/delorean.repo
curl -o /etc/yum.repos.d/delorean-deps.repo
-yum install -y python-tripleoclient
cp /root/.ssh/authorized_keys /home/stack/.ssh/authorized_keys
chown stack:stack /home/stack/.ssh/authorized_keys
-# install undercloud on Undercloud VM
-ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "openstack undercloud install"
# copy instackenv file for future virt deployments
if [ ! -d stack ]; then mkdir stack; fi
scp ${SSH_OPTIONS[@]} stack@$UNDERCLOUD:instackenv.json stack/instackenv.json
-# Clean cache to reduce the images size
-ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "yum clean all"
# 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
set -e
-echo "Shutting down instack to take snapshot"
+echo "Shutting down instack to gather configs"
virsh shutdown instack
echo "Waiting for instack VM to shutdown"
@@ -180,28 +167,45 @@ scp ${SSH_OPTIONS[@]} stack@localhost:brbm-net.xml .
scp ${SSH_OPTIONS[@]} stack@localhost:brbm1-net.xml .
scp ${SSH_OPTIONS[@]} stack@localhost:default-pool.xml .
-# copy the instack disk image for inclusion in artifacts
-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_
# pull down the the built images
echo "Copying overcloud resources"
-IMAGES+=" ironic-python-agent.tar"
-IMAGES+=" overcloud-full.tar"
+IMAGES+=" undercloud.qcow2"
for i in $IMAGES; do
# download prebuilt images from RDO Project
if [ "$(curl -L $rdo_images_uri/${i}.md5 | awk {'print $1'})" != "$(md5sum stack/$i | awk {'print $1'})" ] ; then
- curl$i -o stack/$i --verbose --silent --location
+ if [ $i == "undercloud.qcow2" ]; then
+ # there's a problem with the Content-Length reported by the centos artifacts
+ # server so using wget for it until a resolution is figured out.
+ wget -nv -O stack/$i $rdo_images_uri/$i
+ else
+ curl $rdo_images_uri/$i -o stack/$i --verbose --silent --location
+ fi
- tar -xf stack/$i -C stack/
+ # only untar the tar files
+ if [ "${i##*.}" == "tar" ]; then tar -xf stack/$i -C stack/; fi
+#Adding OpenStack packages to undercloud
+pushd stack
+cp undercloud.qcow2 instack.qcow2
+LIBGUESTFS_BACKEND=direct virt-customize --install yum-priorities -a instack.qcow2
+LIBGUESTFS_BACKEND=direct virt-customize --install $PACKAGES -a instack.qcow2
#Adding OpenDaylight to overcloud
pushd stack
cp overcloud-full.qcow2 overcloud-full-odl.qcow2
@@ -220,7 +224,8 @@ git clone
pushd puppet-opendaylight
git archive --format=tar.gz --prefix=opendaylight/ HEAD > ../puppet-opendaylight.tar.gz
-LIBGUESTFS_BACKEND=direct virt-customize --upload puppet-opendaylight.tar.gz:/etc/puppet/modules/ --run-command "cd /etc/puppet/modules/; tar xzf puppet-opendaylight.tar.gz" -a overcloud-full-odl.qcow2
+LIBGUESTFS_BACKEND=direct virt-customize --upload puppet-opendaylight.tar.gz:/etc/puppet/modules/ \
+ --run-command "cd /etc/puppet/modules/ && tar xzf puppet-opendaylight.tar.gz" -a overcloud-full-odl.qcow2
# move and Sanitize private keys from instack.json file