From 8787e0fd0c4b2ec29e6016a13e913a9ef3ac5444 Mon Sep 17 00:00:00 2001 From: Mate Lakat Date: Mon, 28 Oct 2013 18:15:57 +0000 Subject: [PATCH] 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 --- tools/xen/install_os_domU.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/xen/install_os_domU.sh b/tools/xen/install_os_domU.sh index 9a2f5a8c03..33dc26f1bb 100755 --- a/tools/xen/install_os_domU.sh +++ b/tools/xen/install_os_domU.sh @@ -271,6 +271,12 @@ set_vm_memory "$GUEST_NAME" "$OSDOMU_MEM_MB" # 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"