Smbfs driver incorrect values for _get_capacity_info

Bug #1746238 reported by Tiago Pasqualini da Silva
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
New
Undecided
Unassigned

Bug Description

_get_capacity_info should return the capacity, the free space left on the storage, and the used space. Smbfs driver reports the allocated capacity for the used space, which is wrong. As a result, the driver is incorrectly reporting the provisioned_capacity.

description: updated
Revision history for this message
Lucian Petrut (petrutlucian94) wrote :

Thanks for submitting this bug report.

Please correct me if I got this wrong, but the idea is that the driver should not update the allocated size, leaving this up to the manager, right?

IMO, this can easily be fixed at the remotefs driver level, covering all the *concrete* drivers that inherit it. I guess that we should only report the provisioned space (physically used space, smaller than allocated space when thin provisioning is used), which should be the difference between total space and free space. By doing this, I think we don't actually need any changes in the drivers inheriting it.

I'm sending a patch, please let me know what you think.

Revision history for this message
Lucian Petrut (petrutlucian94) wrote :

This has always confused me, I'll be honest. Cinder considers the provisioned backend capacity to be the total allocated volume size on a backend (including non-Cinder volumes), as underlined by https://github.com/openstack/cinder/blob/12.0.0.0b3/cinder/scheduler/host_manager.py#L121-L124

So, let's take an example:

We have a 10 GB share and 2 thinly provisioned volumes, one 2GB empty created by cinder, another 2GB non-cinder volume that has 1GB of physically used space.

What the SMBFS driver will report:
* total_capacity: 10 GB
* free_capacity: 9 GB
* allocated_capacity: 1 GB (we currently report the physically used capacity), the manager would report 2 GB (the total Cinder volume size), so we may be wrong and need to drop this field
* provisioned_capacity: 2 GB (we can only account the volumes created by Cinder, we cannot query in-use images that have not been created by Cinder). We usually recommend customers to avoid using the shares for other purposes, but we may slightly improve the formula to take into account other files residing on the share)

What the NFS driver will report (using sparse files):
* total_capacity: 10 GB
* free_capacity: 9 GB
* allocated_capacity: 1 GB
* provisioned_capacity: 4 GB

What the NFS driver will report (using qcow2 files):
* total_capacity: 10 GB
* free_capacity: 9 GB
* allocated_capacity: 1 GB
* provisioned_capacity: 1 GB (it doesn't know how much data has been actually allocated to the qcow2 files since it's using "du -sb --aparent-size")

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.