NetApp ONTAP driver does not include snapshot-<uuid> files for capacity calculations of provisioned_capacity_gb

Bug #2021746 reported by Michael Arndt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
New
Medium
Felipe Rodrigues

Bug Description

The cinder scheduler increments provisionied_capacity_gb whenever snapshot is provisioned but the netapp driver does not include snapshot-<uuid> files for capacity calculations of provisioned_capacity_gb in the patch at https://review.opendev.org/c/openstack/cinder/+/798198. Because of this, snapshot creation sometimes fails with insufficient space error and if we retry after few mins, it works fine. If the cinder scheduler is including snapshot capacity in it's space calculations, the NetApp ONTAP driver should as well.

Tags: drivers netapp
Changed in cinder:
importance: Undecided → Medium
tags: added: drivers netapp
Changed in cinder:
assignee: nobody → Felipe Rodrigues (felipefutty)
Revision history for this message
Michael Arndt (arndt-ntap) wrote :

Proposed diff of the simple changes to make this calculation consistent:

modules/controller/files/cinder/volume/drivers/netapp/dataontap/nfs_cmode.py
diff --git a/modules/controller/files/cinder/volume/drivers/netapp/dataontap/nfs_cmode.py b/modules/controller/files/cinder/volume/drivers/netapp/dataontap/nfs_cmode.py
index fc40f3a..edef16e 100644
--- a/modules/controller/files/cinder/volume/drivers/netapp/dataontap/nfs_cmode.py
+++ b/modules/controller/files/cinder/volume/drivers/netapp/dataontap/nfs_cmode.py
@@ -290,7 +290,8 @@ class NetAppCmodeNfsDriver(nfs_base.NetAppNfsDriver,
                 files = self.zapi_client.get_file_sizes_by_dir(ssc_vol_name)
                 provisioned_cap = 0
                 for f in files:
- if volume_utils.extract_id_from_volume_name(f['name']):
+ if volume_utils.extract_id_from_volume_name(f['name']) or \
+ volume_utils.extract_id_from_snapshot_name(f['name']):
                         provisioned_cap = provisioned_cap + f['file-size']
                 pool['provisioned_capacity_gb'] = na_utils.round_down(
                     float(provisioned_cap) / units.Gi)

Revision history for this message
Saikumar Pulluri (pulluri) wrote :

@michael,

Thank you so much for getting into this topic, and it's one of the grey areas always.

Current implementation:
provisioned_capacity_gb will not include snapshot capacity space and this is as per the design and also the documentaion states the same.
Doc-link: https://specs.openstack.org/openstack/cinder-specs/specs/queens/provisioning-improvements.html

In case, we want to include snapshot capacity space in provisioned_capacity_gb, it will lead to the side effects of volume/snapshot provisioning will fail easily when the pool reaches max provisioned_capacity_gb.
INFO: Max provisioned_capacity_gb for a pool is calcualted by the formula of max_over_subscription_ratio*total_capacity_gb

Example: Say, for a pool, we have a total_capacity_gb as 25GB and max_over_subscription_ratio is 20. This config will make sure, user can reach a max of provisioned_capacity_gb as 500 GB.
In this scenario, if user creates a workload volume, say volume1 with 100 GB, the pool will have allocated_capacity_gb = 100 GB, provisioned_capacity_gb = 100 GB.
Later, if user creates 4 snapshots for volume1, the pool's allocated_capacity_gb = 100 GB and provisioned_capacity_gb = 500 GB.
Now, if user tries to create a volume of even 1GB, it will fail because pool has already reached the maximum of provisioned_capacity_gb.

I feel that, we should not include snapshot capacity into provisioned_capacity_gb due to the above. If you think it in other ways, pls revert back. We can have a call to discuss it further.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.