diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-01-23 07:33:30 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-01-23 07:33:30 +0000 |
commit | a1c1e1bac155666d93f4003841132e66b3599ca8 (patch) | |
tree | 101be1d30ac03b598f8dc371af934a8471cec5a1 | |
parent | 294c57397cacfd54739a65849bc3e829e0d8eda6 (diff) | |
parent | c538024fddc5994afe13f41817b9fe0b8e8f3fdd (diff) | |
download | nova-a1c1e1bac155666d93f4003841132e66b3599ca8.tar.gz nova-a1c1e1bac155666d93f4003841132e66b3599ca8.tar.xz nova-a1c1e1bac155666d93f4003841132e66b3599ca8.zip |
Merge "Allow snapshots of paused and suspended instances"
-rw-r--r-- | nova/compute/api.py | 3 | ||||
-rw-r--r-- | nova/virt/libvirt/driver.py | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index a2af492c9..f6090b40c 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1370,7 +1370,8 @@ class API(base.Base): return image_meta @wrap_check_policy - @check_instance_state(vm_state=[vm_states.ACTIVE, vm_states.STOPPED]) + @check_instance_state(vm_state=[vm_states.ACTIVE, vm_states.STOPPED, + vm_states.PAUSED, vm_states.SUSPENDED]) def snapshot(self, context, instance, name, extra_properties=None, image_id=None): """Snapshot the given instance. diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 2872e6bbf..1692dc086 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -809,7 +809,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 @@ -833,6 +833,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 |