Browse Source

Merge "compute: Allow snapshots to be created from PAUSED volume backed instances" into stable/rocky

changes/22/749222/1
Zuul 4 weeks ago
committed by Gerrit Code Review
parent
commit
837baac9fd
2 changed files with 6 additions and 1 deletions
  1. +1
    -1
      nova/compute/api.py
  2. +5
    -0
      nova/tests/unit/compute/test_compute_api.py

+ 1
- 1
nova/compute/api.py View File

@@ -2991,7 +2991,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.


+ 5
- 0
nova/tests/unit/compute/test_compute_api.py View File

@@ -3427,6 +3427,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,


Loading…
Cancel
Save