diff --git a/cinder/tests/unit/volume/drivers/test_quobyte.py b/cinder/tests/unit/volume/drivers/test_quobyte.py index c4936fd3bb1..ccd61524af8 100644 --- a/cinder/tests/unit/volume/drivers/test_quobyte.py +++ b/cinder/tests/unit/volume/drivers/test_quobyte.py @@ -608,13 +608,11 @@ class QuobyteDriverTestCase(test.TestCase): img_info = imageutils.QemuImgInfo(qemu_img_info_output) - drv.get_active_image_from_info = mock.Mock(return_value=volume['name']) image_utils.qemu_img_info = mock.Mock(return_value=img_info) image_utils.resize_image = mock.Mock() drv.extend_volume(volume, 3) - drv.get_active_image_from_info.assert_called_once_with(volume) image_utils.qemu_img_info.assert_called_once_with(volume_path, run_as_root=False) image_utils.resize_image.assert_called_once_with(volume_path, 3) diff --git a/cinder/volume/drivers/quobyte.py b/cinder/volume/drivers/quobyte.py index 63cc2e4cbe4..bcc19e4d45e 100644 --- a/cinder/volume/drivers/quobyte.py +++ b/cinder/volume/drivers/quobyte.py @@ -31,7 +31,7 @@ from cinder import interface from cinder import utils from cinder.volume.drivers import remotefs as remotefs_drv -VERSION = '1.1.4' +VERSION = '1.1.5' LOG = logging.getLogger(__name__) @@ -84,6 +84,7 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed): 1.1.2 - Fixes a bug in the creation of cloned volumes 1.1.3 - Explicitely mounts Quobyte volumes w/o xattrs 1.1.4 - Fixes capability to configure redundancy in quobyte_volume_url + 1.1.5 - Enables extension of volumes with snapshots """ @@ -301,14 +302,6 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed): @utils.synchronized('quobyte', external=False) def extend_volume(self, volume, size_gb): volume_path = self.local_path(volume) - volume_filename = os.path.basename(volume_path) - - # Ensure no snapshots exist for the volume - active_image = self.get_active_image_from_info(volume) - if volume_filename != active_image: - msg = _('Extend volume is only supported for this' - ' driver when no snapshots exist.') - raise exception.InvalidVolume(msg) info = self._qemu_img_info(volume_path, volume.name) backing_fmt = info.file_format @@ -318,7 +311,10 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed): raise exception.InvalidVolume(msg % backing_fmt) # qemu-img can resize both raw and qcow2 files - image_utils.resize_image(volume_path, size_gb) + active_path = os.path.join( + self._get_mount_point_for_share(volume.provider_location), + self.get_active_image_from_info(volume)) + image_utils.resize_image(active_path, size_gb) def _do_create_volume(self, volume): """Create a volume on given Quobyte volume.