Allocation candidates do not interpret provider trees in Devstack

Bug #2025474 reported by Dominik Danelski
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
New
Undecided
Unassigned

Bug Description

Steps to reproduce
==================
* I installed clean Devstack with 3 fake-virt resource providers.
* I confirmed that it is possible to allocate a single CPU by command $ openstack allocation candidate list --os-placement-api-version=1.17 --resource VCPU=1
* I created one child resource provider (under a fake-virt one listed above)
* I set the new resource provider to provide 'VGPU'
* I confirmed that it is possible to allocate a single GPU by command $ openstack allocation candidate list --os-placement-api-version=1.17 --resource VGPU=1
* I checked whether it's possible to allocate both CPU and GPU by command $ openstack allocation candidate list --os-placement-api-version=1.17 --resource VCPU=1 --resource VGPU=1 and the returned list was empty

Expected result
===============
One allocation candidate should be presented to me.

Actual result
=============
No allocation candidates were returned.

Environment
===========
I performed the test for Devstack Ussuri as well as the master branch downloaded on 29.06.2023.
Master: Ubuntu 22.04.2, commit 27568ea33460b9ea4635a7d0a0bb06d32654150b
Ussuri: Ubuntu 18.04.6, commit b11a403c37f9873cdaaa6afc31619ab72b0fd8c2

Logs & Configs
==============
Full list of commands and their results (for Ussuri):
eouser@test-resource-providers:~$ openstack allocation candidate list --os-placement-api-version=1.17 --resource VCPU=1
+---+------------+--------------------------------------+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| # | allocation | resource provider | inventory used/capacity | traits |
+---+------------+--------------------------------------+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 1 | VCPU=1 | 0f2df6c9-802c-4752-80f8-cdff31676eeb | VCPU=0/16000 | COMPUTE_VOLUME_EXTEND,COMPUTE_DEVICE_TAGGING,COMPUTE_ACCELERATORS,COMPUTE_NET_ATTACH_INTERFACE_WITH_TAG,COMPUTE_NODE,COMPUTE_IMAGE_TYPE_RAW,COMPUTE_VOLUME_ATTACH_WITH_TAG,COMPUTE_NET_ATTACH_INTERFACE,COMPUTE_VOLUME_MULTI_ATTACH,COMPUTE_TRUSTED_CERTS |
| 2 | VCPU=1 | 9475b42a-a7ad-4849-8c6f-133e3ead12c6 | VCPU=0/16000 | COMPUTE_VOLUME_EXTEND,COMPUTE_DEVICE_TAGGING,COMPUTE_ACCELERATORS,COMPUTE_NET_ATTACH_INTERFACE_WITH_TAG,COMPUTE_NODE,COMPUTE_IMAGE_TYPE_RAW,COMPUTE_VOLUME_ATTACH_WITH_TAG,COMPUTE_NET_ATTACH_INTERFACE,COMPUTE_VOLUME_MULTI_ATTACH,COMPUTE_TRUSTED_CERTS |
| 3 | VCPU=1 | 176f3fee-25e2-4201-8320-1433467dfde6 | VCPU=0/16000 | COMPUTE_VOLUME_EXTEND,COMPUTE_DEVICE_TAGGING,COMPUTE_ACCELERATORS,COMPUTE_NET_ATTACH_INTERFACE_WITH_TAG,COMPUTE_NODE,COMPUTE_IMAGE_TYPE_RAW,COMPUTE_VOLUME_ATTACH_WITH_TAG,COMPUTE_NET_ATTACH_INTERFACE,COMPUTE_VOLUME_MULTI_ATTACH,COMPUTE_TRUSTED_CERTS |
+---+------------+--------------------------------------+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

eouser@test-resource-providers:~$ openstack resource provider create --os-placement-api-version=1.17 --parent-provider 0f2df6c9-802c-4752-80f8-cdff31676eeb VGPUtest
+----------------------+--------------------------------------+
| Field | Value |
+----------------------+--------------------------------------+
| uuid | 3ec43c70-8342-41e7-b4e8-491ba4067829 |
| name | VGPUtest |
| generation | 0 |
| root_provider_uuid | 0f2df6c9-802c-4752-80f8-cdff31676eeb |
| parent_provider_uuid | 0f2df6c9-802c-4752-80f8-cdff31676eeb |
+----------------------+--------------------------------------+

eouser@test-resource-providers:~$ openstack resource provider list
+--------------------------------------+--------------------------+------------+
| uuid | name | generation |
+--------------------------------------+--------------------------+------------+
| 176f3fee-25e2-4201-8320-1433467dfde6 | test-resource-providers1 | 2 |
| 0f2df6c9-802c-4752-80f8-cdff31676eeb | test-resource-providers2 | 2 |
| 9475b42a-a7ad-4849-8c6f-133e3ead12c6 | test-resource-providers3 | 2 |
| 3ec43c70-8342-41e7-b4e8-491ba4067829 | VGPUtest | 0 |
+--------------------------------------+--------------------------+------------+

eouser@test-resource-providers:~$ openstack resource provider inventory set --os-placement-api-version=1.17 --resource VGPU=1 3ec43c70-8342-41e7-b4e8-491ba4067829
+----------------+------------------+----------+------------+----------+-----------+-------+
| resource_class | allocation_ratio | min_unit | max_unit | reserved | step_size | total |
+----------------+------------------+----------+------------+----------+-----------+-------+
| VGPU | 1.0 | 1 | 2147483647 | 0 | 1 | 1 |
+----------------+------------------+----------+------------+----------+-----------+-------+

eouser@test-resource-providers:~$ openstack allocation candidate list --os-placement-api-version=1.17 --resource VGPU=1
+---+------------+--------------------------------------+-------------------------+--------+
| # | allocation | resource provider | inventory used/capacity | traits |
+---+------------+--------------------------------------+-------------------------+--------+
| 1 | VGPU=1 | 3ec43c70-8342-41e7-b4e8-491ba4067829 | VGPU=0/1 | |
+---+------------+--------------------------------------+-------------------------+--------+

eouser@test-resource-providers:~$ openstack allocation candidate list --os-placement-api-version=1.17 --resource VCPU=1 --resource VGPU=1

Tags: placement
Revision history for this message
Dominik Danelski (dominikdanelski) wrote :
Revision history for this message
Dominik Danelski (dominikdanelski) wrote :

I found the possible cause of the bug.
Previously, I used Devstack Ussuri, but I noticed that the error doesn't manifest itself on Devstack Yoga. Then, I manually made calls to Placement's API on Devstack Yoga with different API versions specified in header. The query results for the same call were empty for version 1.25, but non-empty for 1.29, which is odd, since docs do not mention any changes for calls to /placement_candidates between these 2 versions.

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.