nova-manage placement audit command always fails with --resource_provider option

Bug #1936278 reported by Takashi Kajinami
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Takashi Kajinami
Victoria
Fix Released
Undecided
Unassigned
Wallaby
Fix Released
Undecided
Unassigned

Bug Description

Description
===========
nova-mange placement audit command always fails if --resource_provider option is used because the target resource provider is not found
~~~
# 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 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 placement access log, the command is sending request with &uuid=<uuid> instead of ?uuid=<uuid>

~~~
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
~~~

Steps to reproduce
==================
- Look up existing resource provider uuid
 $ openstack resource provider list
- Run audit command with one of the ids specified
 $ nova-manage placement audit --resource_provider <rp id>

Expected result
===============
The command succeeds without error

Actual result
=============
The command fails with the following error

Resource provider with UUID <id> does not exist.

Environment
===========
This issue was initially found in the following downstream bug.
 https://bugzilla.redhat.com/show_bug.cgi?id=1982485

Logs & Configs
==============
N/A

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/nova/+/800855

Changed in nova:
status: New → In Progress
Changed in nova:
assignee: nobody → Takashi Kajinami (kajinamit)
description: updated
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/nova/+/802893

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.opendev.org/c/openstack/nova/+/800855
Committed: https://opendev.org/openstack/nova/commit/1d3373dcf0a05d4a2c5b51fc1b74d41ec1bb1175
Submitter: "Zuul (22348)"
Branch: master

commit 1d3373dcf0a05d4a2c5b51fc1b74d41ec1bb1175
Author: Takashi Kajinami <email address hidden>
Date: Thu Jul 15 11:25:15 2021 +0900

    Fix request path to query a resource provider by uuid

    To query a resource provider by uuid, request path should look like
     /resource_providers?uuid=<uuid>
    istead of
     /resource_providers&uuid=<uuid>

    This change fixes the wrong path so that "nova-manage placement audit"
    command can look up the target resource provider properly.

    Closes-Bug: #1936278
    Change-Id: I2ae7e9782316e3662e4e51e3f5ba0ef597bf281b

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/nova/+/803070

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/nova/+/803550

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/nova/+/805004

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/nova/+/803070
Committed: https://opendev.org/openstack/nova/commit/62a3fa4fff70a1d03998626406a71b7dc09da733
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 62a3fa4fff70a1d03998626406a71b7dc09da733
Author: Takashi Kajinami <email address hidden>
Date: Thu Jul 15 11:25:15 2021 +0900

    Fix request path to query a resource provider by uuid

    To query a resource provider by uuid, request path should look like
     /resource_providers?uuid=<uuid>
    istead of
     /resource_providers&uuid=<uuid>

    This change fixes the wrong path so that "nova-manage placement audit"
    command can look up the target resource provider properly.

    Closes-Bug: #1936278
    Change-Id: I2ae7e9782316e3662e4e51e3f5ba0ef597bf281b
    (cherry picked from commit 1d3373dcf0a05d4a2c5b51fc1b74d41ec1bb1175)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/nova/+/803550
Committed: https://opendev.org/openstack/nova/commit/7dbceeceef0ca3657c72341375afc639be0b5c02
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit 7dbceeceef0ca3657c72341375afc639be0b5c02
Author: Takashi Kajinami <email address hidden>
Date: Thu Jul 15 11:25:15 2021 +0900

    Fix request path to query a resource provider by uuid

    To query a resource provider by uuid, request path should look like
     /resource_providers?uuid=<uuid>
    istead of
     /resource_providers&uuid=<uuid>

    This change fixes the wrong path so that "nova-manage placement audit"
    command can look up the target resource provider properly.

    Closes-Bug: #1936278
    Change-Id: I2ae7e9782316e3662e4e51e3f5ba0ef597bf281b
    (cherry picked from commit 1d3373dcf0a05d4a2c5b51fc1b74d41ec1bb1175)
    (cherry picked from commit 62a3fa4fff70a1d03998626406a71b7dc09da733)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 24.0.0.0rc1

This issue was fixed in the openstack/nova 24.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 22.3.0

This issue was fixed in the openstack/nova 22.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 23.1.0

This issue was fixed in the openstack/nova 23.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/nova/+/805004
Committed: https://opendev.org/openstack/nova/commit/d0d7155457a0a92fdd28031665034c0033239a4b
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit d0d7155457a0a92fdd28031665034c0033239a4b
Author: Takashi Kajinami <email address hidden>
Date: Thu Jul 15 11:25:15 2021 +0900

    Fix request path to query a resource provider by uuid

    To query a resource provider by uuid, request path should look like
     /resource_providers?uuid=<uuid>
    istead of
     /resource_providers&uuid=<uuid>

    This change fixes the wrong path so that "nova-manage placement audit"
    command can look up the target resource provider properly.

    Closes-Bug: #1936278
    Change-Id: I2ae7e9782316e3662e4e51e3f5ba0ef597bf281b
    (cherry picked from commit 1d3373dcf0a05d4a2c5b51fc1b74d41ec1bb1175)
    (cherry picked from commit 62a3fa4fff70a1d03998626406a71b7dc09da733)
    (cherry picked from commit 7dbceeceef0ca3657c72341375afc639be0b5c02)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 21.2.4

This issue was fixed in the openstack/nova 21.2.4 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.opendev.org/c/openstack/nova/+/802893
Committed: https://opendev.org/openstack/nova/commit/4cf4af7ff4742cf67d2621560ba296e030d25676
Submitter: "Zuul (22348)"
Branch: master

commit 4cf4af7ff4742cf67d2621560ba296e030d25676
Author: Stephen Finucane <email address hidden>
Date: Thu Jul 29 14:53:51 2021 +0100

    tests: Add test for bug #1936278

    Ensure we're building the correct URL to talk to placement.

    Change-Id: I2152ee77ba522b3925a6777e7f32a9943b76aa49
    Related-Bug: #1936278
    Signed-off-by: Stephen Finucane <email address hidden>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.