[libvirt] setting up dnsmasq options for PXE boot

Hello, I want to use PXE boot in kvm's virtual machines, but I've not found, how to configure libvirt for starting dhcp server with correct options for this. Now i have libvirt-0.5.1-2.fc10.x86_64 and virt-manager-0.6.0-5.fc10.x86_64, I've created VM using virt manager, with specifying PXE boot option. VM config contains following sections: <os> <type arch='x86_64' machine='pc'>hvm</type> <boot dev='network'/> </os> ..... <interface type='network'> <mac address='54:52:00:0a:f6:00'/> <source network='nat_net'/> <model type='virtio'/> </interface> and config for virtual network nat_net: <network> <name>nat_net</name> <uuid>e02cfc6f-d7f8-6f81-8c19-bfa9d2a13a85</uuid> <forward dev='eth0' mode='nat'/> <bridge stp='on' forwardDelay='0' /> <ip address='192.168.107.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.107.128' end='192.168.107.254' /> </dhcp> </ip> </network> dnsmasq starts with following command line: /usr/sbin/dnsmasq --keep-in-foreground --strict-order --bind-interfaces--pid- file --conf-file --listen-address 192.168.107.1 --except-interface lo --dhcp- leasefile=/var/lib/libvirt/dhcp-nat_net.leases --dhcp-range 192.168.107.128,192.168.107.254 But for working PXE boot it should have also something like --dhcp-boot=pxelinux.0,itchy,192.168.107.1 So after starting VM it tries to boot from network, gets DHCP response and reports, that it doesn't contains filename option. So the question is - how to get it working correctly ? (If i start dnsmasq by hand with option --dhcp-boot=pxelinux.0,itchy,192.168.107.1 PXE boot works) -- Dmitry Guryanov

On Tue, Jan 20, 2009 at 02:05:26PM +0300, Dmitry Guryanov wrote:
But for working PXE boot it should have also something like --dhcp-boot=pxelinux.0,itchy,192.168.107.1
This isn't supported by libvirt at the moment, but it would great to have a patch which enabled this. PXE-booting using dnsmasq is very reliable, and there's no particular reason why we shouldn't support it. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top

On Thu, Jan 22, 2009 at 03:12:39PM +0000, Richard W.M. Jones wrote:
On Tue, Jan 20, 2009 at 02:05:26PM +0300, Dmitry Guryanov wrote:
But for working PXE boot it should have also something like --dhcp-boot=pxelinux.0,itchy,192.168.107.1
This isn't supported by libvirt at the moment, but it would great to have a patch which enabled this. PXE-booting using dnsmasq is very reliable, and there's no particular reason why we shouldn't support it.
Well the virtual network stuff is local to the host only, and so it is even more reliable if you just boot the guest in question from the kernel+initrd directly, instead indirectly giving it the kernel+ initrd via a dodgy PXE server. We have a hammer, but I don't think we should use it in this case. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Thu, 2009-01-22 at 15:20 +0000, Daniel P. Berrange wrote:
On Thu, Jan 22, 2009 at 03:12:39PM +0000, Richard W.M. Jones wrote:
On Tue, Jan 20, 2009 at 02:05:26PM +0300, Dmitry Guryanov wrote:
But for working PXE boot it should have also something like --dhcp-boot=pxelinux.0,itchy,192.168.107.1
This isn't supported by libvirt at the moment, but it would great to have a patch which enabled this. PXE-booting using dnsmasq is very reliable, and there's no particular reason why we shouldn't support it.
Well the virtual network stuff is local to the host only, and so it is even more reliable if you just boot the guest in question from the kernel+initrd directly, instead indirectly giving it the kernel+ initrd via a dodgy PXE server.
We have a hammer, but I don't think we should use it in this case.
When you NAT the virtual network to the outside world (like Dmitry does), there's no reason why the TFTP part of a PXE boot should not work. And if you're on a laptop, connected to a network with a working TFTP server, I don't see why you should have to screw around with kernel +initrd. I always felt it's a mistake to work so hard to hide the actual dnsmasq config from users - it would be much more extensible if we plonked a config file into /etc/dnsmasq.d David

On Wed, Jan 28, 2009 at 06:24:17PM +0000, David Lutterkort wrote:
I always felt it's a mistake to work so hard to hide the actual dnsmasq config from users - it would be much more extensible if we plonked a config file into /etc/dnsmasq.d
Wouldn't necessarily go as far as adding a config file to /etc/dnsmasq.d, but in general terms +1. We're using dnsmasq. It's an excellent little program with a good license. I don't think we should be afraid to offer specific dnsmasq features. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
participants (4)
-
Daniel P. Berrange
-
David Lutterkort
-
Dmitry Guryanov
-
Richard W.M. Jones