Merge "Creating image-volume cache on NFS backend fails"

This commit is contained in:
Zuul 2020-05-29 18:29:10 +00:00 committed by Gerrit Code Review
commit cb52912eb6
3 changed files with 13 additions and 2 deletions

View File

@ -280,7 +280,9 @@ class RemoteFsSnapDriverTestCase(test.TestCase):
exp_acceptable_states = ['available', 'in-use', 'backing-up']
if tmp_snap:
exp_acceptable_states.append('downloading')
self._fake_snapshot.id = 'tmp-snap-%s' % self._fake_snapshot.id
self._fake_snapshot.volume.status = 'downloading'
display_name = 'tmp-snap-%s' % self._fake_snapshot.id
self._fake_snapshot.display_name = display_name
if volume_in_use:
self._fake_snapshot.volume.status = 'backing-up'
@ -315,6 +317,9 @@ class RemoteFsSnapDriverTestCase(test.TestCase):
self._driver._create_snapshot,
self._fake_snapshot)
def test_create_snapshot_w_image_caching(self):
self._test_create_snapshot(tmp_snap=True)
@mock.patch('cinder.db.snapshot_get')
@mock.patch('time.sleep')
def test_create_snapshot_online_with_concurrent_delete(

View File

@ -1440,7 +1440,7 @@ class RemoteFSSnapDriverBase(RemoteFSDriver):
status = snapshot.volume.status
acceptable_states = ['available', 'in-use', 'backing-up']
if snapshot.id.startswith('tmp-snap-'):
if snapshot.display_name.startswith('tmp-snap-'):
# This is an internal volume snapshot. In order to support
# image caching, we'll allow creating/deleting such snapshots
# while having volumes in 'downloading' state.

View File

@ -0,0 +1,6 @@
---
fixes:
- |
`Bug #1875570 <https://bugs.launchpad.net/cinder/+bug/1875570>`:
Fixed issue with NFS backend where the image-volume cache was
never used to create a volume, even when the cache was enabled.