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.
- 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. - 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:
- One of the following parameters, depending on the type of installation or reinstallation that you wish to perform:
install
, to begin an installation (even if it detects an existing installation).reinstall
, to remove a current installation and begin a completely clean reinstall.upgrade
, to upgrade an existing installation.
- The
storage_init
parameter, to initialize a local storage device. - 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 bypxelinux
.
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 astorage_init
value ofusb
,scsi
, orata
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_6VE867X1When 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 thestorage_init
parameter. Afterstorage_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
parameterSwap
- 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 of0
.
Partitions can be specified in any order. The syntax for specifying each partition issize,type
. Each partition specified is separated by a colon (:
). To specify a 256MB Swap partition, and a 4096MB Logging partition, the whole parameter isstorage_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 thestorage_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.TheBOOTIF
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 theIPAPPEND 2
directive causesBOOTIF=<MAC>
to be automatically appended to the kernel arguments. If theIPAPPEND 2
directive is used it is not necessary to use theBOOTIF
parameter.TheBOOTIF
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. Useifconfig | 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 sameeth#
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 theBOOTIF
parameter. Theip
parameter accepts either an IP address (in the form 0.0.0.0) ordhcp
.ip=192.168.1.1
ip=dhcp
ipv6
- The
ipv6
parameter is an alias for theip
parameter. It accepts eitherdhcp
orauto
. netmask
- The
netmask
parameter sets the subnet mask for the IP address defined with theip
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 issam
. 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 bothrhn_activationkey
andrhn_username
are provided, therhn_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 therhn_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 isrhn_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 theadmin
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
Theopenssl
command will prompt for the password to use. A hashed representation of the password will be returned which can be used as theadminpw
value. rootpw
- The
rootpw
parameter is used to set a temporaryroot
password. A password change is forced the first timeroot
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
Theopenssl
command will prompt for the password to use. A hashed representation of the password will be returned which can be used as therootpw
value.Important
Theroot
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 aroot
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
Theopenssl
command will prompt for the password to use. A hashed representation of the password will be returned which can be used as therhevm_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 are0
(disabled) and1
(enabled). The default value is0
.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.Thereinstall
parameter is a direct alias of thefirstboot
parameter, and can be used interchangeably withfirstboot
.Warning
Using thefirstboot
parameter erases existing data if a disk on the system has a Volume Group namedHostVG
. Combining thefirstboot
parameter with thestorage_init
parameter also erases data on any disks specified withstorage_init
. install
- The
install
parameter indicates that the system should be treated as if there is no existing installation. Theinstall
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
orn
. 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 theupgrade
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. Thenetconsole
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. Themanagement_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 aregpxe
andetherboot
. .qemu_pxe=gpxe
reinstall
- The
reinstall
parameter indicates that the system should be treated as if there is no existing installation.Thefirstboot
parameter is a direct alias of thereinstall
parameter, and can be used interchangeably withreinstall
.Warning
Using thereinstall
parameter erases existing data if a disk on the system has a Volume Group namedHostVG
. Combining thereinstall
parameter with thestorage_init
parameter also erases data on any disks specified withstorage_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 thestorage_init
parameter. When performing an upgrade, the previous boot entry is saved as BACKUP ingrub.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.