Description
===========
When I created a thin provisioning volume whose capacity is 200GB in
the thin provisioning pool whose total capacity is 19GB, there were
some confusing logs such as "(requested / avail): 200/19.0" which
causes a misconception for that volume could be created successfully.
It's clear for us to see that the avail capactiy is small than the
requested size. The volume, however, could be created successfully.
Steps to reproduce
==================
1. Prepare a pool which supports thin provisioning.
2. Set debug to True in the configuration file.
3. Create a thin provisioning volume whose size is much bigger than
the pool size.
4. In the interim, Inspect logs of cinder-volume service.
Expected result
===============
I suppose that the pool size is 19G and the volume size is 200G and
max_over_subscription_ratio is 20. Then "(requested / avail): 200/380" should
be presented in the logs rather than the "(requested / avail): 200/19.0".
Environment
===========
victoria branch of cinder
Logs & Configs
==============
Mar 07 18:46:34 devcon cinder-scheduler[646]: DEBUG cinder.scheduler.filters.capacity_filter [None req-45784d8c-3a5e-4a4b-adca-0de40c15b7d4 admin None] Checking if host devcon@lvm-1#lvm-1 can create a 200 GB volume (6ca74c97-edf5-40d9-86ee-83decb2e25db) {{(pid=646) backend_passes /opt/stack/cinder/cinder/scheduler/filters/capacity_filter.py:62}}
Mar 07 18:46:34 devcon cinder-scheduler[646]: DEBUG cinder.scheduler.filters.capacity_filter [None req-45784d8c-3a5e-4a4b-adca-0de40c15b7d4 admin None] Checking provisioning for request of 200 GB. Backend: host 'devcon@lvm-1#lvm-1':free_capacity_gb: 19.0, total_capacity_gb: 19.0,allocated_capacity_gb: 0, max_over_subscription_ratio: 20.0,reserved_percentage: 0, provisioned_capacity_gb: 0.0,thin_provisioning_support: True, thick_provisioning_support: False,pools: None,updated at: 2021-03-08 02:46:19.345748 {{(pid=646) backend_passes /opt/stack/cinder/cinder/scheduler/filters/capacity_filter.py:134}}
Mar 07 18:46:34 devcon cinder-scheduler[646]: DEBUG cinder.scheduler.filters.capacity_filter [None req-45784d8c-3a5e-4a4b-adca-0de40c15b7d4 admin None] Space information for volume creation on host devcon@lvm-1#lvm-1 (requested / avail): 200/19.0 {{(pid=646) backend_passes /opt/stack/cinder/cinder/scheduler/filters/capacity_filter.py:172}}
Mar 07 18:46:34 devcon cinder-scheduler[646]: DEBUG cinder.scheduler.filters.capacity_filter [None req-45784d8c-3a5e-4a4b-adca-0de40c15b7d4 admin None] Checking if host devcon@ceph#ceph-1 can create a 200 GB volume (6ca74c97-edf5-40d9-86ee-83decb2e25db) {{(pid=646) backend_passes /opt/stack/cinder/cinder/scheduler/filters/capacity_filter.py:62}}
Mar 07 18:46:34 devcon cinder-scheduler[646]: DEBUG cinder.scheduler.filters.capacity_filter [None req-45784d8c-3a5e-4a4b-adca-0de40c15b7d4 admin None] Checking provisioning for request of 200 GB. Backend: host 'devcon@ceph#ceph-1':free_capacity_gb: 27.49, total_capacity_gb: 27.49,allocated_capacity_gb: 0, max_over_subscription_ratio: 20.0,reserved_percentage: 0, provisioned_capacity_gb: 0,thin_provisioning_support: True, thick_provisioning_support: False,pools: None,updated at: 2021-03-08 02:46:22.020151 {{(pid=646) backend_passes /opt/stack/cinder/cinder/scheduler/filters/capacity_filter.py:134}}
Mar 07 18:46:34 devcon cinder-scheduler[646]: DEBUG cinder.scheduler.filters.capacity_filter [None req-45784d8c-3a5e-4a4b-adca-0de40c15b7d4 admin None] Space information for volume creation on host devcon@ceph#ceph-1 (requested / avail): 200/27.49 {{(pid=646) backend_passes /opt/stack/cinder/cinder/scheduler/filters/capacity_filter.py:172}}
Mar 07 18:46:34 devcon cinder-scheduler[646]: DEBUG cinder.scheduler.base_filter [None req-45784d8c-3a5e-4a4b-adca-0de40c15b7d4 admin None] Filter CapacityFilter returned 2 host(s) {{(pid=646) get_filtered_objects /opt/stack/cinder/cinder/scheduler/base_filter.py:125}}
Fix proposed to branch: master /review. opendev. org/c/openstack /cinder/ +/790014
Review: https:/