dougsland (dougsland) wrote,

Setting up a TFTP server, PXE boot server with libvirt and virt-manager for ovirt-node

This post is about setup virt-manager to autoinstall oVirt Node as virtual machine via libvirt/PXE. Additionaly, TFTP server will be installed in the host machine which runs the virt-manager.

I have created the post based on Fedora 20, fell free to post comments about your experience in others versions or distros.

Installing and Setting packages
# yum install virt-manager tftp tftp-server libvirt livecd-tools -y

Reload libvirtd to create virbr0
# /bin/systemctl restart libvirtd.service

Notice that now you will have the virbr0 interface:
# ip addr
3: virbr0: NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 56:14:04:78:c4:f7 brd ff:ff:ff:ff:ff:ff
inet brd scope global virbr0
valid_lft forever preferred_lft forever

1) Configure the XML of the default libvirt network to include the PXE settings:
bootp file='pxelinux.0' server=''

# virsh net-destroy default
# virsh net-edit default
# virsh net-start default

2) Enable tftp-server
# vi /etc/xinet.d/tftp
disable = yes
disable = no

# /bin/systemctl restart xinetd.service

3) Download ovirt-node image and setup tftpboot
Download the last oVirt Node stable available:
# wget

Convert livecd to pxeboot image:
# livecd-iso-to-pxeboot ./ovirt-node-iso-3.0.4-1.0.201401291204.vdsm34.el6.iso

Copy the files generated to tftp directory:
# cp -Rpv tftpboot/* /var/lib/tftpboot/

Edit default file and include ovirt node settings
# vi /var/lib/tftpboot/pxelinux.cfg/default

DEFAULT pxeboot
LABEL pxeboot
    KERNEL vmlinuz0
    APPEND rootflags=loop initrd=initrd0.img root=live:/ovirt-node-iso-3.0.4-1.0.201401291204.vdsm34.el6.iso rootfstype=auto ro liveimg check RD_NO_LVM rd_NO_MULTIPATH rootflags=ro crashkernel=128M elevator=deadline install quiet max_loop=256 rhgb rd_NO_LUKS rd_NO_MD rd_NO_DM firstboot storage_init=/dev/vda ssh_pwauth=1 adminpw=ovonFQQPIAM9o management_server= BOOTIF=link

- firstboot: first boot
- adminpw: Sets an encrypted, temporary password for admin (ovonFQQPIAM9o is ovirt encrypted)
- management_server: Specifies - the management server to be used.
- storage_init: Initialize a local storage device. (Depending can be vda/sda)
- ssh_pwauth: Enable ssh
- BOOTIF: specify network for bridge (link = autodetect)

Setting Firewalld
firewall-cmd --permanent --add-service=tftp
firewall-cmd --reload

First, check if your host has enabled the nested-kvm, if not, enable it and via virt-manager interface copy the Processor flags to the virtual-machine. After that, create your new virtual machine for oVirt Node based on PXE boot.

Links related to this topic
Tags: #ovirt #ovirt-node
  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 1 comment