Merge "Create image for suspended instance booted from volume"

This commit is contained in:
Jenkins
2016-04-20 17:46:58 +00:00
committed by Gerrit Code Review
2 changed files with 10 additions and 1 deletions

View File

@@ -2326,7 +2326,8 @@ class API(base.Base):
# NOTE(melwitt): We don't check instance lock for snapshot because lock is
# intended to prevent accidental change/delete of instances
@check_instance_state(vm_state=[vm_states.ACTIVE, vm_states.STOPPED])
@check_instance_state(vm_state=[vm_states.ACTIVE, vm_states.STOPPED,
vm_states.SUSPENDED])
def snapshot_volume_backed(self, context, instance, name,
extra_properties=None):
"""Snapshot the given volume-backed instance.

View File

@@ -2405,6 +2405,14 @@ class _ComputeAPIUnitTestMixIn(object):
self._test_snapshot_volume_backed(True, True,
vm_state=vm_states.STOPPED)
def test_snapshot_volume_backed_with_quiesce_suspended(self):
self._test_snapshot_volume_backed(True, True,
vm_state=vm_states.SUSPENDED)
def test_snapshot_volume_backed_with_suspended(self):
self._test_snapshot_volume_backed(False, True,
vm_state=vm_states.SUSPENDED)
def test_volume_snapshot_create(self):
volume_id = '1'
create_info = {'id': 'eyedee'}