5.2. Advanced Installation
5.2.1. Custom Partitioning
I will configure partitioning
option during the installation, and note that the following restrictions apply:
- You must select the LVM Thin Provisioning option in the Manual Partitioning window.
- The following directories are required and must be on thin provisioned logical volumes:
- root (
/
) /home
/tmp
/var
/var/log
/var/log/audit
Important
Do not create a separate partition for/usr
. Doing so will cause the installation to fail./usr
must be on a logical volume that is able to change versions along with RHVH, and therefore should be left on root (/
).For information about the required storage sizes for each partition, see Storage Requirements in the Planning and Prerequisites Guide. - The
/boot
directory should be defined as a standard partition. - The
/var
directory must be on a separate volume or disk. - Only XFS or Ext4 file systems are supported.
Example 5.1. Configuring Manual Partitioning in a Kickstart File
clearpart --all part /boot --fstype xfs --size=1000 --ondisk=sda part pv.01 --size=42000 --grow volgroup HostVG pv.01 --reserved-percent=20 logvol swap --vgname=HostVG --name=swap --fstype=swap --recommended logvol none --vgname=HostVG --name=HostPool --thinpool --size=40000 --grow logvol / --vgname=HostVG --name=root --thin --fstype=ext4 --poolname=HostPool --fsoptions="defaults,discard" --size=6000 --grow logvol /var --vgname=HostVG --name=var --thin --fstype=ext4 --poolname=HostPool --fsoptions="defaults,discard" --size=15000 logvol /var/log --vgname=HostVG --name=var_log --thin --fstype=ext4 --poolname=HostPool --fsoptions="defaults,discard" --size=8000 logvol /var/log/audit --vgname=HostVG --name=var_audit --thin --fstype=ext4 --poolname=HostPool --fsoptions="defaults,discard" --size=2000 logvol /home --vgname=HostVG --name=home --thin --fstype=ext4 --poolname=HostPool --fsoptions="defaults,discard" --size=1000 logvol /tmp --vgname=HostVG --name=tmp --thin --fstype=ext4 --poolname=HostPool --fsoptions="defaults,discard" --size=1000
Note
logvol --thinpool --grow
, you must also include volgroup --reserved-space
or volgroup --reserved-percent
to reserve space in the volume group for the thin pool to grow.
5.2.2. Automating Red Hat Virtualization Host Deployment
Procedure 5.2. Automating Deployment using PXE and Kickstart
- Download the RHVH ISO image from the Customer Portal:
- Log in to the Customer Portal at https://access.redhat.com.
- Click Downloads in the menu bar.
- Click Red Hat Virtualization, scroll up, and click to access the product download page.
- Choose the appropriate hypervisor image and click.
- Make the RHVH ISO image available over the network using the instructions in Installation Source on a Network.
- Extract the
squashfs.img
file from the RHVH ISO:# mount -o loop /path/to/RHVH-ISO /mnt/rhvh # cp /mnt/rhvh/Packages/redhat-virtualization-host-image-update* /tmp # cd /tmp # rpm2cpio redhat-virtualization-host-image-update* | cpio -idmv
Thesquashfs.img
file is located at/tmp/usr/share/redhat-virtualization-host/image/
. - Configure the PXE server using the instructions in Preparing for a Network Installation.The following requirements apply in order to boot RHVH from the PXE server:
- Ensure that you copy the RHVH boot images to the
/tftpboot
directory.# cp URL/to/RHVH-ISO/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/pxelinux/
- The boot loader configuration file must include a RHVH label that specifies the RHVH boot images.
LABEL rhvh MENU LABEL Install Red Hat Virtualization ^Host KERNEL /var/lib/tftpboot/pxelinux/vmlinuz APPEND initrd=/var/lib/tftpboot/pxelinux/initrd.img inst.stage2=URL/to/RHVH-ISO
Example 5.2. Red Hat Virtualization Host PXELinux Satellite Template
The following is an example of a boot loader label that uses information from Red Hat Satellite to provision the host. You must create a global or host group level parameter calledrhvh_image
and populate it with the directory URL where the ISO is mounted or extracted.<%# kind: PXELinux name: RHVH PXELinux %> # Created for booting new hosts # DEFAULT rhvh LABEL rhvh KERNEL <%= @kernel %> APPEND initrd=<%= @initrd %> inst.ks=<%= foreman_url("provision") %> inst.stage2=<%= @host.params["rhvh_image"] %> intel_iommu=on console=tty0 console=ttyS1,115200n8 ssh_pwauth=1 local_boot_trigger=<%= foreman_url("built") %> IPAPPEND 2
- Create a Kickstart file and make it available over the network using the instructions in Kickstart Installations.The following constraints apply to RHVH Kickstart files:
- The
%packages
section is not required for RHVH. Instead, use theliveimg
option and specify thesquashfs.img
file from the RHVH ISO image.liveimg --url=example.com/tmp/usr/share/redhat-virtualization-host/image/squashfs.img
- The
autopart
command is highly recommended. Thin provisioning must be used.autopart --type=thinp
Note
The--no-home
option does not work in RHVH. This is an expected behavior, because/home
is a required directory.If your installation requires manual partitioning instead, see Section 5.2.1, “Custom Partitioning” for a list of limitations that apply to partitions, and an example of manual partitioning in a Kickstart file. - A
%post
section that calls thenodectl init
command is required.%post nodectl init %end
To fully automate the installation process, you can add this Kickstart file to the boot loader configuration file on the PXE server. Specify the Kickstart location by addinginst.ks=
to theAPPEND
line:APPEND initrd=/var/tftpboot/pxelinux/initrd.img inst.stage2=URL/to/RHVH-ISO inst.ks=URL/to/RHVH-ks.cfg
Example 5.3. Red Hat Virtualization Host Kickstart File
The following is an example of a Kickstart file used to deploy Red Hat Virtualization Host. You can include additional commands and options as required.liveimg --url=http://1.2.3.4/tmp/usr/share/redhat-virtualization-host/image/squashfs.img clearpart --all autopart --type=thinp rootpw --plaintext ovirt timezone --utc America/Phoenix zerombr text reboot %post --erroronfail nodectl init %end
Example 5.4. Red Hat Virtualization Host Kickstart File with Registration and Network Configuration
The following is an example of a Kickstart file that uses information from Red Hat Satellite to configure the host network and register the host to the Satellite server. You must create a global or host group level parameter calledrhvh_image
and populate it with the directory URL to thesquashfs.img
file.ntp_server1
is also a global or host group level variable.<%# kind: provision name: RHVH Kickstart default oses: - RHVH %> install liveimg --url=<%= @host.params['rhvh_image'] %>squashfs.img network --bootproto static --ip=<%= @host.ip %> --netmask=<%= @host.subnet.mask %> --gateway=<%= @host.subnet.gateway %> --nameserver=<%= @host.subnet.dns_primary %> --hostname <%= @host.name %> zerombr clearpart --all autopart --type=thinp rootpw --iscrypted <%= root_pass %> # installation answers lang en_US.UTF-8 timezone <%= @host.params['time-zone'] || 'UTC' %> keyboard us firewall --service=ssh services --enabled=sshd text reboot %post --log=/root/ks.post.log --erroronfail nodectl init <%= snippet 'subscription_manager_registration' %> <%= snippet 'kickstart_networking_setup' %> /usr/sbin/ntpdate -sub <%= @host.params['ntp_server1'] || '0.fedora.pool.ntp.org' %> /usr/sbin/hwclock --systohc /usr/bin/curl <%= foreman_url('built') %> sync systemctl reboot %end
- Install RHVH using the instructions in Booting the Installation on AMD64 and Intel 64 Systems from the Network Using PXE.