diff options
-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 |