Bug 1982485

Summary: [OSP16.2] nova-manage placement audit can't look up the target resource provider if --resource_provider is specified
Product: Red Hat OpenStack Reporter: Takashi Kajinami <tkajinam>
Component: openstack-novaAssignee: Takashi Kajinami <tkajinam>
Status: CLOSED ERRATA QA Contact: OSP DFG:Compute <osp-dfg-compute>
Severity: medium Docs Contact:
Priority: medium    
Version: 16.1 (Train)CC: alifshit, dasmith, eglynn, jhakimra, kchamart, mwitt, sbauza, sgordon, smooney, vromanso
Target Milestone: z3Keywords: Patch, Triaged
Target Release: 16.2 (Train on RHEL 8.4)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-nova-20.6.2-2.20220406160113.a5da31e.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2068379 (view as bug list) Environment:
Last Closed: 2022-06-22 16:02:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2068379    

Description Takashi Kajinami 2021-07-15 02:17:34 UTC
Description of problem:

Currently nova-manage placement audit command always fails with the following error
 Resource provider with UUID <id> does not exist.

(example)
~~~
[heat-admin@controller-0 ~]$ sudo podman exec -it nova_api nova-manage placement audit --resource_provider dbba1bf7-6e97-4dcb-8d4c-37fe36633358 --verbose
Resource provider with UUID dbba1bf7-6e97-4dcb-8d4c-37fe36633358 does not exist.
Error: non zero exit code: 127: OCI runtime error
~~~

However the target resource provider record actually exists in placement.

~~~
(overcloud) [stack@undercloud-0 ~]$ openstack resource provider list --uuid dbba1bf7-6e97-4dcb-8d4c-37fe36633358 --os-placement-api-version 1.14
+--------------------------------------+------------------------+------------+--------------------------------------+----------------------+
| uuid                                 | name                   | generation | root_provider_uuid                   | parent_provider_uuid |
+--------------------------------------+------------------------+------------+--------------------------------------+----------------------+
| dbba1bf7-6e97-4dcb-8d4c-37fe36633358 | compute-0.redhat.local |         28 | dbba1bf7-6e97-4dcb-8d4c-37fe36633358 | None                 |
+--------------------------------------+------------------------+------------+--------------------------------------+----------------------+
~~~

Looking at access log in placement service, I noticed that the command
is sending a request to /placment/resource_provider&uuid=<id> .

~~~
2021-07-15 02:02:28.101 24 INFO placement.requestlog [req-a9d4942e-411a-4901-b05e-98ec1239ef70 31e1d736a759444f92346daf932243ff 91063c94413548b695edc6a0ef1f1252 - default default] 172.17.1.24 "GET /placement/resource_providers&uuid=dbba1bf7-6e97-4dcb-8d4c-37fe36633358" status: 404 len: 162 microversion: 1.14
~~~

However it should send request to /placment/resource_provider?uuid=<id> instead
~~~
2021-07-15 02:08:32.203 24 INFO placement.requestlog [req-03a20fff-644d-4cbf-abba-12656c2d9299 06b547a0af8f49fd8239c85ce5d9571b 942783ae248c4e9eb353a6e6b327bda5 - default default] 172.17.1.24 "GET /placement/resource_providers?uuid=dbba1bf7-6e97-4dcb-8d4c-37fe36633358" status: 200 len: 872 microversion: 1.14
~~~


Version-Release number of selected component (if applicable):
The issue can be reproduced in 16.1.6 .

How reproducible:
Always

Steps to Reproduce:
1. run "nova-manage placement audit" with --resource_provider option

Actual results:
The command always fails with "Resource provider with UUID <uuid> does not exist."

Expected results:
The command completes without error

Additional info:

Comment 3 smooney 2022-03-24 16:00:44 UTC
im removing the triaged keyword this is not traiged properly this was created to track fixing the upstream but but we need 4 BZs 18.0 17.0 16.2 and 16.1 if this need to be fix all the way to 16.1

this likely should be kept for the 18 bz and then we should clone it for the rest.

Comment 17 errata-xmlrpc 2022-06-22 16:02:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Release of components for Red Hat OpenStack Platform 16.2.3 (Train)), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:4793