]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
3PAR Disable generic image volume cache
authorWalter A. Boring IV <walter.boring@hp.com>
Tue, 1 Sep 2015 18:59:22 +0000 (11:59 -0700)
committerWalter A. Boring IV (hemna) <walter.boring@hp.com>
Mon, 7 Sep 2015 17:06:42 +0000 (17:06 +0000)
This patch disables the 3PAR drivers if an admin tries to
enable the generic image volume cache capability.

The 3PAR drivers don't work with this currently because of the way volume
cloning works in the drivers.  When a volume is cloned, it's done so
in the background, which makes the clone available immediately for attaching.
The problem is, a background cloning also locks the original volume from
being modified.  The generic image cache does a clone, and then an extend
volume, which fails for the 3PAR drivers currently.

Change-Id: If2e79a24969ab85bacdffdf750af5fc74be37a5c
Partial-Bug: 1491088

cinder/tests/unit/test_hp3par.py
cinder/volume/drivers/san/hp/hp_3par_common.py

index bc78bd8254daf2df69cd0c05f09a1d911ac9f4b8..1b3bdb09c39e6d261ffe7f30689439067fcd6048 100644 (file)
@@ -533,6 +533,7 @@ class HP3PARBaseDriver(object):
         configuration.hp3par_iscsi_chap_enabled = False
         configuration.goodness_function = GOODNESS_FUNCTION
         configuration.filter_function = FILTER_FUNCTION
+        configuration.image_volume_cache_enabled = False
         return configuration
 
     @mock.patch(
index 9be8035531246799f7657408b59cd22cbc4b9876..a4abc448f8309f7117051c2199c9ed68211bff50 100644 (file)
@@ -336,6 +336,17 @@ class HP3PARCommon(object):
                         {'srstatld_version': SRSTATLD_API_VERSION,
                          'version': self.API_VERSION})
 
+        # TODO(walter-boring) BUG: 1491088.  For the time being disable
+        # making the drivers usable if they enable the image cache
+        # The image cache feature fails on 3PAR drivers
+        # because it tries to extend a volume as it's still being cloned.
+        if self.config.image_volume_cache_enabled:
+            msg = _("3PAR drivers do not support enabling the image "
+                    "cache capability at this time.  You must disable "
+                    "the configuration setting in cinder.conf")
+            LOG.error(msg)
+            raise exception.InvalidInput(message=msg)
+
     def check_for_setup_error(self):
         self.client_login()
         try: