Chapter 4. Installing Hosts for Red Hat Virtualization Red Hat Virtualization supports two types of hosts: Red Hat Virtualization Hosts (RHVH) and Red Hat Enterprise Linux hosts . Depending on your environment, you may want to use one type only, or both. At least two hosts are required for features such as migration and high availability. See Section 4.3, "Recommended Practices for Configuring Host Networks" for networking information. Important SELinux is in enforcing mode upon installation. To verify, run getenforce . SELinux must be in enforcing mode on all hosts and Managers for your Red Hat Virtualization environment to be supported. Table 4.1. Host Types Host Type Other Names Description Red Hat Virtualization Host RHVH, thin host This is a minimal operating system based on Red Hat Enterprise Linux. It is distributed as an ISO file from the Customer Portal and contains only the packages required for the machine to act as a host. Red Hat Enterprise Linux host RHEL host, thick host Red Hat Enterprise Linux systems with the appropriate subscriptions attached can be used as hosts. Host Compatibility When you create a new data center, you can set the compatibility version. Select the compatibility version that suits all the hosts in the data center. Once set, version regression is not allowed. For a fresh Red Hat Virtualization installation, the latest compatibility version is set in the default data center and default cluster; to use an earlier compatibility version, you must create additional data centers and clusters. For more information about compatibility versions see Red Hat Virtualization Manager Compatibility in Red Hat Virtualization Life Cycle . 4.1. Red Hat Virtualization Hosts 4.1.1. Installing Red Hat Virtualization Hosts Red Hat Virtualization Host (RHVH) is a minimal operating system based on Red Hat Enterprise Linux that is designed to provide a simple method for setting up a physical machine to act as a hypervisor in a Red Hat Virtualization environment. The minimal operating system contains only the packages required for the machine to act as a hypervisor, and features a Cockpit web interface for monitoring the host and performing administrative tasks. See http://cockpit-project.org/running.html for the minimum browser requirements. RHVH supports NIST 800-53 partitioning requirements to improve security. RHVH uses a NIST 800-53 partition layout by default. The host must meet the minimum host requirements . Procedure 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 Download Latest to access the product download page. Go to Hypervisor Image for RHV 4.3 and and click Download Now . Create a bootable media device. See Making Media in the Red Hat Enterprise Linux Installation Guide for more information. Start the machine on which you are installing RHVH, booting from the prepared installation media. From the boot menu, select Install RHVH 4.3 and press Enter . Note You can also press the Tab key to edit the kernel parameters. Kernel parameters must be separated by a space, and you can boot the system using the specified kernel parameters by pressing the Enter key. Press the Esc key to clear any changes to the kernel parameters and return to the boot menu. Select a language, and click Continue . Select a time zone from the Date & Time screen and click Done . Select a keyboard layout from the Keyboard screen and click Done . Select the device on which to install RHVH from the Installation Destination screen. Optionally, enable encryption. Click Done . Important Red Hat strongly recommends using the Automatically configure partitioning option. Select a network from the Network & Host Name screen and click Configure... to configure the connection details. Note To use the connection every time the system boots, select the Automatically connect to this network when it is available check box. For more information, see Edit Network Connections in the Red Hat Enterprise Linux 7 Installation Guide . Enter a host name in the Host name field, and click Done . Optionally configure Language Support , Security Policy , and Kdump . See Installing Using Anaconda in the Red Hat Enterprise Linux 7 Installation Guide for more information on each of the sections in the Installation Summary screen. Click Begin Installation . Set a root password and, optionally, create an additional user while RHVH installs. Warning Red Hat strongly recommends not creating untrusted users on RHVH, as this can lead to exploitation of local security vulnerabilities. Click Reboot to complete the installation. Note When RHVH restarts, nodectl check performs a health check on the host and displays the result when you log in on the command line. The message node status: OK or node status: DEGRADED indicates the health status. Run nodectl check to get more information. The service is enabled by default. 4.1.2. Enabling the Red Hat Virtualization Host Repository Register the system to receive updates. Red Hat Virtualization Host only requires one repository. This section provides instructions for registering RHVH with the Content Delivery Network , or with Red Hat Satellite 6 . Registering RHVH with the Content Delivery Network Log in to the Cockpit web interface at https:// HostFQDNorIP :9090 . Navigate to Subscriptions , click Register System , and enter your Customer Portal user name and password. The Red Hat Virtualization Host subscription is automatically attached to the system. Click Terminal . Enable the Red Hat Virtualization Host 7 repository to allow later updates to the Red Hat Virtualization Host: Registering RHVH with Red Hat Satellite 6 Log in to the Cockpit web interface at https:// HostFQDNorIP :9090 . Click Terminal . Register RHVH with Red Hat Satellite 6: 4.1.3. Advanced Installation 4.1.3.1. Custom Partitioning Custom partitioning on Red Hat Virtualization Host (RHVH) is not recommended. Red Hat strongly recommends using the Automatically configure partitioning option in the Installation Destination window. If your installation requires custom partitioning, select the I will configure partitioning option during the installation, and note that the following restrictions apply: Ensure the default LVM Thin Provisioning option is selected in the Manual Partitioning window. The following directories are required and must be on thin provisioned logical volumes: root ( / ) /home /tmp /var /var/crash /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 Section 2.2.3, "Storage Requirements" . 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. Configuring Manual Partitioning in a Kickstart File The following example demonstrates how to configure manual partitioning in a Kickstart file. Note If you use 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. 4.1.3.2. Automating Red Hat Virtualization Host Deployment You can install Red Hat Virtualization Host (RHVH) without a physical media device by booting from a PXE server over the network with a Kickstart file that contains the answers to the installation questions. General instructions for installing from a PXE server with a Kickstart file are available in the Red Hat Enterprise Linux Installation Guide , as RHVH is installed in much the same way as Red Hat Enterprise Linux. RHVH-specific instructions, with examples for deploying RHVH with Red Hat Satellite, are described below. The automated RHVH deployment has 3 stages: Section 4.1.3.2.1, "Preparing the Installation Environment" Section 4.1.3.2.2, "Configuring the PXE Server and the Boot Loader" Section 4.1.3.2.3, "Creating and Running a Kickstart File" 4.1.3.2.1. Preparing the Installation Environment Log in to the Customer Portal . Click Downloads in the menu bar. Click Red Hat Virtualization . Scroll up and click Download Latest to access the product download page. Go to Hypervisor Image for RHV 4.3 and and click Download Now . Make the RHVH ISO image available over the network. See Installation Source on a Network in the Red Hat Enterprise Linux Installation Guide . Extract the squashfs.img hypervisor image file from the RHVH ISO: Note This squashfs.img file, located in the /tmp/usr/share/redhat-virtualization-host/image/ directory, is called redhat-virtualization-host- version_number _version.squashfs.img . It contains the hypervisor image for installation on the physical machine. It should not be confused with the /LiveOS/squashfs.img file, which is used by the Anaconda inst.stage2 option. 4.1.3.2.2. Configuring the PXE Server and the Boot Loader Configure the PXE server. See Preparing for a Network Installation in the Red Hat Enterprise Linux Installation Guide . Copy the RHVH boot images to the /tftpboot directory: Create a rhvh label specifying the RHVH boot images in the boot loader configuration: RHVH Boot Loader Configuration Example for Red Hat Satellite If you are using information from Red Hat Satellite to provision the host, you must create a global or host group level parameter called rhvh_image and populate it with the directory URL where the ISO is mounted or extracted: Make the content of the RHVH ISO locally available and export it to the network, for example, using an HTTPD server: 4.1.3.2.3. Creating and Running a Kickstart File Create a Kickstart file and make it available over the network. See Kickstart Installations in the Red Hat Enterprise Linux Installation Guide . Ensure that the Kickstart file meets the following RHV-specific requirements: The %packages section is not required for RHVH. Instead, use the liveimg option and specify the redhat-virtualization-host- version_number _version.squashfs.img file from the RHVH ISO image: Autopartitioning is highly recommended: Note Thin provisioning must be used with autopartitioning. The --no-home option does not work in RHVH because /home is a required directory. If your installation requires manual partitioning, see Section 4.1.3.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 the nodectl init command is required: Kickstart Example for Deploying RHVH on Its Own This Kickstart example shows you how to deploy RHVH. You can include additional commands and options as required. Kickstart Example for Deploying RHVH with Registration and Network Configuration from Satellite This Kickstart example 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 called rhvh_image and populate it with the directory URL to the squashfs.img file. ntp_server1 is also a global or host group level variable. Add the Kickstart file location to the boot loader configuration file on the PXE server: Install RHVH following the instructions in Booting from the Network Using PXE in the Red Hat Enterprise Linux Installation Guide . 4.2. Red Hat Enterprise Linux hosts 4.2.1. Installing Red Hat Enterprise Linux hosts A Red Hat Enterprise Linux host is based on a standard basic installation of Red Hat Enterprise Linux 7 on a physical server, with the Red Hat Enterprise Linux Server and Red Hat Virtualization subscriptions attached. For detailed installation instructions, see the Performing a standard {enterprise-linux-shortname} installation . The host must meet the minimum host requirements . Important Virtualization must be enabled in your host's BIOS settings. For information on changing your host's BIOS settings, refer to your host's hardware documentation. Important Third-party watchdogs should not be installed on Red Hat Enterprise Linux hosts, as they can interfere with the watchdog daemon provided by VDSM. 4.2.2. Enabling the Red Hat Enterprise Linux host Repositories To use a Red Hat Enterprise Linux machine as a host, you must register the system with the Content Delivery Network, attach the Red Hat Enterprise Linux Server and Red Hat Virtualization subscriptions, and enable the host repositories. Procedure Register your system with the Content Delivery Network, entering your Customer Portal user name and password when prompted: Find the Red Hat Enterprise Linux Server and Red Hat Virtualization subscription pools and record the pool IDs: Use the pool IDs to attach the subscriptions to the system: Note To view currently attached subscriptions: To list all enabled repositories: Configure the repositories: For Red Hat Enterprise Linux 7 hosts, little endian, on IBM POWER8 hardware: For Red Hat Enterprise Linux 7 hosts, little endian, on IBM POWER9 hardware: Ensure that all packages currently installed are up to date: Reboot the machine. 4.2.3. Installing Cockpit on Red Hat Enterprise Linux hosts You can install Cockpit for monitoring the host's resources and performing administrative tasks. Procedure Install the dashboard packages: Enable and start the cockpit.socket service: Check if Cockpit is an active service in the firewall: You should see cockpit listed. If it is not, enter the following with root permissions to add cockpit as a service to your firewall: The --permanent option keeps the cockpit service active after rebooting. You can log in to the Cockpit web interface at https:// HostFQDNorIP :9090 . 4.3. Recommended Practices for Configuring Host Networks If your network environment is complex, you may need to configure a host network manually before adding the host to the Red Hat Virtualization Manager. Red Hat recommends the following practices for configuring a host network: Configure the network with Cockpit. Alternatively, you can use nmtui or nmcli . If a network is not required for a self-hosted engine deployment or for adding a host to the Manager, configure the network in the Administration Portal after adding the host to the Manager. See Creating a New Logical Network in a Data Center or Cluster . Use the following naming conventions: VLAN devices: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD VLAN interfaces: physical_device . VLAN_ID (for example, eth0.23 , eth1.128 , enp3s0.50 ) Bond interfaces: bond number (for example, bond0 , bond1 ) VLANs on bond interfaces: bond number . VLAN_ID (for example, bond0.50 , bond1.128 ) Use network bonding . Networking teaming is not supported in Red Hat Virtualization and will cause errors if the host is used to deploy a self-hosted engine or added to the Manager. Use recommended bonding modes: If the ovirtmgmt network is not used by virtual machines, the network may use any supported bonding mode. If the ovirtmgmt network is used by virtual machines, see Which bonding modes work when used with a bridge that virtual machine guests or containers connect to? . Red Hat Virtualization's default bonding mode is (Mode 4) Dynamic Link Aggregation . If your switch does not support Link Aggregation Control Protocol (LACP), use (Mode 1) Active-Backup . See Bonding Modes for details. Configure a VLAN on a physical NIC as in the following example (although nmcli is used, you can use any tool): Configure a VLAN on a bond as in the following example (although nmcli is used, you can use any tool): Do not disable firewalld . Customize the firewall rules in the Administration Portal after adding the host to the Manager. See Configuring Host Firewall Rules . Important When creating a management bridge that uses a static IPv6 address, disable network manager control in its interface configuration (ifcfg) file before adding a host. See https://access.redhat.com/solutions/3981311 for more information. 4.4. Adding Standard Hosts to the Red Hat Virtualization Manager Adding a host to your Red Hat Virtualization environment can take some time, as the following steps are completed by the platform: virtualization checks, installation of packages, and creation of a bridge. Important When creating a management bridge that uses a static IPv6 address, disable network manager control in its interface configuration (ifcfg) file before adding a host. See https://access.redhat.com/solutions/3981311 for more information. Procedure From the Administration Portal, click Compute Hosts . Click New . Use the drop-down list to select the Data Center and Host Cluster for the new host. Enter the Name and the Address of the new host. The standard SSH port, port 22, is auto-filled in the SSH Port field. Select an authentication method to use for the Manager to access the host. Enter the root user's password to use password authentication. Alternatively, copy the key displayed in the SSH PublicKey field to /root/.ssh/authorized_keys on the host to use public key authentication. Optionally, click the Advanced Parameters button to change the following advanced host settings: Disable automatic firewall configuration. Add a host SSH fingerprint to increase security. You can add it manually, or fetch it automatically. Optionally configure power management, where the host has a supported power management card. For information on power management configuration, see Host Power Management Settings Explained in the Administration Guide . Click OK . The new host displays in the list of hosts with a status of Installing , and you can view the progress of the installation in the Events section of the Notification Drawer ( ). After a brief delay the host status changes to Up .

Commands:
subscription-manager repos --enable=rhel-7-server-rhvh-4-rpms
rpm -Uvh http://satellite.example.com/pub/katello-ca-consumer-latest.noarch.rpm # subscription-manager register --org=" org_id " # subscription-manager list --available # subscription-manager attach --pool= pool_id # subscription-manager repos --disable='*' --enable=rhel-7-server-rhvh-4-rpms
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/crash --vgname=HostVG --name=var_crash --thin --fstype=ext4 --poolname=HostPool --fsoptions="defaults,discard" --size=10000 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
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
cp mnt/rhvh/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/pxelinux/
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
<%# 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
cp -a /mnt/rhvh/ /var/www/html/rhvh-install curl URL/to/RHVH-ISO /rhvh-install
liveimg --url= example.com /tmp/usr/share/redhat-virtualization-host/image/redhat-virtualization-host- version_number _version.squashfs.img
autopart --type=thinp
%post nodectl init %end
liveimg --url=http:// FQDN /tmp/usr/share/redhat-virtualization-host/image/redhat-virtualization-host- version_number _version.squashfs.img clearpart --all autopart --type=thinp rootpw --plaintext ovirt timezone --utc America/Phoenix zerombr text reboot %post --erroronfail nodectl init %end
<%# 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
APPEND initrd=/var/tftpboot/pxelinux/initrd.img inst.stage2= URL/to/RHVH-ISO inst.ks= URL/to/RHVH-ks .cfg
subscription-manager register
subscription-manager list --available
subscription-manager attach --pool= poolid
subscription-manager list --consumed
yum repolist
subscription-manager repos --disable='*' --enable=rhel-7-server-rpms --enable=rhel-7-server-rhv-4-mgmt-agent-rpms --enable=rhel-7-server-ansible-2.9-rpms
subscription-manager repos --disable='*' --enable=rhel-7-server-rhv-4-mgmt-agent-for-power-le-rpms --enable=rhel-7-for-power-le-rpms
subscription-manager repos --disable='*' --enable=rhel-7-server-rhv-4-mgmt-agent-for-power-9-rpms --enable=rhel-7-for-power-9-rpms
yum update
yum install cockpit-ovirt-dashboard
systemctl enable cockpit.socket systemctl start cockpit.socket
firewall-cmd --list-services
firewall-cmd --permanent --add-service=cockpit
nmcli connection add type vlan con-name vlan50 ifname eth0.50 dev eth0 id 50 nmcli con mod vlan50 +ipv4.dns 8.8.8.8 +ipv4.addresses 123.123 .0.1/24 +ivp4.gateway 123.123 .0.254
nmcli connection add type bond con-name bond0 ifname bond0 bond.options "mode=active-backup,miimon=100" ipv4.method disabled ipv6.method ignore nmcli connection add type ethernet con-name eth0 ifname eth0 master bond0 slave-type bond nmcli connection add type ethernet con-name eth1 ifname eth1 master bond0 slave-type bond nmcli connection add type vlan con-name vlan50 ifname bond0.50 dev bond0 id 50 nmcli con mod vlan50 +ipv4.dns 8.8.8.8 +ipv4.addresses 123.123 .0.1/24 +ivp4.gateway 123.123 .0.254