summaryrefslogtreecommitdiffstats
path: root/build/instack.sh
diff options
context:
space:
mode:
authorDan Radez <dradez@redhat.com>2015-11-04 16:13:02 -0500
committerDan Radez <dradez@redhat.com>2015-11-17 13:52:56 -0500
commitf2bddf8acd6f2d702209b1dda74e93afd6b78ff3 (patch)
treece2e05ffc122a4dfbbbb82e6e27babf9939eb0fe /build/instack.sh
parent56add2db32bf2060f50709d4168510e489e39b33 (diff)
adding basic network isolation
- separating external traffic from internal traffic JIRA: APEX-41 Change-Id: Idcd01a514083c53a3133a75d3bcabf824a7a4377
Diffstat (limited to 'build/instack.sh')
-rwxr-xr-xbuild/instack.sh28
1 files changed, 17 insertions, 11 deletions
diff --git a/build/instack.sh b/build/instack.sh
index 1e8e8b38..b682c8d9 100755
--- a/build/instack.sh
+++ b/build/instack.sh
@@ -83,6 +83,9 @@ if ! rpm -q libvirt-daemon-kvm > /dev/null; then
sudo yum install -y libvirt-daemon-kvm
fi
+# clean this up incase it's there
+sudo rm -f /tmp/instack.answers
+
# ensure that no previous undercloud VMs are running
# and rebuild the bare undercloud VMs
ssh -T ${SSH_OPTIONS[@]} stack@localhost <<EOI
@@ -90,10 +93,10 @@ set -e
virsh destroy instack 2> /dev/null || echo -n ''
virsh undefine instack --remove-all-storage 2> /dev/null || echo -n ''
for i in \$(seq 0 $vm_index); do
- virsh destroy baremetalbrbm_\$i 2> /dev/null || echo -n ''
- virsh undefine baremetalbrbm_\$i --remove-all-storage 2> /dev/null || echo -n ''
+ virsh destroy baremetalbrbm_brbm1_\$i 2> /dev/null || echo -n ''
+ virsh undefine baremetalbrbm_brbm1_\$i --remove-all-storage 2> /dev/null || echo -n ''
done
-NODE_COUNT=5 NODE_CPU=2 NODE_MEM=8192 instack-virt-setup
+NODE_COUNT=5 NODE_CPU=2 NODE_MEM=8192 TESTENV_ARGS="--baremetal-bridge-names 'brbm brbm1'" instack-virt-setup
EOI
# let dhcp happen so we can get the ip
@@ -132,13 +135,13 @@ EOI
# install undercloud on Undercloud VM
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
+# 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
@@ -160,26 +163,29 @@ fi
echo $'\nGenerating libvirt configuration'
for i in \$(seq 0 $vm_index); do
- virsh dumpxml baremetalbrbm_\$i > baremetalbrbm_\$i.xml
+ virsh dumpxml baremetalbrbm_brbm1_\$i | awk '/model type='\''virtio'\''/{c++;if(c==2){sub("model type='\''virtio'\''","model type='\''rtl8139'\''");c=0}}1' > baremetalbrbm_brbm1_\$i.xml
done
virsh dumpxml instack > instack.xml
-#virsh vol-dumpxml instack.qcow2 --pool default > instack.qcow2.xml
virsh net-dumpxml brbm > brbm-net.xml
+virsh net-dumpxml brbm1 > brbm1-net.xml
virsh pool-dumpxml default > default-pool.xml
EOI
# copy off the instack artifacts
echo "Copying instack files to build directory"
for i in $(seq 0 $vm_index); do
- scp ${SSH_OPTIONS[@]} stack@localhost:baremetalbrbm_${i}.xml .
+ scp ${SSH_OPTIONS[@]} stack@localhost:baremetalbrbm_brbm1_${i}.xml .
done
scp ${SSH_OPTIONS[@]} stack@localhost:instack.xml .
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_
@@ -227,8 +233,8 @@ set -e
virsh destroy instack 2> /dev/null || echo -n ''
virsh undefine instack --remove-all-storage 2> /dev/null || echo -n ''
for i in \$(seq 0 $vm_index); do
- virsh destroy baremetalbrbm_\$i 2> /dev/null || echo -n ''
- virsh undefine baremetalbrbm_\$i --remove-all-storage 2> /dev/null || echo -n ''
+ virsh destroy baremetalbrbm_brbm1_\$i 2> /dev/null || echo -n ''
+ virsh undefine baremetalbrbm_brbm1_\$i --remove-all-storage 2> /dev/null || echo -n ''
done
EOI