Browse code

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

Mate Lakat authored on 2013/10/29 03:15:57
Showing 1 changed files
... ...
@@ -271,6 +271,12 @@ set_vm_memory "$GUEST_NAME" "$OSDOMU_MEM_MB"
271 271
 # Max out VCPU count for better performance
272 272
 max_vcpus "$GUEST_NAME"
273 273
 
274
+# Wipe out all network cards
275
+destroy_all_vifs_of "$GUEST_NAME"
276
+
277
+# Add only one interface to prepare the guest template
278
+add_interface "$GUEST_NAME" "$MGT_BRIDGE_OR_NET_NAME" "0"
279
+
274 280
 # start the VM to run the prepare steps
275 281
 xe vm-start vm="$GUEST_NAME"
276 282