Summary
get_per_nic_networks() in utilities/utils.py (around line 228) explicitly raises a ValueError when called with RHV template names that haven't been cloned into VMs yet, since RHV templates aren't present in the Forklift inventory. This means per_nic_network_map=True currently cannot work for RHV plans before cloning.
Problem / Motivation
get_per_nic_networks() needs deduplicate=False semantics, but BaseProvider.get_vm_or_template_networks() does not support that option. As a workaround, the function queries inventory directly and special-cases RHV by raising a ValueError for RHV template names, since RHV templates aren't present in Forklift inventory until they are cloned into VMs.
This directly affects the multus_network_name fixture in conftest.py, which computes NAD counts from un-cloned template names -- for RHV plans, this computation cannot succeed today.
The limitation is currently dormant and untested: the only test exercising per_nic_network_map=True is tests/cold/test_dual_nic_cold_migration.py::TestColdDualNicSameNetworkPlanValidation, which is marked @pytest.mark.vsphere and does not target RHV. So the bug is latent rather than actively breaking CI.
Requirements
- Extend the
BaseProvider.get_vm_or_template_networks() contract with a per-NIC / deduplication option (e.g. a deduplicate parameter).
- Implement the new option in each provider that subclasses
BaseProvider (RHV in particular, plus the other providers for consistency).
- Update
get_per_nic_networks() in utilities/utils.py to delegate through the provider abstraction (get_vm_or_template_networks()) instead of querying inventory directly and special-casing RHV.
- Remove the
ValueError special-case for RHV template names once RHV support is implemented.
- Extend or add test coverage for
per_nic_network_map=True against RHV plans (in addition to the existing vSphere-only coverage).
Deliverables
Notes
Summary
get_per_nic_networks()inutilities/utils.py(around line 228) explicitly raises aValueErrorwhen called with RHV template names that haven't been cloned into VMs yet, since RHV templates aren't present in the Forklift inventory. This meansper_nic_network_map=Truecurrently cannot work for RHV plans before cloning.Problem / Motivation
get_per_nic_networks()needsdeduplicate=Falsesemantics, butBaseProvider.get_vm_or_template_networks()does not support that option. As a workaround, the function queries inventory directly and special-cases RHV by raising aValueErrorfor RHV template names, since RHV templates aren't present in Forklift inventory until they are cloned into VMs.This directly affects the
multus_network_namefixture inconftest.py, which computes NAD counts from un-cloned template names -- for RHV plans, this computation cannot succeed today.The limitation is currently dormant and untested: the only test exercising
per_nic_network_map=Trueistests/cold/test_dual_nic_cold_migration.py::TestColdDualNicSameNetworkPlanValidation, which is marked@pytest.mark.vsphereand does not target RHV. So the bug is latent rather than actively breaking CI.Requirements
BaseProvider.get_vm_or_template_networks()contract with a per-NIC / deduplication option (e.g. adeduplicateparameter).BaseProvider(RHV in particular, plus the other providers for consistency).get_per_nic_networks()inutilities/utils.pyto delegate through the provider abstraction (get_vm_or_template_networks()) instead of querying inventory directly and special-casing RHV.ValueErrorspecial-case for RHV template names once RHV support is implemented.per_nic_network_map=Trueagainst RHV plans (in addition to the existing vSphere-only coverage).Deliverables
BaseProviderand provider implementations (RHV and others as needed)get_per_nic_networks()inutilities/utils.pyper_nic_network_map=Truefor RHV plansNotes
BaseProvider, so the fix requires a broader contract change rather than a localized patch.