Skip to content

Instantly share code, notes, and snippets.

@ramielrowe
Created September 18, 2014 18:12
Show Gist options
  • Select an option

  • Save ramielrowe/7f674f6db1c6f47a0ec0 to your computer and use it in GitHub Desktop.

Select an option

Save ramielrowe/7f674f6db1c6f47a0ec0 to your computer and use it in GitHub Desktop.
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py
index 39af093..a2586e9 100644
--- a/nova/virt/libvirt/driver.py
+++ b/nova/virt/libvirt/driver.py
@@ -976,10 +976,6 @@ class LibvirtDriver(driver.ComputeDriver):
old_domid = virt_dom.ID()
virt_dom.destroy()
- # NOTE(GuanQiang): teardown container to avoid resource leak
- if CONF.libvirt.virt_type == 'lxc':
- self._teardown_container(instance)
-
except libvirt.libvirtError as e:
is_okay = False
errcode = e.get_error_code()
@@ -1046,6 +1042,10 @@ class LibvirtDriver(driver.ComputeDriver):
LOG.info(_LI("Going to destroy instance again."),
instance=instance)
self._destroy(instance)
+ else:
+ # NOTE(GuanQiang): teardown container to avoid resource leak
+ if CONF.libvirt.virt_type == 'lxc':
+ self._teardown_container(instance)
def destroy(self, context, instance, network_info, block_device_info=None,
destroy_disks=True, migrate_data=None):
@@ -2367,7 +2367,8 @@ class LibvirtDriver(driver.ComputeDriver):
# start the instance.
self._create_domain_and_network(context, xml, instance, network_info,
block_device_info, reboot=True,
- vifs_already_plugged=True)
+ vifs_already_plugged=True,
+ disk_info=disk_info)
self._prepare_pci_devices_for_use(
pci_manager.get_instance_pci_devs(instance, 'all'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment