total_capacity_gb, free_capacity_gb reported by the CephFS driver is incorrect
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Shared File Systems Service (Manila) |
Fix Released
|
High
|
Tom Barron |
Bug Description
Description
===========
The CephFS driver reads cluster statistics and reports "total_capacity_gb" and "free_capacity_gb" to the manila scheduler. The information it reads is in kilobytes, and it is supposed to convert this into gibibytes - however, the formula it uses to convert the information is incorrect.
Steps to reproduce
==================
A chronological list of steps which will help reproduce the issue you hit:
* Setup Manila with the CephFS driver, protocol doesn't matter, you could use devstack [1]
* Check Manila pools list for capacity information:
For example:
$ manila pool-list --detail | grep capacity
| total_capacity_gb | 181354994073600 |
| free_capacity_gb | 164756019216384 |
* Check capacity on the Ceph cluster
$ ceph -s
cluster:
id: 2ce57bd8-
health: HEALTH_WARN
too few PGs per OSD (8 < min 30)
services:
mon: 3 daemons, quorum controller-
mgr: controller-
mds: cephfs:1 {0=controller-
osd: 15 osds: 15 up (since 3w), 15 in (since 3w)
task status:
scrub status:
data:
pools: 5 pools, 128 pgs
objects: 26 objects, 3.1 KiB
usage: 15 GiB used, 150 GiB / 165 GiB avail
pgs: 128 active+clean
Expected result
===============
You expect the CephFS driver to report the total capacity as 165 GiB, and the free capacity as 150 GiB;
Actual result
=============
Manila's information is way off
Environment
===========
1. Exact version of OpenStack Manila you are running: main branch, but bug is reproducible all the way back to the initial driver submission in Newton
2. Which storage backend did you use?
Ceph, ceph version 14.2.8-59.el8cp (53387608e81e6a
3. Which networking type did you use?
N/A
Triage/RCA
==========
The driver's query [2] can be executed manually like this:
>>> import rados
>>> from oslo_utils import units
>>> rados = rados.Rados(
>>> rados.connect()
>>> rados.get_
{'kb': 172953600, 'kb_used': 15830016, 'kb_avail': 157123584, 'num_objects': 26
The driver's current conversion is:
total_capacity_gb = stats['kb'] * units.Mi
free_capacity_gb = stats['kb_avail'] * units.Mi
What it really needs to do is:
>>> round(rados.
164.94
>>> round(rados.
149.84
[1] https:/
[2] https:/
Changed in manila: | |
importance: | Undecided → High |
assignee: | nobody → Goutham Pacha Ravi (gouthamr) |
milestone: | none → victoria-3 |
Changed in manila: | |
assignee: | Goutham Pacha Ravi (gouthamr) → Tom Barron (tpb) |
Changed in manila: | |
milestone: | victoria-3 → victoria-rc1 |
Fix proposed to branch: master /review. opendev. org/745402
Review: https:/