]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix HP LeftHand Performance issue with AO
authorJim Branen <james.branen@hp.com>
Wed, 5 Mar 2014 00:38:41 +0000 (16:38 -0800)
committerJim Branen <james.branen@hp.com>
Wed, 5 Mar 2014 22:09:41 +0000 (14:09 -0800)
Setting AdaptiveOptimization (AO) to ‘true’, the default value,
at volume create time significantly slows down the operation on
the LeftHand array. If at create time, AO is set to ‘true’, it
will result in an update operation following the create operation
to set this value. Therefore, it is best to not specify the value,
when ‘true’, and let it default to ‘true’.

Change-Id: I2c8860e3f25a7bcaa2d2efefeffc1c11319f33e2
Closes-Bug:#1285925

cinder/tests/test_hplefthand.py
cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py

index 36428c564df6e31a0bba95bbdf3ae899f4027610..040ad86bf85936405f7ce15cef30f82cd3c16355 100644 (file)
@@ -1300,3 +1300,67 @@ class TestHPLeftHandRESTISCSIDriver(HPLeftHandBaseDriver, test.TestCase):
         self.assertEqual(
             len(expected),
             len(mock_client.method_calls))
+
+    @mock.patch.object(volume_types, 'get_volume_type',
+                       return_value={'extra_specs': {'hplh:ao': 'true'}})
+    def test_create_volume_with_ao_true(self, _mock_volume_type):
+
+        # setup drive with default configuration
+        # and return the mock HTTP LeftHand client
+        mock_client = self.setup_driver()
+
+        volume_with_vt = self.volume
+        volume_with_vt['volume_type_id'] = 1
+
+        # mock return value of createVolume
+        mock_client.createVolume.return_value = {
+            'iscsiIqn': self.connector['initiator']}
+
+        volume_info = self.driver.create_volume(volume_with_vt)
+
+        self.assertEqual('10.0.1.6:3260,1 iqn.1993-08.org.debian:01:222 0',
+                         volume_info['provider_location'])
+
+        # make sure createVolume is called without
+        # isAdaptiveOptimizationEnabled == true
+        expected = self.driver_startup_call_stack + [
+            mock.call.createVolume(
+                'fakevolume',
+                1,
+                units.GiB,
+                {'isThinProvisioned': True, 'clusterName': 'CloudCluster1'})]
+
+        mock_client.assert_has_calls(expected)
+
+    @mock.patch.object(volume_types, 'get_volume_type',
+                       return_value={'extra_specs': {'hplh:ao': 'false'}})
+    def test_create_volume_with_ao_false(self, _mock_volume_type):
+
+        # setup drive with default configuration
+        # and return the mock HTTP LeftHand client
+        mock_client = self.setup_driver()
+
+        volume_with_vt = self.volume
+        volume_with_vt['volume_type_id'] = 1
+
+        # mock return value of createVolume
+        mock_client.createVolume.return_value = {
+            'iscsiIqn': self.connector['initiator']}
+
+        volume_info = self.driver.create_volume(volume_with_vt)
+
+        self.assertEqual('10.0.1.6:3260,1 iqn.1993-08.org.debian:01:222 0',
+                         volume_info['provider_location'])
+
+        # make sure createVolume is called with
+        # isAdaptiveOptimizationEnabled == false
+        expected = self.driver_startup_call_stack + [
+            mock.call.createVolume(
+                'fakevolume',
+                1,
+                units.GiB,
+                {'isThinProvisioned': True,
+                 'clusterName': 'CloudCluster1',
+                 'isAdaptiveOptimizationEnabled': False})]
+
+        mock_client.assert_has_calls(expected)
index 80c08ac8488eecdf219f71dd73ee8c2cdfe3a052..3ec60770b2386bc081fa6c5da1c616fadc204d34 100644 (file)
@@ -87,9 +87,11 @@ class HPLeftHandRESTProxy(ISCSIDriver):
         1.0.2 - Added support for volume migrate
         1.0.3 - Fixed bug #1285829, HP LeftHand backend assisted migration
                 should check for snapshots
+        1.0.4 - Fixed bug #1285925, LeftHand AO volume create performance
+                improvement
     """
 
-    VERSION = "1.0.3"
+    VERSION = "1.0.4"
 
     device_stats = {}
 
@@ -152,6 +154,15 @@ class HPLeftHandRESTProxy(ISCSIDriver):
             if 'isThinProvisioned' not in optional:
                 optional['isThinProvisioned'] = True
 
+            # AdaptiveOptimization defaults to 'true' if you don't specify the
+            # value on a create, and that is the most efficient way to create
+            # a volume. If you pass in 'false' or 'true' for AO, it will result
+            # in an update operation following the create operation to set this
+            # value, so it is best to not specify the value and let it default
+            # to 'true'.
+            if optional.get('isAdaptiveOptimizationEnabled'):
+                del optional['isAdaptiveOptimizationEnabled']
+
             clusterName = self.configuration.hplefthand_clustername
             optional['clusterName'] = clusterName