diff --git a/cinder/tests/unit/volume/drivers/netapp/dataontap/client/test_client_cmode.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/client/test_client_cmode.py index 60e4c2cf745..2b75a7653bf 100644 --- a/cinder/tests/unit/volume/drivers/netapp/dataontap/client/test_client_cmode.py +++ b/cinder/tests/unit/volume/drivers/netapp/dataontap/client/test_client_cmode.py @@ -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) diff --git a/cinder/volume/drivers/netapp/dataontap/client/client_cmode.py b/cinder/volume/drivers/netapp/dataontap/client/client_cmode.py index 825f69bbd05..5829159b4bc 100644 --- a/cinder/volume/drivers/netapp/dataontap/client/client_cmode.py +++ b/cinder/volume/drivers/netapp/dataontap/client/client_cmode.py @@ -452,19 +452,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 diff --git a/releasenotes/notes/bug-1762424-f76af2f37fe408f1.yaml b/releasenotes/notes/bug-1762424-f76af2f37fe408f1.yaml new file mode 100644 index 00000000000..90c08f0ed35 --- /dev/null +++ b/releasenotes/notes/bug-1762424-f76af2f37fe408f1.yaml @@ -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.