Skip to content

Recurse provider trees to expose PCI devices and VGPUS #30

@jovial

Description

@jovial

PCI resources aren't tracked in openstack_hypervisor_placement_allocated metrics when pci.report_in_placement is enabled. We need to track children too:

openstack resource provider inventory list  bc33b3b8-f231-4feb-8479-cb723165ed6e
+----------------------+------------------+----------+----------+----------+-----------+-------+------+
| resource_class       | allocation_ratio | min_unit | max_unit | reserved | step_size | total | used |
+----------------------+------------------+----------+----------+----------+-----------+-------+------+
| CUSTOM_PCI_10DE_20B0 |              1.0 |        1 |        1 |        0 |         1 |     1 |    0 |
+----------------------+------------------+----------+----------+----------+-----------+-------+------+

There is a parent child relationship:

openstack resource provider list | grep  767c5d79-5e4a-48e0-89c3-1829aaa23d56
| 767c5d79-5e4a-48e0-89c3-1829aaa23d56 | gpu06              |       1687 | 767c5d79-5e4a-48e0-89c3-1829aaa23d56 | None                                 |
| 69494ace-31e5-4305-9784-4b1c9426fc72 | gpu06_0000:2F:00.0 |          4 | 767c5d79-5e4a-48e0-89c3-1829aaa23d56 | 767c5d79-5e4a-48e0-89c3-1829aaa23d56 |
| 706022a7-17c5-4575-a496-1139cbc29f81 | gpu06_0000:30:00.0 |          4 | 767c5d79-5e4a-48e0-89c3-1829aaa23d56 | 767c5d79-5e4a-48e0-89c3-1829aaa23d56 |
| bc33b3b8-f231-4feb-8479-cb723165ed6e | gpu06_0000:AF:00.0 |          4 | 767c5d79-5e4a-48e0-89c3-1829aaa23d56 | 767c5d79-5e4a-48e0-89c3-1829aaa23d56 |
| db5cf944-abc5-4aec-b421-f5048ae0b3d4 | gpu06_0000:B0:00.0 |          4 | 767c5d79-5e4a-48e0-89c3-1829aaa23d56 | 767c5d79-5e4a-48e0-89c3-1829aaa23d56 |

Similar thing for VGPUs.

Expected metrics:

openstack_hypervisor_placement_allocated{hypervisor="ctrl1",resource="CUSTOM_PCI_10DE_20B0"} 4

Actual behavior:

No child resources exposed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions