Merge "[NetApp] Fix default thin_provisioned volumes on AFF"

This commit is contained in:
Zuul 2021-12-08 22:11:17 +00:00 committed by Gerrit Code Review
commit 00332b3d19
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>`_