xenapi: always reset JeOS's network
If the JeOS template contained an exotic network configuration, the VM
prep step might fail. This patch resets the networking of the VM before
starting it.
Fixes bug 1245607
Change-Id: I921f1fdd0709d7a7760c4bb165e32f3898098bff
diff --git a/tools/xen/install_os_domU.sh b/tools/xen/install_os_domU.sh
index 9a2f5a8..33dc26f 100755
--- a/tools/xen/install_os_domU.sh
+++ b/tools/xen/install_os_domU.sh
@@ -271,6 +271,12 @@
# Max out VCPU count for better performance
max_vcpus "$GUEST_NAME"
+# Wipe out all network cards
+destroy_all_vifs_of "$GUEST_NAME"
+
+# Add only one interface to prepare the guest template
+add_interface "$GUEST_NAME" "$MGT_BRIDGE_OR_NET_NAME" "0"
+
# start the VM to run the prepare steps
xe vm-start vm="$GUEST_NAME"