10.6. Configuring Virtual Machines

10.6.1. Completing the Configuration of a Virtual Machine by Defining Network Interfaces and Hard Disks

Summary
Before you can use your newly created virtual machine, the Guide Me window prompts you to configure at least one network interface and one virtual disk for the virtual machine.

Procedure 10.4. Completing the Configuration of a Virtual Machine by Defining Network Interfaces and Hard Disks

  1. On the New Virtual Machine - Guide Me window, click the Configure Network Interfaces button to open the New Network Interface window. You can accept the default values or change them as necessary.
    New Network Interface window

    Figure 10.2. New Network Interface window

    Enter the Name of the network interface.
  2. Use the drop-down menus to select the Network and the Type of network interface for the new virtual machine. The Link State is set to Up by default when the NIC is defined on the virtual machine and connected to the network.

    Note

    The options on the Network and Type fields are populated by the networks available to the cluster, and the NICs available to the virtual machine.
  3. If applicable, select the Specify custom MAC address check box and enter the network interface's MAC address.
  4. Click the arrow next to Advanced Parameters to configure the Port Mirroring and Card Status fields, if necessary.
  5. Click OK to close the New Network Interface window and open the New Virtual Machine - Guide Me window.
  6. Click the Configure Virtual Disk button to open the Add Virtual Disk window.
  7. Add either an Internal virtual disk or an External LUN to the virtual machine.
    Add Virtual Disk Window

    Figure 10.3. Add Virtual Disk Window

  8. Click OK to close the Add Virtual Disk window. The New Virtual Machine - Guide Me window opens with changed context. There is no further mandatory configuration.
  9. Click Configure Later to close the window.
Result
You have added a network interface and a virtual disk to your virtual machine.

10.6.2. Installing Windows on VirtIO-Optimized Hardware

Summary
The virtio-win.vfd diskette image contains Windows drivers for VirtIO-optimized disk and network devices. These drivers provide a performance improvement over emulated device drivers.
The virtio-win.vfd is placed automatically on ISO storage domains that are hosted on the Manager server. It must be manually uploaded using the engine-iso-uploader tool to other ISO storage domains.
You can install the VirtIO-optimized device drivers during your Windows installation by attaching a diskette to your virtual machine.
This procedure presumes that you added a Red Hat VirtIO network interface and a disk that uses the VirtIO interface to your virtual machine.

Procedure 10.5. Installing VirtIO Drivers during Windows Installation

  1. Click the Virtual Machines tab and select a virtual machine.
  2. Click the Run Once button, and the Run Once window displays.
  3. Click Boot Options to expand the Boot Options configuration options.
  4. Click the Attach Floppy check box, and select virtio-win.vfd from the drop down selection box.
  5. Click the Attach CD check box, and select from the drop down selection box the ISO containing the version of Windows you want to install.
  6. Move CD-ROM UP in the Boot Sequence field.
  7. Configure the rest of your Run Once options as required, and click OK to start your virtual machine, and then click the Console button to open a graphical console to your virtual machine.
Result
Windows installations include an option to load additional drivers early in the installation process. Use this option to load drivers from the virtio-win.vfd diskette that was attached to your virtual machine as A:.
For each supported virtual machine architecture and Windows version, there is a folder on the disk containing optimized hardware device drivers.

10.6.3. Virtual Machine Run Once Settings Explained

The Run Once window defines one-off boot options for a virtual machine. For persistent boot options, use the Boot Options tab in the New Virtual Machine window.

Boot Options

Defines the virtual machine's boot sequence, running options, and source images for installing the operating system and required drivers.
Attach Floppy
Attaches a diskette image to the virtual machine. Use this option to install Windows drivers. The diskette image must reside in the ISO domain.
Attach CD
Attaches an ISO image to the virtual machine. Use this option to install the virtual machine's operating system and applications. The CD image must reside in the ISO domain.
Boot Sequence
Determines the order in which the boot devices are used to boot the virtual machine. Select either Hard Disk, CD-ROM or Network, and use Up and Down to move the option up or down in the list.
Run Stateless
Deletes all changes to the virtual machine upon shutdown. This option is only available if a virtual disk is attached to the virtual machine.
Start in Pause Mode
Starts then pauses the virtual machine to enable connection to the console, suitable for virtual machines in remote locations.

Linux Boot Options

The following options boot a Linux kernel directly instead of through the BIOS bootloader.
kernel path
A fully qualified path to a kernel image to boot the virtual machine. The kernel image must be stored on either the ISO domain (path name in the format of iso://path-to-image) or on the host's local storage domain (path name in the format of /data/images).
initrd path
A fully qualified path to a ramdisk image to be used with the previously specified kernel. The ramdisk image must be stored on the ISO domain (path name in the format of iso://path-to-image) or on the host's local storage domain (path name in the format of /data/images).
kernel parameters
Kernel command line parameter strings to be used with the defined kernel on boot.

Initial Run

Specifies whether to use Cloud-Init or Sysprep to initialize the virtual machine. For Linux-based virtual machines, you must select the Use Cloud-Init check box in the Initial Run tab to view the available options. For Windows-based virtual machines, you must attach the [sysprep] floppy by selecting the Attach Floppy check box in the Boot Options tab and selecting the floppy from the list. Certain options are only available on Linux-based or Windows-based virtual machines, as noted below.
VM Hostname
The host name of the virtual machine.
Domain
The Active Directory domain to which the virtual machine belongs. (Windows)
Organization Name
The name of the organization to which the virtual machine belongs. This option corresponds to the text field for setting the organization name displayed when a machine running Windows is started for the first time. (Windows)
Active Directory OU
The organizational unit in the Active Directory domain to which the virtual machine belongs. (Windows)
Configure Time Zone
The time zone for the virtual machine. Select this check box and select a time zone from the Time Zone list.
Alternate Credentials
Selecting this check box allows you to set a User Name and Password as alternative credentials. (Windows)

Admin Password

The administrative user password for the virtual machine. Click the disclosure arrow to display the settings for this option. (Windows)
Use already configured password
This check box is automatically selected after you specify an initial administrative user password. You must clear this check box to enable the Admin Password and Verify Admin Password fields and specify a new password.
Admin Password
The administrative user password for the virtual machine. Enter the password in this text field and the Verify Admin Password text field to verify the password.

Authentication

The authentication details for the virtual machine. Click the disclosure arrow to display the settings for this option. (Linux)
User Name
Creates a new user account on the virtual machine. If this field is not filled in, the default user is root.
Use already configured password
This check box is automatically selected after you specify an initial root password. You must clear this check box to enable the Password and Verify Password fields and specify a new password.
Password
The root password for the virtual machine. Enter the password in this text field and the Verify Password text field to verify the password.
SSH Authorized Keys
SSH keys to be added to the authorized keys file of the virtual machine.
Regenerate SSH Keys
Regenerates SSH keys for the virtual machine.

Custom Locale

Custom locale options for the virtual machine. Locales must be in a format such as en-US. Click the disclosure arrow to display the settings for this option. (Windows)
Input Locale
The locale for user input.
UI Language
The language used for user interface elements such as buttons and menus.
System Locale
The locale for the overall system.
User Locale
The locale for users.

Networks

Network-related settings for the virtual machine. Click the disclosure arrow to display the settings for this option. (Linux)
DNS Servers
The DNS servers to be used by the virtual machine.
DNS Search Domains
The DNS search domains to be used by the virtual machine.
Network
Configures network interfaces for the virtual machine. Select this check box and click + or - to add or remove network interfaces to or from the virtual machine. When you click +, a set of fields becomes visible that can specify whether to use DHCP, and configure an IP address, netmask, and gateway, and specify whether the network interface will start on boot.

Custom Script

Custom scripts that will be run on the virtual machine when it starts.
Custom Scripts
The scripts entered in this field are custom YAML sections that are added to those produced by the Manager, and allow you to automate tasks such as creating users and files, configuring yum repositories and running commands. For more information on the format of scripts that can be entered in this field, see the Custom Script documentation. (Linux)

Sysprep

A custom Sysprep definition.
Sysprep
The definition must be in the format of a complete unattended installation answer file. You can copy and paste the default answer files in the /usr/share/ovirt-engine/conf/sysprep/ directory on the machine on which the Red Hat Enterprise Virtualization Manager is installed and alter the fields as required. (Windows)

Host

Defines the virtual machine's host.
Any host in cluster
Allocates the virtual machine to any available host.
Specific
Specifies a user-defined host for the virtual machine.

Display Protocol

Defines the protocol to connect to virtual machines.
VNC
Can be used for Linux virtual machines. Requires a VNC client to connect to a virtual machine using VNC. Optionally, specify VNC Keyboard Layout from the drop-down list.
SPICE
Recommended protocol for Linux and Windows virtual machines. Using SPICE protocol without QXL drivers is a Tech Preview feature for Windows 8 and Server 2012 virtual machines (BZ#1217494).

Custom Properties

Additional VDSM options for running virtual machines.
sap_agent
Enables SAP monitoring on the virtual machine. Set to true or false.
sndbuf
Enter the size of the buffer for sending the virtual machine's outgoing data over the socket.
vhost
Enter the name of the virtual host on which this virtual machine should run. The name can contain any combination of letters and numbers.
viodiskcache
Caching mode for the virtio disk. writethrough writes data to the cache and the disk in parallel, writeback does not copy modifications from the cache to the disk, and none disables caching.

10.6.4. Configuring a Watchdog

10.6.4.1. Adding a Watchdog Card to a Virtual Machine

Summary
Add a watchdog card to a virtual machine.

Procedure 10.6. Adding a Watchdog Card to a Virtual Machine

  1. Click the Virtual Machines tab and select a virtual machine.
  2. Click Edit to open the Edit Virtual Machine window.
  3. Click Show Advanced Options to display all tabs and click the High Availability tab.
  4. Select the watchdog model to use from the Watchdog Model drop-down menu.
  5. Select an action from the Watchdog Action drop-down menu. This is the action that the virtual machine takes when the watchdog is triggered.
  6. Click OK.
Result
You have added a watchdog card to the virtual machine.

10.6.4.2. Installing a Watchdog

Summary
To activate a watchdog card attached to a virtual machine, you must install the watchdog package on that virtual machine and start the watchdog service.

Procedure 10.7. Installing a Watchdog

  1. Log on to the virtual machine on which the watchdog card is attached.
  2. Run the following command to install the watchdog package and dependencies:
    # yum install watchdog
  3. Edit the /etc/watchdog.conf file and uncomment the following line:
    watchdog-device = /dev/watchdog
  4. Save the changes.
  5. Run the following commands to start the watchdog service and ensure this service starts on boot:
    # service watchdog start
    # chkconfig watchdog on
Result
You have installed and started the watchdog service on a virtual machine.

10.6.4.3. Confirming Watchdog Functionality

Summary
Confirm that a watchdog card has been attached to a virtual machine and that the watchdog service is active.

Warning

This procedure is provided for testing the functionality of watchdogs only and must not be run on production machines.

Procedure 10.8. Confirming Watchdog Functionality

  1. Log on to the virtual machine on which the watchdog card is attached.
  2. Run the following command to confirm that the watchdog card has been identified by the virtual machine:
    # lspci | grep watchdog -i
  3. Run one of the following commands to confirm that the watchdog is active:
    • Run the following command to trigger a kernel panic:
      # echo c > /proc/sysrq-trigger
    • Run the following command to terminate the watchdog service:
      # kill -9 `pgrep watchdog`
Result
The watchdog timer can no longer be reset, so the watchdog counter reaches zero after a short period of time. When the watchdog counter reaches zero, the action specified in the Watchdog Action drop-down menu for that virtual machine is performed.

10.6.4.4. Parameters for Watchdogs in watchdog.conf

The following is a list of options for configuring the watchdog service available in the /etc/watchdog.conf file. To configure an option, you must ensure that option is uncommented and restart the watchdog service after saving the changes.

Note

For a more detailed explanation of options for configuring the watchdog service and using the watchdog command, see the watchdog man page.

Table 10.14. watchdog.conf variables

Variable name Default Value Remarks
ping N/A An IP address that the watchdog attempts to ping to verify whether that address is reachable. You can specify multiple IP addresses by adding additional ping lines.
interface N/A A network interface that the watchdog will monitor to verify the presence of network traffic. You can specify multiple network interfaces by adding additional interface lines.
file /var/log/messages A file on the local system that the watchdog will monitor for changes. You can specify multiple files by adding additional file lines.
change 1407 The number of watchdog intervals after which the watchdog checks for changes to files. A change line must be specified on the line directly after each file line, and applies to the file line directly above that change line.
max-load-1 24 The maximum average load that the virtual machine can sustain over a one-minute period. If this average is exceeded, then the watchdog is triggered. A value of 0 disables this feature.
max-load-5 18 The maximum average load that the virtual machine can sustain over a five-minute period. If this average is exceeded, then the watchdog is triggered. A value of 0 disables this feature. By default, the value of this variable is set to a value approximately three quarters that of max-load-1.
max-load-15 12 The maximum average load that the virtual machine can sustain over a fifteen-minute period. If this average is exceeded, then the watchdog is triggered. A value of 0 disables this feature. By default, the value of this variable is set to a value approximately one half that of max-load-1.
min-memory 1 The minimum amount of virtual memory that must remain free on the virtual machine. This value is measured in pages. A value of 0 disables this feature.
repair-binary /usr/sbin/repair The path and file name of a binary file on the local system that will be run when the watchdog is triggered. If the specified file resolves the issues preventing the watchdog from resetting the watchdog counter, then the watchdog action is not triggered.
test-binary N/A The path and file name of a binary file on the local system that the watchdog will attempt to run during each interval. A test binary allows you to specify a file for running user-defined tests.
test-timeout N/A The time limit, in seconds, for which user-defined tests can run. A value of 0 allows user-defined tests to continue for an unlimited duration.
temperature-device N/A The path to and name of a device for checking the temperature of the machine on which the watchdog service is running.
max-temperature 120 The maximum allowed temperature for the machine on which the watchdog service is running. The machine will be halted if this temperature is reached. Unit conversion is not taken into account, so you must specify a value that matches the watchdog card being used.
admin root The email address to which email notifications are sent.
interval 10 The interval, in seconds, between updates to the watchdog device. The watchdog device expects an update at least once every minute, and if there are no updates over a one-minute period, then the watchdog is triggered. This one-minute period is hard-coded into the drivers for the watchdog device, and cannot be configured.
logtick 1 When verbose logging is enabled for the watchdog service, the watchdog service periodically writes log messages to the local system. The logtick value represents the number of watchdog intervals after which a message is written.
realtime yes Specifies whether the watchdog is locked in memory. A value of yes locks the watchdog in memory so that it is not swapped out of memory, while a value of no allows the watchdog to be swapped out of memory. If the watchdog is swapped out of memory and is not swapped back in before the watchdog counter reaches zero, then the watchdog is triggered.
priority 1 The schedule priority when the value of realtime is set to yes.
pidfile /var/run/syslogd.pid The path and file name of a PID file that the watchdog monitors to see if the corresponding process is still active. If the corresponding process is not active, then the watchdog is triggered.

10.6.5. Configuring Virtual NUMA

You can configure virtual NUMA nodes on a virtual machine and pin them to physical NUMA nodes on a host. The host’s default policy is to schedule and run virtual machines on any available resources on the host. As a result, the resources backing a large virtual machine that cannot fit within a single host socket could be spread out across multiple NUMA nodes, and over time may be moved around, leading to poor and unpredictable performance. Configure and pin virtual NUMA nodes to avoid this outcome and improve performance.
Configuring virtual NUMA requires a NUMA-enabled host. To confirm whether NUMA is enabled on a host, log in to the host and run numactl --hardware. The output of this command should show at least two NUMA nodes. You can also view the host's NUMA topology by selecting the host from the Hosts tab and clicking NUMA Support. This button is only available when the selected host has at least two NUMA nodes.

Procedure 10.9. Configuring Virtual NUMA

  1. Click the Virtual Machines tab and select a virtual machine.
  2. Click Edit.
  3. Click the Host tab.
  4. Select the Specific radio button and select a host from the list. The selected host must have at least two NUMA nodes.
  5. Select Do not allow migration from the Migration Options drop-down list.
  6. Enter a number into the NUMA Node Count field to assign virtual NUMA nodes to the virtual machine.
  7. Select Strict, Preferred, or Interleave from the Tune Mode drop-down list. If the selected mode is Preferred, the NUMA Node Count must be set to 1.
  8. Click NUMA Pinning.
    The NUMA Topology Window

    Figure 10.4. The NUMA Topology Window

  9. In the NUMA Topology window, click and drag virtual NUMA nodes from the box on the right to host NUMA nodes on the left as required, and click OK.
  10. Click OK.

Note

Automatic NUMA balancing is available in Red Hat Enterprise Linux 7, but is not currently configurable through the Red Hat Enterprise Virtualization Manager.