Fix HP LeftHand Performance issue with AO

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
This commit is contained in:
Jim Branen 2014-03-04 16:38:41 -08:00
parent cf20c69024
commit 52a7d601a0
2 changed files with 76 additions and 1 deletions

View File

@ -1300,3 +1300,67 @@ class TestHPLeftHandRESTISCSIDriver(HPLeftHandBaseDriver, test.TestCase):
self.assertEqual( self.assertEqual(
len(expected), len(expected),
len(mock_client.method_calls)) 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)

View File

@ -87,9 +87,11 @@ class HPLeftHandRESTProxy(ISCSIDriver):
1.0.2 - Added support for volume migrate 1.0.2 - Added support for volume migrate
1.0.3 - Fixed bug #1285829, HP LeftHand backend assisted migration 1.0.3 - Fixed bug #1285829, HP LeftHand backend assisted migration
should check for snapshots 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 = {} device_stats = {}
@ -152,6 +154,15 @@ class HPLeftHandRESTProxy(ISCSIDriver):
if 'isThinProvisioned' not in optional: if 'isThinProvisioned' not in optional:
optional['isThinProvisioned'] = True 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 clusterName = self.configuration.hplefthand_clustername
optional['clusterName'] = clusterName optional['clusterName'] = clusterName