Skip to content

RHV templates unsupported by get_per_nic_networks() / per_nic_network_map #620

Description

@krcmarik

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

  1. Extend the BaseProvider.get_vm_or_template_networks() contract with a per-NIC / deduplication option (e.g. a deduplicate parameter).
  2. Implement the new option in each provider that subclasses BaseProvider (RHV in particular, plus the other providers for consistency).
  3. 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.
  4. Remove the ValueError special-case for RHV template names once RHV support is implemented.
  5. Extend or add test coverage for per_nic_network_map=True against RHV plans (in addition to the existing vSphere-only coverage).

Deliverables

  • Code changes to BaseProvider and provider implementations (RHV and others as needed)
  • Code changes to get_per_nic_networks() in utilities/utils.py
  • README update (if applicable)
  • CLAUDE.md update (if applicable)
  • Tests covering per_nic_network_map=True for RHV plans

Notes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions