diff options
| author | Rafi Khardalian <rafi@metacloud.com> | 2013-01-18 06:23:02 +0000 |
|---|---|---|
| committer | Rafi Khardalian <rafi@metacloud.com> | 2013-01-21 21:20:55 +0000 |
| commit | c538024fddc5994afe13f41817b9fe0b8e8f3fdd (patch) | |
| tree | 9233c276c04124b9e55fadf48e43ff8ee0d0becb /nova/virt | |
| parent | 341d5b5e33d8e4944f8d79460606fc1dd4b9ef10 (diff) | |
Allow snapshots of paused and suspended instances
Fixes bug 1100556
Remove the restriction in the API of snapshotting instances which
are in paused or suspended states and update the libvirt driver
to deal with this accordingly.
Other drivers may need to be updated accordingly.
Change-Id: Iabeb44f843c3c04f767c4103038fcf6c52966ff3
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/libvirt/driver.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 115c6cd02..e51883843 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -808,7 +808,7 @@ class LibvirtDriver(driver.ComputeDriver): # NOTE(dkang): managedSave does not work for LXC if CONF.libvirt_type != 'lxc': - if state == power_state.RUNNING: + if state == power_state.RUNNING or state == power_state.PAUSED: virt_dom.managedSave(0) # Make the snapshot @@ -832,6 +832,9 @@ class LibvirtDriver(driver.ComputeDriver): if CONF.libvirt_type != 'lxc': if state == power_state.RUNNING: self._create_domain(domain=virt_dom) + elif state == power_state.PAUSED: + self._create_domain(domain=virt_dom, + launch_flags=libvirt.VIR_DOMAIN_START_PAUSED) # Upload that image to the image service |
