]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
GlusterFS: support extending a volume that has snapshots
authorBharat Kumar Kobagana <bharat.kobagana@redhat.com>
Wed, 1 Jul 2015 16:14:43 +0000 (21:44 +0530)
committerBharat Kumar Kobagana <bharat.kobagana@redhat.com>
Wed, 1 Jul 2015 16:17:01 +0000 (21:47 +0530)
GlusterFS driver currently prevents extending a volume that has
snapshots. This patch enables this feature to GlusterFS driver.

Closes-Bug: #1470148
Change-Id: I763b1a84f32277f3efab2382ad144768bee59aa6

cinder/volume/drivers/glusterfs.py

index bd9e0fa6e84e348b69cac29a934d64230de836da..312e2fc361799804c3711504ab9e9903a3ecd905 100644 (file)
@@ -321,14 +321,6 @@ class GlusterfsDriver(remotefs_drv.RemoteFSSnapDriver, driver.CloneableVD,
     @remotefs_drv.locked_volume_id_operation
     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