Browse code

Merge "XenAPI: Get the management network dynamically"

Jenkins authored on 2013/10/09 00:00:55
Showing 2 changed files
... ...
@@ -96,6 +96,10 @@ create_directory_for_images
96 96
 #
97 97
 # Configure Networking
98 98
 #
99
+
100
+MGT_NETWORK=`xe pif-list management=true params=network-uuid minimal=true`
101
+MGT_BRIDGE_OR_NET_NAME=`xe network-list uuid=$MGT_NETWORK params=bridge minimal=true`
102
+
99 103
 setup_network "$VM_BRIDGE_OR_NET_NAME"
100 104
 setup_network "$MGT_BRIDGE_OR_NET_NAME"
101 105
 setup_network "$PUB_BRIDGE_OR_NET_NAME"
... ...
@@ -203,6 +207,7 @@ if [ -z "$templateuuid" ]; then
203 203
     #
204 204
     # Install Ubuntu over network
205 205
     #
206
+    UBUNTU_INST_BRIDGE_OR_NET_NAME=${UBUNTU_INST_BRIDGE_OR_NET_NAME:-"$MGT_BRIDGE_OR_NET_NAME"}
206 207
 
207 208
     # always update the preseed file, incase we have a newer one
208 209
     PRESEED_URL=${PRESEED_URL:-""}
... ...
@@ -20,9 +20,7 @@ OSDOMU_VDI_GB=8
20 20
 # differ across localised versions of XenServer. If a given bridge/network
21 21
 # was not found, a new network will be created with the specified name.
22 22
 
23
-# The management network is specified by the bridge name. xenbr0 is usually
24
-# the name of the bridge of the network associated with the hypervisor's eth0.
25
-MGT_BRIDGE_OR_NET_NAME="xenbr0"
23
+# Get the management network from the XS installation
26 24
 VM_BRIDGE_OR_NET_NAME="OpenStack VM Network"
27 25
 PUB_BRIDGE_OR_NET_NAME="OpenStack Public Network"
28 26
 XEN_INT_BRIDGE_OR_NET_NAME="OpenStack VM Integration Network"
... ...
@@ -72,7 +70,6 @@ UBUNTU_INST_HTTP_PROXY=""
72 72
 UBUNTU_INST_LOCALE="en_US"
73 73
 UBUNTU_INST_KEYBOARD="us"
74 74
 # network configuration for ubuntu netinstall
75
-UBUNTU_INST_BRIDGE_OR_NET_NAME=${UBUNTU_INST_BRIDGE_OR_NET_NAME:-"$MGT_BRIDGE_OR_NET_NAME"}
76 75
 UBUNTU_INST_IP="dhcp"
77 76
 UBUNTU_INST_NAMESERVERS=""
78 77
 UBUNTU_INST_NETMASK=""