diff options
author | Zuul <zuul@review.opendev.org> | 2020-10-06 18:32:37 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2020-10-06 18:32:37 +0000 |
commit | 606b951cbaad27c13e5834cc66c10f6e12f81511 (patch) | |
tree | c53574d2b1680cf890e105b09188e19ee7a0ad47 | |
parent | a721ca5f510ce3c8ef24f22dac9e475b3d7651db (diff) | |
parent | 69ae27579d7ac5fdd30efd57dbde62beff86d5ea (diff) | |
download | nova-606b951cbaad27c13e5834cc66c10f6e12f81511.tar.gz |
Merge "compute: Allow snapshots to be created from PAUSED volume backed instances" into stable/queens
-rw-r--r-- | nova/compute/api.py | 2 | ||||
-rw-r--r-- | nova/tests/unit/compute/test_compute_api.py | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index 6f1ff7c48e..e756cdd1ba 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -2938,7 +2938,7 @@ 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, - vm_states.SUSPENDED]) + vm_states.PAUSED, vm_states.SUSPENDED]) def snapshot_volume_backed(self, context, instance, name, extra_properties=None): """Snapshot the given volume-backed instance. diff --git a/nova/tests/unit/compute/test_compute_api.py b/nova/tests/unit/compute/test_compute_api.py index a1c8de7f33..ed44e4b343 100644 --- a/nova/tests/unit/compute/test_compute_api.py +++ b/nova/tests/unit/compute/test_compute_api.py @@ -3415,6 +3415,11 @@ class _ComputeAPIUnitTestMixIn(object): quiesce_unsupported=True, vm_state=vm_states.SUSPENDED) + def test_snapshot_volume_backed_with_pause(self): + self._test_snapshot_volume_backed(quiesce_required=False, + quiesce_unsupported=True, + vm_state=vm_states.PAUSED) + @mock.patch.object(context, 'set_target_cell') @mock.patch.object(objects.BlockDeviceMapping, 'get_by_volume') def test_get_bdm_by_volume_id(self, mock_get_by_volume, |