The admin/hypervisors page makes 4N+1 Placement API calls per
get_providers() invocation (inventories, usages, aggregates, traits
for each of N providers), and calls get_providers() twice per page
load (view context + tab preload). In deployments with vGPUs, each
physical GPU creates nested child resource providers, causing N to
scale with device count rather than host count. For 100 hosts with
10 vGPU providers each, this resulted in 8,800+ API calls per page
load per user.
Three changes address this:
1. Filter to root providers only: bump Placement API microversion
from 1.6 to 1.14 (which includes parent_provider_uuid in
responses) and skip nested child providers. These carry no
VCPU/MEMORY_MB/DISK_GB inventory and rendered as empty rows.
2. Remove unused aggregates/traits fetching: these were fetched
per-provider but never displayed in the template or table,
reducing per-provider calls from 4 to 2.
3. Set preload=False on ProviderTab: defer loading resource
provider data until the user clicks the tab, following the
established pattern used by ~20 other tabs in Horizon.
For 100 hosts with 10 vGPUs each, initial page load goes from
8,800+ API calls to 201 (44x reduction).
Change-Id: I6b81fee4a0dbb59099e0697ebbcd530477c549a9
Signed-off-by: Luca Miccini <lmiccini@redhat.com>