Enable MaaS to configure interfaces in virtual compute node

Change-Id: I0b10b8a979a69cf5eaa6e28f79fc6b751e23482f
diff --git a/Vagrantfile b/Vagrantfile
index 089bb9e..2044f7d 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -103,6 +103,9 @@
       dev: "mgmtbr",
       mode: "bridge",
       type: "bridge"
+    c.vm.network "private_network",
+      adapter: 2,
+      ip: "10.6.1.2"
     c.vm.provider :libvirt do |domain|
       domain.memory = 8192
       domain.cpus = 4
diff --git a/config/cord_in_a_box.yml b/config/cord_in_a_box.yml
index 1a68ac0..da1927e 100644
--- a/config/cord_in_a_box.yml
+++ b/config/cord_in_a_box.yml
@@ -24,7 +24,7 @@
     - 'reboot'
     - 'interface_config'
 
-  fabric_ip: '10.1.1.1/24'
+  fabric_ip: '10.6.1.1/24'
   management_ip: '10.1.0.1/24'
   external_iface: 'eth0'
   management_network: '10.1.0.0/24'
@@ -39,6 +39,11 @@
   extraVars:
     #- 'on_cloudlab=True'
     - 'cord_in_a_box=True'
+    - 'fabric_include_names=eth2'
+    - 'fabric_include_module_types=omit'
+    - 'fabric_exclude_names=eth0,eth1'
+    - 'management_include_names=eth1'
+    - 'management_exclude_names=eth0,eth2'
 
 docker:
   imageVersion: candidate
@@ -46,6 +51,5 @@
 otherServers:
   # Specifies the configuration for dynamically added compute nodes
   fabric:
-    network: '10.1.1.1/24'
-    range_low: '10.1.1.2'
-    range_high: '10.1.1.253'
+    network: '10.6.1.1/24'
+    management: '10.1.0.0/24'
diff --git a/docs/quickstart.md b/docs/quickstart.md
index cbae82f..b59f88e 100644
--- a/docs/quickstart.md
+++ b/docs/quickstart.md
@@ -123,8 +123,7 @@
 This VM can be entered as follows:
 
 ```
-source ~/admin-openrc.sh
-ssh ubuntu@$( nova service-list | grep nova-compute | awk '{print $4}' )
+ssh ubuntu@$( cord prov list | tail -1 | awk '{print $2}' )
 ```
 
 ### Docker Containers
@@ -192,18 +191,17 @@
 
 ```
 TASK [test-vsg : Output from ping test] ****************************************
-Thursday 28 July 2016  15:00:17 -0600 (0:00:03.367)       0:01:20.075 *********
-ok: [localhost] => {
+Thursday 27 October 2016  15:29:17 +0000 (0:00:03.144)       0:19:21.336 ******
+ok: [10.100.198.201] => {
     "pingtest.stdout_lines": [
-        "nova-compute-1 | SUCCESS | rc=0 >>",
         "PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.",
-        "64 bytes from 8.8.8.8: icmp_seq=1 ttl=45 time=5.30 ms",
-        "64 bytes from 8.8.8.8: icmp_seq=2 ttl=45 time=5.29 ms",
-        "64 bytes from 8.8.8.8: icmp_seq=3 ttl=45 time=5.36 ms",
+        "64 bytes from 8.8.8.8: icmp_seq=1 ttl=47 time=29.7 ms",
+        "64 bytes from 8.8.8.8: icmp_seq=2 ttl=47 time=29.2 ms",
+        "64 bytes from 8.8.8.8: icmp_seq=3 ttl=47 time=29.1 ms",
         "",
         "--- 8.8.8.8 ping statistics ---",
         "3 packets transmitted, 3 received, 0% packet loss, time 2003ms",
-        "rtt min/avg/max/mdev = 5.295/5.320/5.365/0.031 ms"
+        "rtt min/avg/max/mdev = 29.176/29.367/29.711/0.243 ms"
     ]
 }
 ```
@@ -224,10 +222,9 @@
 
 ```
 TASK [test-exampleservice : Output from curl test] *****************************
-Thursday 28 July 2016  15:01:43 -0600 (0:00:01.441)       0:02:46.634 *********
-ok: [localhost] => {
+Thursday 27 October 2016  15:34:40 +0000 (0:00:01.116)       0:24:44.732 ******
+ok: [10.100.198.201] => {
     "curltest.stdout_lines": [
-        "nova-compute-1 | SUCCESS | rc=0 >>",
         "ExampleService",
         " Service Message: \"hello\"",
         " Tenant Message: \"world\""
diff --git a/scripts/cord-in-a-box.sh b/scripts/cord-in-a-box.sh
index 32e6265..4897044 100755
--- a/scripts/cord-in-a-box.sh
+++ b/scripts/cord-in-a-box.sh
@@ -86,7 +86,9 @@
 
     # Set external interface in config file
     IFACE=$(route | grep default | awk '{print $8}' )
-    sed -i "s/eth0/$IFACE/" $CONFIG
+    SRC="'eth0'"
+    DST="'"$IFACE"'"
+    sed -i "s/$SRC/$DST/" $CONFIG
   fi
 
   cd $CORDDIR/build
@@ -112,14 +114,6 @@
 function unfortunate_hacks() {
   cd $CORDDIR/build
 
-  # Disable interface rename during MAAS provision
-  sed -i 's/"INTERFACE_CONFIG=1"/"INTERFACE_CONFIG=0"/' maas/roles/maas/templates/automation-compose.yml.j2
-
-  # Don't require fabric_ip
-  SRC="fabric_ip | mandatory"
-  DST="fabric_ip | default('manual')"
-  sed -i "s/$SRC/$DST/" maas/roles/compute-node/vars/main.yml
-
   # Allow compute nodes to PXE boot from mgmtbr
   sed -i "s/@type='udp']/@type='udp' or @type='bridge']/" \
     ~/.vagrant.d/gems/gems/vagrant-libvirt-0.0.35/lib/vagrant-libvirt/action/set_boot_order.rb
@@ -164,6 +158,15 @@
   cd $CORDDIR/build
   sudo su $USER -c 'vagrant up compute_node --provider libvirt'
 
+  # 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
+
+  # Add gateway IP addresses to virbr3 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
+
   # Sign into MAAS
   KEY=$(sudo maas-region-admin apikey --username=cord)
   maas login cord http://localhost/MAAS/api/1.0 $KEY