diff --git a/cinder/tests/unit/volume/drivers/netapp/dataontap/fakes.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/fakes.py index adfa22ecacd..99132f650ce 100644 --- a/cinder/tests/unit/volume/drivers/netapp/dataontap/fakes.py +++ b/cinder/tests/unit/volume/drivers/netapp/dataontap/fakes.py @@ -378,7 +378,6 @@ FAKE_7MODE_POOLS = [ 'multiattach': False, 'thin_provisioning_support': False, 'thick_provisioning_support': True, - 'provisioned_capacity_gb': 0.0, 'utilization': 30.0, 'filter_function': 'filter', 'goodness_function': 'goodness', diff --git a/cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_7mode.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_7mode.py index 8ab96af69ae..7d940f949c2 100644 --- a/cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_7mode.py +++ b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_7mode.py @@ -578,7 +578,6 @@ class NetAppBlockStorage7modeLibraryTestCase(test.TestCase): 'QoS_support': False, 'thin_provisioning_support': not thick, 'thick_provisioning_support': thick, - 'provisioned_capacity_gb': 2.94, 'free_capacity_gb': 1339.27, 'total_capacity_gb': 1342.21, 'reserved_percentage': 5, diff --git a/cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_cmode.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_cmode.py index 4656fa345df..3f3087c6a78 100644 --- a/cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_cmode.py +++ b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_block_cmode.py @@ -412,7 +412,6 @@ class NetAppBlockStorageCmodeLibraryTestCase(test.TestCase): 'multiattach': False, 'total_capacity_gb': 10.0, 'free_capacity_gb': 2.0, - 'provisioned_capacity_gb': 8.0, 'netapp_dedupe_used_percent': 55.0, 'netapp_aggregate_used_percent': 45, 'utilization': 30.0, diff --git a/cinder/tests/unit/volume/drivers/netapp/dataontap/test_nfs_7mode.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_nfs_7mode.py index 44ca0877354..f73f2721cb4 100644 --- a/cinder/tests/unit/volume/drivers/netapp/dataontap/test_nfs_7mode.py +++ b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_nfs_7mode.py @@ -100,13 +100,11 @@ class NetApp7modeNfsDriverTestCase(test.TestCase): fake.TOTAL_BYTES // units.Gi, '0.01') free_capacity_gb = na_utils.round_down( fake.AVAILABLE_BYTES // units.Gi, '0.01') - provisioned_capacity_gb = total_capacity_gb - free_capacity_gb capacity = { 'reserved_percentage': fake.RESERVED_PERCENTAGE, 'max_over_subscription_ratio': fake.MAX_OVER_SUBSCRIPTION_RATIO, 'total_capacity_gb': total_capacity_gb, 'free_capacity_gb': free_capacity_gb, - 'provisioned_capacity_gb': provisioned_capacity_gb, } self.mock_object(self.driver, '_get_share_capacity_info', @@ -128,7 +126,6 @@ class NetApp7modeNfsDriverTestCase(test.TestCase): 'reserved_percentage': 7, 'max_over_subscription_ratio': 19.0, 'multiattach': False, - 'provisioned_capacity_gb': 4456.0, 'utilization': 30.0, 'filter_function': 'filter', 'goodness_function': 'goodness'}] diff --git a/cinder/tests/unit/volume/drivers/netapp/dataontap/test_nfs_cmode.py b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_nfs_cmode.py index 3778bd7be3c..e5e2f26c520 100644 --- a/cinder/tests/unit/volume/drivers/netapp/dataontap/test_nfs_cmode.py +++ b/cinder/tests/unit/volume/drivers/netapp/dataontap/test_nfs_cmode.py @@ -179,13 +179,11 @@ class NetAppCmodeNfsDriverTestCase(test.TestCase): fake.TOTAL_BYTES // units.Gi, '0.01') free_capacity_gb = na_utils.round_down( fake.AVAILABLE_BYTES // units.Gi, '0.01') - provisioned_capacity_gb = total_capacity_gb - free_capacity_gb capacity = { 'reserved_percentage': fake.RESERVED_PERCENTAGE, 'max_over_subscription_ratio': fake.MAX_OVER_SUBSCRIPTION_RATIO, 'total_capacity_gb': total_capacity_gb, 'free_capacity_gb': free_capacity_gb, - 'provisioned_capacity_gb': provisioned_capacity_gb, } self.mock_object(self.driver, '_get_share_capacity_info', @@ -219,7 +217,6 @@ class NetAppCmodeNfsDriverTestCase(test.TestCase): 'multiattach': False, 'total_capacity_gb': total_capacity_gb, 'free_capacity_gb': free_capacity_gb, - 'provisioned_capacity_gb': provisioned_capacity_gb, 'netapp_dedupe_used_percent': 55.0, 'netapp_aggregate_used_percent': 45, 'utilization': 30.0, diff --git a/cinder/volume/drivers/netapp/dataontap/block_7mode.py b/cinder/volume/drivers/netapp/dataontap/block_7mode.py index 7e97ee0221d..d8912271054 100644 --- a/cinder/volume/drivers/netapp/dataontap/block_7mode.py +++ b/cinder/volume/drivers/netapp/dataontap/block_7mode.py @@ -341,9 +341,6 @@ class NetAppBlockStorage7modeLibrary(block_base.NetAppBlockStorageLibrary): free /= units.Gi pool['free_capacity_gb'] = na_utils.round_down(free, '0.01') - pool['provisioned_capacity_gb'] = (round( - pool['total_capacity_gb'] - pool['free_capacity_gb'], 2)) - thick = ( self.configuration.netapp_lun_space_reservation == 'enabled') pool['thick_provisioning_support'] = thick diff --git a/cinder/volume/drivers/netapp/dataontap/block_cmode.py b/cinder/volume/drivers/netapp/dataontap/block_cmode.py index 09d6f3ff0f6..051bb3c4916 100644 --- a/cinder/volume/drivers/netapp/dataontap/block_cmode.py +++ b/cinder/volume/drivers/netapp/dataontap/block_cmode.py @@ -311,9 +311,6 @@ class NetAppBlockStorageCmodeLibrary(block_base.NetAppBlockStorageLibrary, size_available_gb = capacity['size-available'] / units.Gi pool['free_capacity_gb'] = na_utils.round_down(size_available_gb) - pool['provisioned_capacity_gb'] = round( - pool['total_capacity_gb'] - pool['free_capacity_gb'], 2) - if self.using_cluster_credentials: dedupe_used = self.zapi_client.get_flexvol_dedupe_used_percent( ssc_vol_name) diff --git a/cinder/volume/drivers/netapp/dataontap/nfs_base.py b/cinder/volume/drivers/netapp/dataontap/nfs_base.py index b17221c5126..a014e20c007 100644 --- a/cinder/volume/drivers/netapp/dataontap/nfs_base.py +++ b/cinder/volume/drivers/netapp/dataontap/nfs_base.py @@ -885,8 +885,6 @@ class NetAppNfsDriver(driver.ManageableVD, total_size / units.Gi) capacity['free_capacity_gb'] = na_utils.round_down( total_available / units.Gi) - capacity['provisioned_capacity_gb'] = (round( - capacity['total_capacity_gb'] - capacity['free_capacity_gb'], 2)) return capacity diff --git a/releasenotes/notes/bug-1714209-netapp-ontap-drivers-oversubscription-issue-c4655b9c4858d7c6.yaml b/releasenotes/notes/bug-1714209-netapp-ontap-drivers-oversubscription-issue-c4655b9c4858d7c6.yaml new file mode 100644 index 00000000000..9e8fc2ed7ff --- /dev/null +++ b/releasenotes/notes/bug-1714209-netapp-ontap-drivers-oversubscription-issue-c4655b9c4858d7c6.yaml @@ -0,0 +1,16 @@ +--- +fixes: + - The ONTAP drivers ("7mode" and "cmode") have been fixed to not report + consumed space as "provisioned_capacity_gb". They instead rely on + the cinder scheduler's calculation of "provisioned_capacity_gb". This + fixes the oversubscription miscalculations with the ONTAP drivers. This + bugfix affects all three protocols supported by these drivers + (iSCSI/FC/NFS). +upgrade: + - If using the NetApp ONTAP drivers (7mode/cmode), the configuration value + for "max_over_subscription_ratio" may need to be increased to + avoid scheduling problems where storage pools that previously were + valid to schedule new volumes suddenly appear to be out of space + to the Cinder scheduler. See + documentation `here `_.