DHCP problem and PXE

Hi,
I've only recently approached Foreman and I'm doing some provisioning
tests, but I'm stuck at the PXE boot stage: the newly created host cannot
get an IP address from the DHCP server, and it times out.

For basic initial testing I'm running everything on a single CentOS 6.4
machine: Puppet Agent and Master, Foreman (1.3.1), Foreman Smart Proxy
(DHCP and TFTP), KVM.
(The machine is actually a VM itself, running inside Parallels on OSX, its
NIC is configured as NAT but Parallels' own DHCP server is disabled, to
prevent it from interfering with the PXE boot process.)

I configured a subnet in Foreman, and when I create a new host using the
Libvirt compute resource it correctly gets an IP address from the pool.

But when I start the new host it doesn't get any IP address, and so
eventually the timeout is reached.

By looking at the DHCP (ISC) server logs I can see that the server is
receiving the DHCP Discover from the VM, 4 times, and it also replies with
a DHCP Offer each time.
But if I monitor the network traffic with Wireshark I cannot see any DHCP
Offer going out.

Any clues on why it doesn't get through?

The NIC for the newly created host is in Bridge mode, and the source device
is "Host device eth0: macvtap".
If I set the NIC as NAT on the "default" virtual network, instead, the VM
can get an IP from KVM's DHCP server, but of course this server is not
configured for PXE booting and so the boot process stops anyway.

Thank you.

Marco

PS: I understand this problem is not strictly related to PXE; indeed I
tried booting the VM with a live CD and the result is the same. Maybe I'm
missing something on DHCP, Smart Proxy or KVM configuration?

I did some more tests. I installed libvirt/KVM on a separate machine
(another Parallels VM actually), but the KVM guests still cannot get a DHCP
address.

The DHCP server on the Foreman machine works fine, because the KVM host can
get an IP address, if configured as a DHCP client.

So the problem is only for KVM guests. The do not receive the DHCPOFFER
from the server.

I tried the solutions listed on
http://wiki.libvirt.org/page/PXE_boot_(or_dhcp)_on_guest_failed but nothing
changed.

To sum it up:

  • server "F" is running Foreman + ISC DHCP with smart proxy.
  • host "K" is running KVM.
  • guest "V" is a VM created inside KVM, actually provisioned through F; its
    NIC is configured in bridge mode on K's eth0.

V cannot get an IP from F.
F receives the DHCPDISCOVER from V, it replies with DHCPOFFER, but this
never reaches V.
The DHCP server works fine because, as I wrote above, K can successfully
get an IP from F if configured to do so.

Any clues?

Thanks.
Marco

PS: I know I should probably move the question to the libvirt list now that
I better identified the problem, but as everything has been set up with
Foreman in mind I guess other Foreman users might have encountered the same
problems and solved them. Please forgive me 0:-).

··· On Wednesday, November 13, 2013 4:47:33 PM UTC+1, zerozer...@gmail.com wrote:

PS: I understand this problem is not strictly related to PXE; indeed I
tried booting the VM with a live CD and the result is the same. Maybe I’m
missing something on DHCP, Smart Proxy or KVM configuration?