Provision KVM VM without DHCP » History » Revision 2

« Previous | Revision 2/5 (diff) | Next »
Trey Dockendorf, 11/15/2011 09:52 PM

Provision KVM VM without DHCP

This method is similar to the gPXE provisioning method, but the parameters are passed as kernel boot options.


In order to use direct kernel booting, the vmlinuz and initrd.img files need to exist in a storage pool.

I downloaded the two available for CentOS 6.0.

cd /var/lib/libvirt/images

Using virt-manager

From within the virtual machine's details, select the Boot Options. Expand Direct kernel boot and enter the following information. Replace the IP addresses with those specific to your setup

Kernel path: /var/lib/libvirt/images/vmlinuz
Initrd path: /var/lib/libvirt/images/initrd.img
Kernel arguments: ks=http://foremanserver.tld/unattended/provision?static=yes ksdevice=bootif network kssendmac ip= netmask= gateway= dns=

command line using virsh

To make these changes edit the virtual machine's XML file through virsh

virsh edit domain

Below are the relevant lines, replace the IPs with those of your setup

    <type arch='x86_64' machine='rhel6.0.0'>hvm</type>
    <cmdline>ks=http://foremanserver.tld/unattended/provision?static=yes ksdevice=bootif network kssendmac ip= netmask= gateway= dns=</cmdline>
    <boot dev='hd'/>

Updated by Trey Dockendorf over 12 years ago · 2 revisions