diff options
| author | Derek Higgins <higginsd@gmail.com> | 2011-11-04 00:25:34 +0000 |
|---|---|---|
| committer | Derek Higgins <higginsd@gmail.com> | 2011-11-09 22:48:46 +0000 |
| commit | ad7fcf225e126d2a719c04019c4daa1616d2159e (patch) | |
| tree | 0f28ccdebc4bd1d19bfa4367f80f345372f7f386 /nova/virt | |
| parent | 7a2e8a1d6798a1ff669cd245f35922c45b733b12 (diff) | |
Undefine libvirt saved instances
Fixes bug 814561
Adding a call to managedSaveRemove if the instance has a
saved instance, so they are now undefined in addition to running
instances during destroy
With test case
Also added myself to Authors
Change-Id: If93e8ac6972116152f38e187bd1a61c652855814
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/libvirt/connection.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py index c2a13f6a7..53a059052 100644 --- a/nova/virt/libvirt/connection.py +++ b/nova/virt/libvirt/connection.py @@ -311,6 +311,17 @@ class LibvirtConnection(driver.ComputeDriver): raise try: + # NOTE(derekh): we can switch to undefineFlags and + # VIR_DOMAIN_UNDEFINE_MANAGED_SAVE once we require 0.9.4 + if virt_dom.hasManagedSaveImage(0): + virt_dom.managedSaveRemove(0) + except libvirt.libvirtError as e: + errcode = e.get_error_code() + LOG.warning(_("Error from libvirt during saved instance " + "removal %(instance_name)s. Code=%(errcode)s" + " Error=%(e)s") % locals()) + + try: # NOTE(justinsb): We remove the domain definition. We probably # would do better to keep it if cleanup=False (e.g. volumes?) # (e.g. #2 - not losing machines on failure) |
