Bug #16782

Different MAC addresses used in DHCP leases and TFTP when MAC address is set for libvirt VM

Added by Oleksii Levan about 1 year ago. Updated 11 months ago.

Assigned To:Marek Hulán
Target version:-
Difficulty: Bugzilla link:1388147
Found in release:1.13.0 Pull request:https://github.com/theforeman/foreman/pull/4126
Story points-
Velocity based estimate-
Release1.14.1Release relationshipAuto


When I specify a MAC address for a new host, it's used in DHCP leases, but when the actual libvirt VM boots, it has another, auto-generated MAC address, which is used by TFTP server. The problem is, that with new MAC address, it cannot obtain an IP address and TFTP's location from DHCP, and doesn't boot as the result.

As a workaround, I had to manually edit the DHCP leases file to use the auto-generated MAC address, then the boot proceeds as expected.

Associated revisions

Revision 96983205
Added by Marek Hulán 11 months ago

Fixes #16782 - reset dhcp record cache after mac change

Revision 3d35120d
Added by Marek Hulán 11 months ago

Fixes #16782 - reset dhcp record cache after mac change

(cherry picked from commit 969832057c5ea6a1f84eaf5c53f5cdc7ee445af2)


#1 Updated by Marek Hulán about 1 year ago

  • Category set to Compute resources - libvirt

As far as I know, fog_libivrt, a library that we use to talk to libvirt, ignores the MAC when we send it. You could perhaps open issue on their issue tracker. If you keep MAC field empty, Foreman loads randomly generated MAC from libvirt VM after it creates the VM, so just not specifying the MAC should be OK unless you need some specific MAC address.

#2 Updated by Marek Hulán 12 months ago

  • Category changed from Compute resources - libvirt to Network

#3 Updated by Marek Hulán 12 months ago

  • Bugzilla link set to 1388147

This is not specific to libvirt. The DHCP orchestration creates the DHCP record with old MAC, also the interface becomes invalid and when the VM calls back to /built?, the nic orchestration is not triggered since the interface can't be saved and TFTP file remains untouched. The original TFTP file is being created correctly for the new MAC.

#4 Updated by The Foreman Bot 12 months ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Marek Hulán
  • Pull request https://github.com/theforeman/foreman/pull/4126 added

#5 Updated by Marek Hulán 11 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#6 Updated by Dominic Cleal 11 months ago

  • Release set to 1.14.1

Also available in: Atom PDF