Resource MEMORY_MB Unable to retrieve providers information

Bug #2055784 reported by Victor Serbu
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
New
Undecided
Andres Quintero

Bug Description

Hello
When I click on admin -> compute -> hypervisor I get error and nothing is displayed in resource providers summary.
This
This happens because i have an environment in which i have activate pci passthrough in nova and there are tracked in placement: https://docs.openstack.org/nova/2023.1/admin/pci-passthrough.html#pci-tracking-in-placement

and this inventory doesn't have MEMORY_MB or DISK_GB (i looked at https://opendev.org/openstack/horizon/src/branch/master/openstack_dashboard/api/placement.py#L117-L127)

eg
one compute node where i have activated pci passthrough
```
(openstack) [osc@ansible-3 ~]$ openstack resource provider show 1fe9d32f-43cd-445a-8a49-a68f9ff5158f
+----------------------+--------------------------------------+
| Field | Value |
+----------------------+--------------------------------------+
| uuid | 1fe9d32f-43cd-445a-8a49-a68f9ff5158f |
| name | compute-19_0000:04:00.0 |
| generation | 44 |
| root_provider_uuid | e9cb6a8d-e638-4245-bf79-981211c5a232 |
| parent_provider_uuid | e9cb6a8d-e638-4245-bf79-981211c5a232 |
+----------------------+--------------------------------------+
(openstack) [osc@ansible-3 ~]$ openstack resource provider usage show 1fe9d32f-43cd-445a-8a49-a68f9ff5158f
+----------------------+-------+
| resource_class | usage |
+----------------------+-------+
| CUSTOM_PCI_10DE_2330 | 1 |
+----------------------+-------+
```

One simple compute node show as
```
(openstack) [osc@ansible-3 ~]$ openstack resource provider usage show f7af998e-1563-4a55-9145-4ee5f527d12b
+----------------+--------+
| resource_class | usage |
+----------------+--------+
| VCPU | 412 |
| MEMORY_MB | 824320 |
| DISK_GB | 0 |
+----------------+--------+

```

Changed in horizon:
assignee: nobody → Andres Quintero (aquintero93)
Revision history for this message
Andrew Bonney (andrewbonney) wrote :

We're seeing the same issue.

Revision history for this message
Sam Schmitt (samcat116) wrote :

I see the same thing with Ironic baremetal nodes tracked in placement.

Revision history for this message
Josué González Ruiz (josuegonzale) wrote :

We are currently experiencing the same problem

Revision history for this message
Aldin Setiawan (just-humanz403) wrote :

same issues

Revision history for this message
Aldin Setiawan (just-humanz403) wrote :

i just try to patch it (or at least ignore the error)

```
nano +117 ./var/lib/kolla/venv/lib/python3.10/site-packages/openstack_dashboard/api/placement.py
```

and then add&replace this code on line 117 until 121
```
        if 'MEMORY_MB' in usages.keys():
            p['memory_mb_used'] = usages['MEMORY_MB']
            p['memory_mb_reserved'] = inventories['MEMORY_MB']['reserved']
            p['memory_mb'] = inventories['MEMORY_MB']['total']
            p['memory_mb_ar'] = inventories['MEMORY_MB']['allocation_ratio']
            p['memory_mb_capacity'] = p['memory_mb_ar'] * p['memory_mb']
        else:
            continue
```

then restart the service
```
docker restart horizon
```

it's dirty but work

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.