After completing this section, you should be able to configure a network installation and kickstart server as provisioning tools in the Red Hat Virtualization environment.
Red Hat Virtualization Host (RHV-H) can be installed manually, which will not scale in a large enterprise environment with many hosts. Since RHV-H is built from RHEL, RHV-H uses the same Anaconda installer, which you can automate using a Kickstart configuration.
To create a fully automated, unattended installation, use a network installation server configured with PXE, TFTP, and a shared Kickstart file to start an installation by booting from the network.
Booting from the Network Using PXE
Preboot eXecution Environment (PXE) is a computer bootstrap mechanism using a network server. The client network interface must support PXE, and the system firmware must enable PXE support.
The network boot infrastructure must provide the following services:
A DHCP server to handle the initial client communication, the network configuration, and the TFTP server location with a usable boot image.
A TFTP server to provide boot images with command-line options, to start the installer.
An HTTP, FTP, or NFS server to provide the installation media and the Kickstart file for this installation.
At boot, the client's network interface card broadcasts a DHCPDISCOVER packet extended with PXE-specific options. A DHCP server on the network replies with a DHCPOFFER, giving the client information about the PXE server and offering an IP address. When the client responds with a DHCPREQUEST, the server sends a DHCPACK with the Trivial FTP (TFTP) server URL of a file that can boot the client into an installer program.
The client downloads the file from the TFTP server (frequently the same system as the DHCP server), verifies the file using a checksum, and loads the file.
Typically, the file is a network boot loader called pxelinux.0.
This boot loader accesses a configuration file on the TFTP server that tells it how to download and start the RHV-H installer, and how to locate the Kickstart file on an HTTP, FTP, or NFS server.
After verification, the files are used to boot the client.
Configuring a PXE Boot Service
To configure an automated network installation of RHV-H, perform the following tasks:
Configure a DHCP server to use PXE, and then point your RHV-H clients to the TFTP server and the pxelinux.0 file.
Configure a TFTP server to provide the pxelinux.0 file, a configuration file that points to the RHV-H installer kernel and initial ram disk image, and to the location of the Kickstart file.
Share the RHV-H installation media and the Kickstart file using a supported network service such as NFS, HTTPS, HTTP, or FTP.
Configuring the DHCP and TFTP Server
This example configuration uses a Red Hat Enterprise Linux network installation server for booting BIOS-based AMD64 and Intel 64 systems.
In this example, the DHCP and TFTP servers are on the same system, with the IPv4 172.25.250.8 address.
This example procedure will not boot hosts using UEFI-based boot firmware. UEFI-based systems require extra files from the shim and grub2-efi packages, and a different configuration file.
For more information, see the section "Configuring a TFTP Server for UEFI-based AMD64 and Intel 64 Clients" in the Installation Guide for Red Hat Enterprise Linux 8 at https://access.redhat.com/documentation/.
Install a Red Hat Enterprise Linux server with the syslinux, tftp-server, and dhcp packages.
In the /var/lib/tftpboot directory, create a pxelinux directory.
Copy the /usr/share/syslinux/pxelinux.0 file into /var/lib/tftpboot/pxelinux.
In the /var/lib/tftpboot/pxelinux directory, create a pxelinux.cfg directory.
This directory contains the default configuration file that is used by any system PXE-booting from this TFTP service.
The following example shows the default configuration file:
default vesamenuc32 prompt 1 timeout 60 display boot.msg labelrhvh-hostmenu label^Install RHV-H hostmenu default kernel vmlinuz append initrd=initrd.img ip=dhcpinst.stage2=http://install-server/RHVH-installation-media-directoryinst.ks=http://install-server/kickstart-file-directory/kickstart-file.cfg
The important parts of this configuration file are:
label rhvh-host is the boot loader configuration for the RHV-H installation, which appears in the menu as Install RHV-H Host
The vmlinuz and initrd.img files are provided by TFTP from /var/lib/tftpboot/pxelinux.
The inst.stage2 directive is an HTTP server (install-server) URL for the installation media.
The inst.ks directive is an HTTP server URL for the Kickstart file.
Copy the boot image from inside the RHV-H ISO file to the /var/lib/tftpboot directory.
Set up the DHCP server configuration file, /etc/dhcp/dhcpd.conf.
The following example provides basic network information for a 172.25.250.0/24 subnet, and specifies a TFTP server at 172.25.250.8, which is the same server.
Clients download and boot the pxelinux/pxelinux.0 file from the TFTP server.
option space pxelinux;
option pxelinux.magic code 208 = string;
option pxelinux.configfile code 209 = text;
option pxelinux.pathprefix code 210 = text;
option pxelinux.reboottime code 211 = unsigned integer 32;
option architecture-type code 93 = unsigned integer 16;
subnet 172.25.250.0 netmask 255.255.255.0 {
option routers 172.25.250.254;
option subnet-mask 255.255.255.0;
option domain-search "lab.example.com";
option domain-name-servers 172.25.250.254;
range 172.25.250.21 172.25.250.30;
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
next-server 172.25.250.8;
if option architecture-type = 00:07 {
filename "uefi/shim.efi";
} else {
filename "pxelinux/pxelinux.0";
}
}
}
Configure the firewall to allow the necessary services.
If firewalld is configured, use the predefined TFTP and DHCP services.
Start and enable the dhcpd and tftp services.
When finished, the PXE boot server is ready.
The PXE server default configuration file specified two files required to start an installation, a live image file containing the RHV-H operating system, and a Kickstart file.
These files can be shared using HTTP, NFS or FTP.
This example uses HTTP.
Providing the RHV-H Live Image
Prepare your web server for an unattended network installation of new RHV-H hosts by extracting the RHV-H live image from the RHV-H installation ISO.
Download the RHV-H ISO image file to a local directory and mount it.
Locate the large redhat-virtualization-host-image- and unarchive it.
Locate the version.rpmsquashfs configuration file in the unarchived rpm directory.
Copy the redhat-virtualization-host- to your web server directory.
Rename the file to make it easier to reference inside the Kickstart file.
In this example, the file was renamed to version.squashfs.imgsquashfs.img.
The squashfs.img file contains the RHV-H operating system with all required packages, and it automatically deploys the new RHV-H host.
Creating a RHV-H Kickstart File
An unattended network image Kickstart file is simpler than a typical Kickstart file because you do not need to specify any packages to install, as they are all contained in squashfs.img.
Even the partition layout is specified and automatically created using an LVM Thin Provisioning mechanism.
Client systems can be configured to always first boot to the network, to allow systems to be reinstalled remotely without manual intervention. PXE servers can be configured to enable or disable the ability to respond to individual clients, thus providing installation service only to designated clients. PXE servers can also be configured to respond to PXE booting requests, in a manner that instructs the client to boot from a local disk instead.
Configuring clients to automatically boot into an unattended network installation can result in accidental host re installation. Red Hat recommends that you enable PXE and DHCP configurations only on demand, and disable individual host configuration as soon as the RHV-H host installation and deployment is complete.
Create the Kickstart file using any text editor, using a descriptive name that makes it easy to remember and select the correct file among those stored on the Kickstart server. The following example shows a Kickstart file for an automatic RHV-H installation:
liveimg --url=http://install-server/RHVH-installation-media-directory/squashfs.img clearpart --all autopart --type=thinp zerombr rootpw --plaintextroot_password_in_clear_texttimezone Etc/UTC --isUtc text reboot %post --erroronfail nodectl init %end
The liveimg parameter specifies the HTTP URL for the RHV-H installation tree on the network.
The clearpart --all parameter removes any existing partitions.
The autopart --type=thinp parameter creates a new LVM-based layout, and the zerombr parameter clears the MBR.
The rootpw --plaintext parameter sets the root password.
The timezone Etc/UTC --isUtc parameter sets the time zone.
The text parameter sets the UI mode for the installer, which is text mode in this example.
The reboot parameter reboots the host after the installation completes.
The %post section starts the configuration process of the newly installed RHV-H host.
This example can be extended with additional commands and options, but it is sufficient to automatically install a new RHV-H host.
Share the new Kickstart file using HTTP, NFS, or FTP.
The earlier example pxelinux.cfg file specified the web server directory (/var/www/html/).
kickstart-file-directory/kickstart-file.cfg
The example presented in this section configures an automated RHV-H Kickstart installation whenever a recognized node PXE-boots.
The behavior is controlled by the /var/lib/tftpboot/pxelinux/pxelinux.cfg file on the example server.
When using UEFI-based systems, the configuration will be slightly different.
The boot loader specified in the Kickstart file downloads and starts the vmlinuz kernel from the RHV-H installation ISO file.
That kernel is invoked with four command-line kernel parameters:
initrd=initrd.img to download the initial RAM disk image (initrd.img) that was collocated with the vmlinuz file on the RHV-H ISO.
ip=dhcp to obtain an IP address using DHCP.
An inst.stage2 directive pointing to a shared URL containing the squash.img file.
An inst.ks directive pointing to a shared URL for the Kickstart file.
Using Red Hat Satellite Server, an administrator can provision many hosts concurrently. Red Hat Satellite Server has multiple methods for provisioning hosts.
The Bare Metal Provisioning method provisions hosts using PXE boot, although environments without PXE can use other methods. The Cloud Providers method connects to private and public cloud providers to provision hosts. The Cloud Providers method uses images stored in the cloud environment, whereas Bare Metal Provisioning requires the installation files to be available on the local network. Satellite Server can also connect to a VMware ESX, or other virtualization infrastructure, to provision hosts. Satellite Server can also use Linux containers to provision hosts.
To avoid configuring DHCP or TFTP servers on the network, cloud-init can be used to provision hosts. You can download a template from the Red Hat Customer portal and upload it to an RHV-H host. The cloud-init template can also be created using a standard RHEL 8 image. The image, either downloaded or created from the RHEL 8 image, is then uploaded to Satellite Server. A provisioning template is then created in Satellite, with a specific configuration for cloud-init.
Customizing deployed virtual machines using cloud-init is covered in a later chapter.
Adding a Satellite host provider in RHV-M is almost the same as adding a new RHEL host. Selecting Use Foreman/Satellite displays the options for adding a Satellite host provider. The default option, Discovered Hosts, allows the administrator to choose Discovered Hosts, Host Groups, and Compute Resources from a drop-down menu.
Satellite Server has many advantages over Kickstart using Anaconda. For example, Satellite Server allows administrators to provision grouped machines, using HostGroups. Target hosts can be customized easily using Puppet support in Satellite Server. Enterprise grade provisioning should always be done using Satellite Server. A simple Kickstart provisioning uses sub-management from Red Hat, for example, pulling down packages from Red Hat servers. Satellite Server uses local package installation from servers on the company side of the firewall. Satellite Server also allows the administrator to have complete control. For example, different classes of virtual machines can have fine-grained customization. In addition to provisioning, Satellite also provides ongoing support for upgrades.
Further information on automated installation of RHV-H is available in the "Advanced Installation" section of the Installation Guide for Red Hat Virtualization 4.3 at https://access.redhat.com/documentation/
Further information on how to set up a Red Hat Enterprise Linux-based PXE service using dhcpd and tftpd is available in the chapter "Preparing for a Network Installation" in the Installation Guide for Red Hat Enterprise Linux 8 at https://access.redhat.com/documentation/
Further information on DHCP server configuration for Red Hat Enterprise Linux is available in the chapter "DHCP Servers" in the Networking Guide for Red Hat Enterprise Linux 8 at https://access.redhat.com/documentation/