Specify NFS for sync_folder, fix bug with disabling mounts
Look up names of bridges created by libvirt
Add -s option to cord-in-a-box.sh script
Change-Id: I7805ce059096997f34f7c9f21adf5e31952fc152
diff --git a/Vagrantfile b/Vagrantfile
index 2044f7d..ac96263 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -12,7 +12,7 @@
config.vm.define "corddev" do |d|
d.ssh.forward_agent = true
d.vm.box = "ubuntu/trusty64"
- d.vm.synced_folder '.', '/vagrant', disable: true
+ d.vm.synced_folder '.', '/vagrant', disabled: true
d.vm.hostname = "corddev"
d.vm.network "private_network", ip: "10.100.198.200"
d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
@@ -20,14 +20,15 @@
d.vm.provider "virtualbox" do |v|
v.memory = 2048
end
- d.vm.provider :libvirt do |v|
+ d.vm.provider :libvirt do |v, override|
v.memory = 2048
+ override.vm.synced_folder "..", "/cord", type: "nfs"
end
end
config.vm.define "prod" do |d|
d.vm.box = "ubuntu/trusty64"
- d.vm.synced_folder '.', '/vagrant', disable: true
+ d.vm.synced_folder '.', '/vagrant', disabled: true
d.vm.hostname = "prod"
d.vm.network "private_network", ip: "10.100.198.201"
d.vm.network "private_network", ip: "0.0.0.0", virtualbox__intnet: "cord-test-network"
@@ -74,7 +75,7 @@
# Defining VM properties
config.vm.define "compute_node#{i}" do |c|
c.vm.box = "clink15/pxe"
- c.vm.synced_folder '.', '/vagrant', disable: true
+ c.vm.synced_folder '.', '/vagrant', disabled: true
c.vm.communicator = "none"
c.vm.hostname = "computenode"
c.vm.network "private_network",
@@ -94,7 +95,7 @@
# Not able to merge with virtualbox config for compute nodes above
# Issue is that here no box and no private network are specified
config.vm.define "compute_node" do |c|
- c.vm.synced_folder '.', '/vagrant', disable: true
+ c.vm.synced_folder '.', '/vagrant', disabled: true
c.vm.communicator = "none"
c.vm.hostname = "computenode"
c.vm.network "public_network",
diff --git a/scripts/cord-in-a-box.sh b/scripts/cord-in-a-box.sh
index 4897044..7091493 100755
--- a/scripts/cord-in-a-box.sh
+++ b/scripts/cord-in-a-box.sh
@@ -132,7 +132,8 @@
cd $CORDDIR/build
# Network setup to install physical server as head node
- ip addr list dev virbr2 | grep 10.100.198.201 || sudo ip addr add dev virbr2 10.100.198.201
+ BRIDGE=$( route -n | grep 10.100.198.0 | awk '{print $8}' )
+ ip addr list dev $BRIDGE | grep 10.100.198.201 || sudo ip addr add dev $BRIDGE 10.100.198.201
ifconfig mgmtbr || sudo brctl addbr mgmtbr
sudo ifconfig mgmtbr 10.1.0.1/24 up
@@ -160,12 +161,13 @@
# Change MAC address of bridge to match cord-pod service profile
# This change won't survive a reboot
- sudo ifconfig virbr3 hw ether 02:42:0a:06:01:01
+ BRIDGE=$( route -n | grep 10.6.1.0 | awk '{print $8}' )
+ sudo ifconfig $BRIDGE hw ether 02:42:0a:06:01:01
- # Add gateway IP addresses to virbr3 for vsg and exampleservice tests
+ # Add gateway IP addresses to $BRIDGE for vsg and exampleservice tests
# This change won't survive a reboot
- sudo ip address add 10.6.1.129 dev virbr3
- sudo ip address add 10.6.1.193 dev virbr3
+ sudo ip address add 10.6.1.129 dev $BRIDGE
+ sudo ip address add 10.6.1.193 dev $BRIDGE
# Sign into MAAS
KEY=$(sudo maas-region-admin apikey --username=cord)
@@ -216,11 +218,12 @@
# Parse options
RUN_TEST=0
+SETUP_ONLY=0
SETUP_BRANCH="master"
DIAGNOSTICS=0
CLEANUP=0
-while getopts "b:cdehi:p:r:ts:" opt; do
+while getopts "b:cdhst" opt; do
case ${opt} in
b ) XOS_BRANCH=$OPTARG
;;
@@ -234,9 +237,12 @@
echo " $0 -c cleanup from previous test"
echo " $0 -d run diagnostic collector"
echo " $0 -h display this help message"
+ echo " $0 -s run initial setup phase only (don't start building CORD)"
echo " $0 -t do install, bring up cord-pod configuration, run E2E test"
exit 0
;;
+ s ) SETUP_ONLY=1
+ ;;
t ) RUN_TEST=1
;;
\? ) echo "Invalid option: -$OPTARG"
@@ -257,6 +263,13 @@
cloudlab_setup
unfortunate_hacks
corddev_up
+
+if [[ $SETUP_ONLY -ne 0 ]]
+then
+ echo "Finished build environment setup, exiting..."
+ exit 0
+fi
+
install_head_node
set_up_maas_user
add_compute_node