Merge "NetApp ONTAP: Set new sub-lun clone limit for ONTAP driver" into stable/pike

This commit is contained in:
Zuul 2018-06-05 19:54:02 +00:00 committed by Gerrit Code Review
commit b8619b84bf
3 changed files with 13 additions and 11 deletions

View File

@ -733,9 +733,9 @@ class NetAppCmodeClientTestCase(test.TestCase):
def test_clone_lun_multiple_zapi_calls(self):
"""Test for when lun clone requires more than one zapi call."""
# Max block-ranges per call = 32, max blocks per range = 2^24
# Max clone size per call = 2^18 blocks * 512 bytes/block = 128 MB
# Force 2 calls
bc = 2 ** 24 * 32 * 2
bc = 2 ** 18 * 2
self.client.clone_lun('volume', 'fakeLUN', 'newFakeLUN',
block_count=bc)
self.assertEqual(2, self.connection.invoke_successfully.call_count)

View File

@ -450,19 +450,16 @@ class Client(client_base.Client):
def clone_lun(self, volume, name, new_name, space_reserved='true',
qos_policy_group_name=None, src_block=0, dest_block=0,
block_count=0, source_snapshot=None, is_snapshot=False):
# zAPI can only handle 2^24 blocks per range
bc_limit = 2 ** 24 # 8GB
# zAPI can only handle 32 block ranges per call
br_limit = 32
z_limit = br_limit * bc_limit # 256 GB
z_calls = int(math.ceil(block_count / float(z_limit)))
# ONTAP handles only 128 MB per call as of v9.1
bc_limit = 2 ** 18 # 2^18 blocks * 512 bytes/block = 128 MB
z_calls = int(math.ceil(block_count / float(bc_limit)))
zbc = block_count
if z_calls == 0:
z_calls = 1
for _call in range(0, z_calls):
if zbc > z_limit:
block_count = z_limit
zbc -= z_limit
if zbc > bc_limit:
block_count = bc_limit
zbc -= bc_limit
else:
block_count = zbc

View File

@ -0,0 +1,5 @@
---
fixes:
- |
NetApp ONTAP (bug 1762424): Fix ONTAP NetApp driver not being able to extend
a volume to a size greater than the corresponding LUN max geometry.