7.4. Automated Installation of the Hypervisor (Advanced)

This section covers the kernel command line parameters for Red Hat Enterprise Virtualization Hypervisors. These parameters can be used to automate installation. The parameters are described in detail and an example parameter string for an automated installation is provided.
This installation method is an alternative to the interactive installation. Using the method covered in this chapter with a PXE server can, with some configuration, deploy multiple Hypervisors without manually accessing the systems.
It is important to understand how the parameters work and what effects they have before attempting automated deployments. These parameters can delete data from existing systems if the system is configured to automatically boot with PXE.

7.4.1. How the Kernel Arguments Work

Below is a description of the Red Hat Enterprise Virtualization Hypervisor start up sequence. This may be useful for debugging issues with automated installation.
  1. The ovirt-early service sets storage, network and management parameters in the /etc/default/ovirt file. These parameters are determined from the kernel arguments passed to the Hypervisor during the boot sequence.
  2. The /etc/init.d/ovirt-firstboot script determines the type of installation to perform based on the parameters set on the kernel command line or the TUI installation.

7.4.2. Required Parameters

At a minimum, the following parameters are required for an installation:
  1. One of the following parameters, depending on the type of installation or reinstallation that you wish to perform:
    1. install, to begin an installation (even if it detects an existing installation).
    2. reinstall, to remove a current installation and begin a completely clean reinstall.
    3. upgrade, to upgrade an existing installation.
  2. The storage_init parameter, to initialize a local storage device.
  3. The BOOTIF parameter, to specify the network interface which the Hypervisor uses to connect to the Manager. When using PXE boot, BOOTIF may be automatically supplied by pxelinux.
These parameters are discussed in further detail in the sections that follow.
If you want to use Red Hat Enterprise Virtualization Hypervisor with Red Hat Enterprise Virtualization Manager, you must also provide at least one of the following parameters:
adminpw
Allows you to log in with administrative privileges to configure Red Hat Enterprise Virtualization Hypervisor.
management_server
Specifies the Red Hat Enterprise Virtualization Manager to be used.
rhevm_admin_password
Specifies the password to be used during the process of adding a host in Red Hat Enterprise Virtualization Manager.

7.4.3. Storage Parameters

The following parameters configure local storage devices for installing a Hypervisor.
storage_init
The storage_init parameter is required for an automated installation; it initializes a local storage device.
Hypervisors use one storage device for local installation. There are several methods for defining which disk to initialize and install on.
  • For USB storage devices, use the usb parameter to select the disk type. For example:
    storage_init=usb
  • For SCSI hard drives, use the scsi parameter to select the disk type. For example:
    storage_init=scsi
  • For hard drives on the ATA bus, including SATA hard drives that may also appear on the SCSI bus, use the ata parameter to select the disk type. For example:
    storage_init=ata
  • Alternatively, the storage device can be specified by using the Linux device name as the storage_init parameter. Using device names in the format /dev/disk/by-id is not supported. storage_init must use the format /dev/mapper/disk or /dev/disk. In this example the /dev/sda device is specified:
    storage_init=/dev/sda
When specifying a storage_init value of usb, scsi, or ata you can also append a serial number to explicitly set which device to use. Determine the serial numbers for all disks attached to the system by running the command in the example below:

Example 7.15. Finding udev Serial Numbers

$ for d in /dev/sd?; do echo $d `udevadm info -q env -n $d | egrep 'ID_BUS=|ID_SERIAL='`; done
      /dev/sda ID_SERIAL=ST9500325AS_6VE867X1
When providing both a storage type and the serial number, ensure that the two values are separated by a colon (:). For example:
storage_init=ata:3600508b100104a3953545233304c0003

Important

If reinstalling Red Hat Enterprise Virtualization Hypervisor over an existing instance on a multipathed iSCSI machine, specify the storage type and serial number to avoid installation errors.

Note

Consistency of devices names following a system restart is not guaranteed. Device names are liable to change.
storage_vol
The storage_vol parameter is used to partition the storage device set by the storage_init parameter. After storage_vol=, you can specify the size in megabytes of the following partitions: Boot, Swap, Root, Config, Logging, and Data.
The Boot partition is always 50 MB and cannot be reconfigured. The Root partition for Red Hat Enterprise Virtualization Hypervisor 7 is always 8600 MB and cannot be reconfigured. The remaining partitions are described in more detail below:

Partitions defined by the storage_vol parameter

Swap
The swap partition is used for swapping pages of memory that are not frequently accessed to the hard drive. This frees pages of memory in RAM that are in turn used for pages which are accessed more frequently, increasing performance. The default size of the swap partition is calculated based on the amount of RAM installed in the system and over-commit ratio (default is 0.5). Hypervisors must have a swap partition and the swap partition cannot be disabled by setting its size to 0. The minimum size for the swap partition is 8 MB.
To determine the size of the swap partition, see https://access.redhat.com/knowledge/solutions/15244.
Use the formula from the Red Hat Knowledgebase solution above and add storage for the over-commit ratio (RAM multiplied by the over-commit ratio).
Recommended swap + (RAM * over-commit) = swap partition size
Leaving the value empty allows the system to sets the recommended value for the swap partition.
Config
The config partition stores configuration files for the Hypervisor. The default and minimum size for the configuration partition is 8 MB.
Logging
The logging partition stores all logs for the Hypervisor. The logging partition requires a minimum of 2048 MB storage. However, it is recommended to allocate more storage to the logging partition if resources permit.
Data
The data partition must be large enough to hold core files for KVM. Core files depend on the RAM size for the guests. The data partition must also be large enough to store kernel dump files, also known as kdumps. A kdump file is usually the same size as the host's system RAM. The data partition also stores the Hypervisor ISO file for Hypervisor upgrades.
The data partition requires a minimum of 512 MB storage. The recommended size is at least 1.5 times as large as the RAM on the host system plus an additional 512 MB. It can be configured to take up all remaining space by giving it a size value of -1, or disabled by giving it a size value of 0.
Partitions can be specified in any order. The syntax for specifying each partition is size,type. Each partition specified is separated by a colon (:). To specify a 256MB Swap partition, and a 4096MB Logging partition, the whole parameter is storage_vol=256,Swap:4096,Logging.

Note

The old method of specifying partition sizes is still valid. In the old method, the partition sizes must be given in a particular order, as shown here:
storage_vol=BOOT:SWAP:ROOT:CONFIG:LOGGING:DATA
However, since the Boot and Root partitions cannot be reconfigured, sizes for these partitions can be omitted, like so:
storage_vol=:SWAP::CONFIG:LOGGING:DATA
If you fail to specify a size, the partition will be created at its default size. To specify a 256MB Swap partition, and a 4096MB Logging partition, the correct syntax is:
storage_vol=:256:::4096:
The following is the standard format of the storage_vol parameter:
storage_vol=256,EFI:256,Root:4096,Swap
iscsi_name
The iscsi_name parameter is used to set the iSCSI Initiator Name. The iSCSI Initiator name is expected to take the form of an iSCSI Qualified Name (IQN). This format is defined by RFC 3720, which is available at http://tools.ietf.org/html/rfc3720.
The IQN is made up of the following elements, separated by the . character:
  • The literal string iqn
  • The date that the naming authority took control of the domain in yyyy-mm format
  • The reversed domain name - demo.redhat.com becomes com.redhat.demo
  • Optionally, a storage target name as specified by the naming authority - preceded by a colon

Example 7.16. iscsi_name

The following illustrates the IQN for an iSCSI initiator attached to the demo.redhat.com domain where the domain was established in July 2011.
iscsi_name=iqn.2011-07.com.redhat.demo

7.4.4. Networking Parameters

Several networking options are available. The following parameters must be appended for the Hypervisor to automatically install:
  • Setting the IP address or DHCP.
  • Setting the hostname if the hostname is not resolved with DHCP.
  • The interface the Red Hat Enterprise Virtualization Manager network is attached to.
The following list contains descriptions and usage examples for both optional and mandatory parameters.

Networking Parameters

BOOTIF
The BOOTIF parameter is required for an automated installation.
The BOOTIF parameter specifies the network interface which the Hypervisor uses to connect to the Red Hat Enterprise Virtualization Manager.

Important

When using PXE to boot Hypervisors for installation using the IPAPPEND 2 directive causes BOOTIF=<MAC> to be automatically appended to the kernel arguments. If the IPAPPEND 2 directive is used it is not necessary to use the BOOTIF parameter.
The BOOTIF parameter takes arguments in one of three forms:
link
Indicates to use the first interface (as enumerated by the kernel) with an active link. This is useful for systems with multiple network interface controllers but only one plugged in.
eth#
Indicates to use the NIC as determined by the kernel driver initialization order (where # is the number of the NIC). To determine the number boot the Hypervisor and select Shell from the Hypervisor Configuration Menu. Use ifconfig | grep eth* to list the network interfaces attached to the system. There is no guarantee that on the next reboot the network interface controller will have the same eth# mapping.
BOOTIF=eth0
<MAC>
Indicates to use the MAC address explicitly defined inside the brackets.
ip
The ip parameter sets the IP address for the network interface controller defined by the BOOTIF parameter. The ip parameter accepts either an IP address (in the form 0.0.0.0) or dhcp.
ip=192.168.1.1
ip=dhcp
ipv6
The ipv6 parameter is an alias for the ip parameter. It accepts either dhcp or auto.
netmask
The netmask parameter sets the subnet mask for the IP address defined with the ip parameter.
netmask=255.255.255.0
gateway
The gateway parameter sets the Internet gateway.
gateway=192.168.1.246
dns
The dns parameter sets the address of up to two DNS servers. Each DNS server address must be separated by a comma.
dns=192.168.1.243,192.168.1.244
hostname
The hostname parameter sets the hostname. The hostname must be a fully-qualified and resolvable domain name.
hostname=rhev1.example.com
ntp
The ntp parameter sets the address of one or more Network Time Protocol servers. Each NTP server address must be separated by a comma.
ntp=192.168.2.253,192.168.2.254
vlan
The vlan parameter sets the VLAN identifier for the network connected to the Red Hat Enterprise Virtualization Manager. This parameter should be set where VLANs are in use.
vlan=vlan-id:
For example:
vlan=36:
bond
The bond parameter configures a bond. Each interface name must be separated by a comma.
BOOTIF=bond01 bond=bond01:nic1,nic2

7.4.5. Red Hat Network (RHN) Parameters

These parameters are used to automatically register the hypervisor host with the Red Hat Network (RHN). At a minimum, either the rhn_activationkey or both the rhn_username and rhn_password parameters must be provided. Where registration is to occur against a satellite server, the rhn_url parameter must be provided.
rhn_type
Sets the RHN entitlement method for this machine. sam sets the entitlement method to Certificate-based RHN, which integrates the Customer Portal, content delivery network, and subscription service (subscription management). classic sets the entitlement method to RHN Classic, which uses the traditional channel entitlement model (channel access) to provides a global view of content access but does not provide insight into system-level subscription uses. The default value is sam.
rhn_username
The rhn_username parameter sets the username used to connect to RHN.
rhn_username=testuser
rhn_password
The rhn_password parameter sets the password used to connect to RHN.
rhn_password=testpassword
rhn_activationkey
The rhn_activationkey parameter sets the activation key used to connect to RHN. Activation keys are used to register systems, entitle them to an RHN service level, and subscribe them to specific channels and system groups, all in one action. If both rhn_activationkey and rhn_username are provided, the rhn_activationkey value will be used.
rhn_activationkey=7202f3b7d218cf59b764f9f6e9fa281b
rhn_org
This parameter is used only with SAM. Registers the system to SAM in the same way as --org org_name --activationkey key_value when combined with the rhn_activationkey parameter on the kernel command line.
rhn_org=org_name
rhn_url
The rhn_url parameter sets the URL of the satellite server used to register the host.
rhn_url=https://satellite.example.com
rhn_ca_cert
The rhn_ca_cert parameter sets the URL of the CA certificate used to connect to the satellite server. If it is not provided, the default value is rhn_url/pub/RHN-ORG-TRUSTED-SSL-CERT.
rhn_ca_cert=https://satellite.example.com/pub/RHN-ORG-TRUSTED-SSL-CERT
rhn_profile
The rhn_profile parameter sets the name of the profile to be registered with RHN for this host. The default value is the system hostname.
rhn_profile=testhost

7.4.6. Authentication Parameters

adminpw
The adminpw parameter is used to set the password for the admin user. The value provided must already be hashed. All hashing schemes supported by the shadow password mechanism are supported. The recommended way to hash a password for use with this parameter is to run the following command:
# openssl passwd -1
The openssl command will prompt for the password to use. A hashed representation of the password will be returned which can be used as the adminpw value.
rootpw
The rootpw parameter is used to set a temporary root password. A password change is forced the first time root logs on to the system. The value provided must already be hashed. All hashing schemes supported by the shadow password mechanism are supported. The recommended way to hash a password for use with this parameter is to run the following command:
# openssl passwd -1
The openssl command will prompt for the password to use. A hashed representation of the password will be returned which can be used as the rootpw value.

Important

The root password is not set by default and is not supported unless enabled at the request of Red Hat support.
rhevm_admin_password
The rhevm_admin_password parameter sets a root password and enables SSH password authentication. The value provided must already be hashed. All hashing schemes supported by the shadow password mechanism are supported. The recommended way to hash a password for use with this parameter is to run the following command:
# openssl passwd -1
The openssl command will prompt for the password to use. A hashed representation of the password will be returned which can be used as the rhevm_admin_password value.

Important

Setting this parameter has the side-effect of enabling SSH password authentication, which is unsupported unless enabled at the request of Red Hat support. We recommend disabling SSH password authentication after initial configuration is complete.
ssh_pwauth
The ssh_pwauth parameter is used to select whether or not password authentication is enabled for SSH connections. Possible values are 0 (disabled) and 1 (enabled). The default value is 0.
ssh_pwauth=1

Important

SSH password authentication is disabled by default and is not supported unless enabled at the request of Red Hat support.

7.4.7. Other Parameters

firstboot
The firstboot parameter indicates that the system should be treated as if there is no existing installation.
The reinstall parameter is a direct alias of the firstboot parameter, and can be used interchangeably with firstboot.

Warning

Using the firstboot parameter erases existing data if a disk on the system has a Volume Group named HostVG. Combining the firstboot parameter with the storage_init parameter also erases data on any disks specified with storage_init.
install
The install parameter indicates that the system should be treated as if there is no existing installation. The install parameter is intended to be used when booting from CD-ROM, DVD, USB, or PXE media.
cim_enabled
Enables the use of Common Information Model (CIM) management infrastructure.
cim_passwd
Configures a password for your Common Information Model (CIM) management infrastructure.
disable_aes_ni
Disables the AES-NI encryption instruction set. Possible values are y or n.
kdump_nfs
This parameter configures an NFS server for kdump. The syntax for this parameter is kdump_nfs=hostname:nfs_share_path, for example, kdump_nfs=nfshost.redhat.com:/path/to/nfs/share.
local_boot
The local_boot parameter is an alias for the upgrade parameter.
local_boot_trigger
Sets a target URL to check and disables PXE when installation completes successfully, so that the system boots from disk on subsequent boots.
netconsole
The netconsole parameter sets the address of a server to which kernel messages should be logged. The netconsole parameter takes an IP address or fully qualified domain name and, optionally, a port (the default port is 6666).
netconsole=rhev.example.com:6666
nfsv4_domain
The nfsv4_domain parameter specifies a domain to use for NFSv4.
nocheck
The nocheck parameter will skip the MD5 check of the installation ISO, which might be time consuming if the media is remote or slow.
management_server
The management_server parameter sets the address of the Red Hat Enterprise Virtualization Manager. The management_server parameter takes an IP address or fully qualified domain name and, optionally, a port (the default port is 443).
management_server=rhev.example.com:443
mem_overcommit
The mem_overcommit parameter specifies the multiplier to use for adding extra swap to support memory over-commit. The default over-commit value is 0.5.
mem_overcommit=0.7
qemu_pxe
The qemu_pxe parameter is used to select which network boot loader is used in virtual machines. Possible values are gpxe and etherboot. .
qemu_pxe=gpxe
reinstall
The reinstall parameter indicates that the system should be treated as if there is no existing installation.
The firstboot parameter is a direct alias of the reinstall parameter, and can be used interchangeably with reinstall.

Warning

Using the reinstall parameter erases existing data if a disk on the system has a Volume Group named HostVG. Combining the reinstall parameter with the storage_init parameter also erases data on any disks specified with storage_init.
snmp_password
Enables and configures a password for the Simple Network Management Protocol.
syslog
Configures an rsyslog server at the address specified. You can also specify a port. The syntax is syslog=hostname[:port].
upgrade
The upgrade parameter will upgrade the existing hypervisor image to the version provided by the boot media. The hypervisor will be automatically upgraded and rebooted once complete. If a hypervisor image is not yet installed, the image will be installed to the device selected with the storage_init parameter. When performing an upgrade, the previous boot entry is saved as BACKUP in grub.conf. If the reboot following the upgrade procedure fails, the BACKUP boot entry will be automatically selected as the new default.
uninstall
The uninstall parameter removes an existing Red Hat Enterprise Virtualization installation. The host volume group will be removed and the system rebooted.

7.4.8. An Automated Hypervisor Installation Example

This example uses the kernel command line parameters for an automated Hypervisor installation.

Important

This example may not work accurately on all systems. The parameter descriptions above should be reviewed and the example modified as appropriate for the systems on which deployment is to occur.
The following is a typical example for installing a Hypervisor with the kernel command line parameters.
In this example, the Manager is located at the hostname: rhevm.example.com, and the netconsole server is located on the same machine.
:linux storage_init=/dev/sda storage_vol=::::: local_boot BOOTIF=eth0 management_server=rhevm.example.com netconsole=rhevm.example.com

Note

The kernel parameters can be automatically appended to guests booting over a network with PXE. Automatically installing from PXE is not covered by this guide.