Fail to get pools by volume_type filter key

Bug #1993282 reported by zhaoleilc
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Triaged
Low
zhaoleilc

Bug Description

Description
===========
Fail to get pools by volume_type filter key, because
requested_size passed to capacity_filter is None type
in the interim.

Steps to reproduce
==================
1. create volume type whose name is lvm-type which
corresponds to lvm backend.
2. execute command as follows:
cinder get-pools --filters volume_type='lvm-type'

Expected result
===============
Retrive pool information in accordance with specified volume_type.

Actual result
=============
root@devcon:~# openstack volume type list --long
+--------------------------------------+-----------+-----------+-------------+------------------------------+
| ID | Name | Is Public | Description | Properties |
+--------------------------------------+-----------+-----------+-------------+------------------------------+
| b057e6b5-928b-49e2-9f1b-654b485c5d38 | ceph-type | True | None | volume_backend_name='ceph-1' |
| 1144ed43-ab59-4d4a-8bc2-9588f560efa7 | lvm-type | True | None | volume_backend_name='lvm-1' |
+--------------------------------------+-----------+-----------+-------------+------------------------------+
root@devcon:~# cinder get-pools --filters volume_type='lvm-type'
ERROR: The server could not comply with the request since it is either malformed or otherwise incorrect. (HTTP 400) (Request-ID: req-c7fdf809-5f30-45ad-a4d7-df5f4e625b7d)

Environment
===========
Victoria branch Of Openstack

Logs & Configs
==============
Oct 18 02:42:56 devcon cinder-scheduler[637]: DEBUG cinder.scheduler.base_filter [None req-63f2ef61-553d-4984-80af-893723aedd8c admin None] Starting with 2 host(s) {{(pid=637) get_filtered_objects /opt/stack/cinder/cinder/scheduler/base_filter.py:95}}
Oct 18 02:42:56 devcon cinder-scheduler[637]: DEBUG cinder.scheduler.base_filter [None req-63f2ef61-553d-4984-80af-893723aedd8c admin None] Filter AvailabilityZoneFilter returned 2 host(s) {{(pid=637) get_filtered_objects /opt/stack/cinder/cinder/scheduler/base_filter.py:125}}
Oct 18 02:42:56 devcon cinder-scheduler[637]: DEBUG cinder.scheduler.filters.capacity_filter [None req-63f2ef61-553d-4984-80af-893723aedd8c admin None] Checking if host devcon@lvm-1#lvm-1 can create a None GB volume (None) {{(pid=637) backend_passes /opt/stack/cinder/cinder/scheduler/filters/capacity_filter.py:62}}
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server [None req-63f2ef61-553d-4984-80af-893723aedd8c admin None] Exception during message handling: TypeError: unsupported operand type(s) for +: 'float' and 'NoneType'
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server Traceback (most recent call last):
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_messaging/rpc/dispatcher.py", line 309, in dispatch
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_messaging/rpc/dispatcher.py", line 229, in _do_dispatch
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/scheduler/manager.py", line 432, in get_pools
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server return self.driver.get_pools(context, filters)
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/scheduler/filter_scheduler.py", line 191, in get_pools
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server return self.host_manager.get_pools(context, filters)
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/scheduler/host_manager.py", line 777, in get_pools
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server all_pools))
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/scheduler/host_manager.py", line 730, in _filter_pools_by_volume_type
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server filter_properties)
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/scheduler/host_manager.py", line 506, in get_filtered_backends
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server filter_properties)
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/scheduler/base_filter.py", line 116, in get_filtered_objects
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server list_objs = list(objs)
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/scheduler/base_filter.py", line 43, in filter_all
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server if self._filter_one(obj, filter_properties):
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/scheduler/filters/__init__.py", line 29, in _filter_one
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server return passes_method(obj, filter_properties)
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/scheduler/filters/capacity_filter.py", line 132, in backend_passes
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server requested_size) / total)
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server TypeError: unsupported operand type(s) for +: 'float' and 'NoneType'
Oct 18 02:42:56 devcon cinder-scheduler[637]: ERROR oslo_messaging.rpc.server

Revision history for this message
zhaoleilc (zhaoleilc) wrote :

I am supposed to execute command with microversion:
root@devcon:~# cinder --os-volume-api-version 3.33 get-pools --filters volume_type='ceph-type'
+----------+------------------+
| Property | Value |
+----------+------------------+
| name | test@ceph#ceph-1 |
+----------+------------------+

Changed in cinder:
status: New → Invalid
assignee: nobody → zhaoleilc (zhaoleilc)
zhaoleilc (zhaoleilc)
Changed in cinder:
status: Invalid → New
Revision history for this message
zhaoleilc (zhaoleilc) wrote (last edit ):

However, all backends will be returned by the volume_type filter, e.g.
root@devcon:~# openstack volume type list --long
+--------------------------------------+-----------+-----------+-------------+------------------------------+
| ID | Name | Is Public | Description | Properties |
+--------------------------------------+-----------+-----------+-------------+------------------------------+
| b057e6b5-928b-49e2-9f1b-654b485c5d38 | ceph-type | True | None | volume_backend_name='ceph-1' |
| 1144ed43-ab59-4d4a-8bc2-9588f560efa7 | lvm-type | True | None | volume_backend_name='lvm-1' |
+--------------------------------------+-----------+-----------+-------------+------------------------------+
root@devcon:~# cinder --os-volume-api-version 3.33 get-pools --filters volume_type=ceph-type
+----------+------------------+
| Property | Value |
+----------+------------------+
| name | test@ceph#ceph-1 |
+----------+------------------+
+----------+--------------------+
| Property | Value |
+----------+--------------------+
| name | devcon@lvm-1#lvm-1 |

The name filter appears to be valid, e.g.
root@devcon:~# openstack volume service list
+------------------+--------------+------+---------+-------+----------------------------+
| Binary | Host | Zone | Status | State | Updated At |
+------------------+--------------+------+---------+-------+----------------------------+
| cinder-scheduler | devcon | nova | enabled | up | 2022-10-22T09:03:47.000000 |
| cinder-volume | devcon@lvm-1 | nova | enabled | up | 2022-10-22T09:03:46.000000 |
| cinder-volume | devcon@ceph | nova | enabled | up | 2022-10-22T09:03:49.000000 |
+------------------+--------------+------+---------+-------+----------------------------+
root@devcon:~# cinder get-pools
+----------+------------------+
| Property | Value |
+----------+------------------+
| name | test@ceph#ceph-1 |
+----------+------------------+
+----------+--------------------+
| Property | Value |
+----------+--------------------+
| name | devcon@lvm-1#lvm-1 |
+----------+--------------------+
root@devcon:~# cinder get-pools --filters name=devcon@lvm-1#lvm-1
+----------+--------------------+
| Property | Value |
+----------+--------------------+
| name | devcon@lvm-1#lvm-1 |
+----------+--------------------+
root@devcon:~#

Revision history for this message
Sofia Enriquez (lsofia-enriquez) wrote :

I've reproduced this bug on master.

Changed in cinder:
status: New → Triaged
importance: Undecided → Low
tags: added: filter
tags: added: filters
removed: filter
tags: added: api
tags: added: low-hanging-fruit
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.