[NetApp] Fix default thin_provisioned volumes on AFF

The NetApp ONTAP driver was creating thin provisioned volumes on
AFF systems even when the thin provisioned extra spec was saying
the contrary.

ONTAP AFF systems create thin provisioned volumes by default, which
differs from FAS systems, that creates thick provisioned volumes by
default.

The NetApp ONTAP driver was modified to fix this misbehavior.

Change-Id: I9218bf0d7cb607dd75e892ce86af958d43a7fcdb
Closes-Bug: #1929421
This commit is contained in:
Nahim Alves de Souza 2021-06-04 21:12:48 +00:00
parent 67664839b3
commit c1db551775
3 changed files with 33 additions and 4 deletions

View File

@ -2109,11 +2109,10 @@ class NetAppCmodeClient(client_base.NetAppBaseClient):
adaptive_qos_policy_group):
api_args = {
'volume-type': volume_type,
'space-reserve': ('none' if thin_provisioned else 'volume'),
}
if volume_type != 'dp':
api_args['junction-path'] = '/%s' % volume_name
if thin_provisioned:
api_args['space-reserve'] = 'none'
if snapshot_policy is not None:
api_args['snapshot-policy'] = snapshot_policy
if language is not None:

View File

@ -3119,6 +3119,28 @@ class NetAppClientCmodeTestCase(test.TestCase):
else:
self.client.set_volume_max_files.assert_not_called()
@ddt.data(True, False)
def test_create_volume_thin_provisioned(self, thin_provisioned):
self.mock_object(self.client, 'send_request')
self.mock_object(self.client, 'update_volume_efficiency_attributes')
self.client.create_volume(
fake.SHARE_AGGREGATE_NAME, fake.SHARE_NAME, 100,
thin_provisioned=thin_provisioned)
volume_create_args = {
'containing-aggr-name': fake.SHARE_AGGREGATE_NAME,
'size': '100g',
'volume': fake.SHARE_NAME,
'volume-type': 'rw',
'junction-path': '/%s' % fake.SHARE_NAME,
'space-reserve': ('none' if thin_provisioned else 'volume'),
}
self.client.send_request.assert_called_once_with('volume-create',
volume_create_args)
def test_create_volume_adaptive_not_supported(self):
self.client.features.add_feature('ADAPTIVE_QOS', supported=False)
@ -3183,7 +3205,7 @@ class NetAppClientCmodeTestCase(test.TestCase):
self.client.features.add_feature('FLEXVOL_ENCRYPTION')
volume_type = 'rw'
thin_provisioned = 'none'
thin_provisioned = False
snapshot_policy = 'default'
language = 'en-US'
reserve = 15
@ -3198,7 +3220,7 @@ class NetAppClientCmodeTestCase(test.TestCase):
expected_api_args = {
'volume-type': volume_type,
'junction-path': '/fake_share',
'space-reserve': thin_provisioned,
'space-reserve': 'volume',
'snapshot-policy': snapshot_policy,
'language-code': language,
'percentage-snapshot-reserve': str(reserve),
@ -3226,6 +3248,7 @@ class NetAppClientCmodeTestCase(test.TestCase):
expected_api_args = {
'volume-type': volume_type,
'space-reserve': 'volume',
}
self.assertEqual(expected_api_args, result_api_args)

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Fixed an issue with ONTAP AFF platforms while creating shares that forced
volumes to have efficient data saving even when the contrary was
specified. For more details, please refer to
`launchpad bug #1929421 <https://bugs.launchpad.net/manila/+bug/1929421>`_