[libvirt_manager] generate unique MAC per interface in generate_macs#3802
[libvirt_manager] generate unique MAC per interface in generate_macs#3802fultonj wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
Conversation
Previously, a single MAC address (_fixed_mac) was generated once per VM and assigned to all its network interfaces. For OCP master VMs with multiple networks (e.g. ocppr, ocpbm, osp_trunk, osp_trunk), all interfaces shared the same MAC. This caused the networking_mapper to always resolve to the first interface (enp5s0, on the ocppr bridge) when looking up any network by MAC, since all MACs matched equally. The incorrect interface name then flowed into ci_gen_kustomize_values, setting enp5s0 as the macvlan master in the ctlplane NetworkAttachmentDefinition. Bootstrap pods sent ARP on the wrong bridge and never reached compute nodes, causing wait_for_connection to time out. Fix: generate a unique MAC per (VM, network-index) pair by incorporating loop.index0 into the seed, ensuring each interface gets a distinct MAC. The networking_mapper can then correctly identify enp7s0 (on cifmw-osp_trunk) as the ctlplane interface. Fixes: OSPRH-28297 Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: John Fulton <fulton@redhat.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/ed13079b284a4700b6016b8e524acf9d ✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 28m 30s |
Previously, a single MAC address (_fixed_mac) was generated once per VM and assigned to all its network interfaces. For OCP master VMs with multiple networks (e.g. ocppr, ocpbm, osp_trunk, osp_trunk), all interfaces shared the same MAC.
This caused the networking_mapper to always resolve to the first interface (enp5s0, on the ocppr bridge) when looking up any network by MAC, since all MACs matched equally. The incorrect interface name then flowed into ci_gen_kustomize_values, setting enp5s0 as the macvlan master in the ctlplane NetworkAttachmentDefinition. Bootstrap pods sent ARP on the wrong bridge and never reached compute nodes, causing wait_for_connection to time out.
Fix: generate a unique MAC per (VM, network-index) pair by incorporating loop.index0 into the seed, ensuring each interface gets a distinct MAC. The networking_mapper can then correctly identify enp7s0 (on cifmw-osp_trunk) as the ctlplane interface.
Fixes: OSPRH-28297
Assisted-By: Claude Sonnet 4.6 noreply@anthropic.com