Skip to content

Commit

Permalink
Merge "compute: Allow snapshots to be created from PAUSED volume back…
Browse files Browse the repository at this point in the history
…ed instances" into stable/stein
  • Loading branch information
Zuul authored and openstack-gerrit committed Jul 24, 2020
2 parents 5482dde + 04a8399 commit e91540f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nova/compute/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3152,7 +3152,7 @@ def snapshot(self, context, instance, name, extra_properties=None):
# 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.
Expand Down
5 changes: 5 additions & 0 deletions nova/tests/unit/compute/test_compute_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3450,6 +3450,11 @@ def test_snapshot_volume_backed_with_suspended(self):
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,
Expand Down

0 comments on commit e91540f

Please sign in to comment.