2.7. Pools

2.7.1. Introduction to Virtual Machine Pools

A virtual machine pool is a group of virtual machines that are all clones of the same template and that can be used on demand by any user in a given group. Virtual machine pools allow administrators to rapidly configure a set of generalized virtual machines for users.

Users access a virtual machine pool by taking a virtual machine from the pool. When a user takes a virtual machine from a pool, they are provided with any one of the virtual machines in the pool if any are available. That virtual machine will have the same operating system and configuration as that of the template on which the pool was based, but users may not receive the same member of the pool each time they take a virtual machine. Users can also take multiple virtual machines from the same virtual machine pool depending on the configuration of that pool.

Virtual machine pools are stateless by default, meaning that virtual machine data and configuration changes are not persistent across reboots. However, the pool can be configured to be stateful, allowing changes made by a previous user to persist. However, if a user configures console options for a virtual machine taken from a virtual machine pool, those options will be set as the default for that user for that virtual machine pool.

Note

Virtual machines taken from a pool are not stateless when accessed from the Administration Portal. This is because administrators need to be able to write changes to the disk if necessary.

In principle, virtual machines in a pool are started when taken by a user, and shut down when the user is finished. However, virtual machine pools can also contain pre-started virtual machines. Pre-started virtual machines are kept in an up state, and remain idle until they are taken by a user. This allows users to start using such virtual machines immediately, but these virtual machines will consume system resources even while not in use due to being idle.

2.7.2. Creating a virtual machine pool

You can create a virtual machine pool containing multiple virtual machines based on a common template. See Templates in the Virtual Machine Management Guide for information about sealing a virtual machine and creating a template.

Sysprep File Configuration Options for Windows Virtual Machines

Several sysprep file configuration options are available, depending on your requirements.

If your pool does not need to join a domain, you can use the default sysprep file, located in /usr/share/ovirt-engine/conf/sysprep/.

If your pool needs to join a domain, you can create a custom sysprep for each Windows operating system:

  1. Copy the relevant sections for each operating system from /usr/share/ovirt-engine/conf/osinfo-defaults.properties to a new file and save as 99-defaults.properties.
  2. In 99-defaults.properties, specify the Windows product activation key and the path of your new custom sysprep file:

    os.operating_system.productKey.value=Windows_product_activation_key …​ os.operating_system.sysprepPath.value = ${ENGINE_USR}/conf/sysprep/sysprep.operating_system

  3. Create a new sysprep file, specifying the domain, domain password, and domain administrator:

    <Credentials>
        <Domain>__AD_Domain__</Domain>
        <Password>__Domain_Password__</Password>
        <Username>__Domain_Administrator__</Username>
    </Credentials>

If you need to configure different sysprep settings for different pools of Windows virtual machines, you can create a custom sysprep file in the Administration Portal (see Creating a Virtual Machine Pool below). See Using Sysprep to Automate the Configuration of Virtual Machines in the Virtual Machine Guide for more information.

Procedure

  1. Click ComputePools.
  2. Click New.
  3. Select a Cluster from the drop-down list.
  4. Select a Template and version from the drop-down menu. A template provides standard settings for all the virtual machines in the pool.
  5. Select an Operating System from the drop-down list.
  6. Use Optimized for to optimize virtual machines for Desktop or Server.

    Note

    High Performance optimization is not recommended for pools because a high performance virtual machine is pinned to a single host and concrete resources. A pool containing multiple virtual machines with such a configuration would not run well.

  7. Enter a Name and, optionally, a Description and Comment.

    The Name of the pool is applied to each virtual machine in the pool, with a numeric suffix. You can customize the numbering of the virtual machines with ? as a placeholder.

    Example 2.1. Pool Name and Virtual Machine Numbering Examples

    • Pool: MyPool

      Virtual machines: MyPool-1, MyPool-2, …​ MyPool-10

    • Pool: MyPool-???

      Virtual machines: MyPool-001, MyPool-002, …​ MyPool-010

  8. Enter the Number of VMs for the pool.
  9. Enter the number of virtual machines to be prestarted in the Prestarted field.
  10. Select the Maximum number of VMs per user that a single user is allowed to run in a session. The minimum is 1.
  11. Select the Delete Protection check box to enable delete protection.
  12. If you are creating a pool of non-Windows virtual machines or if you are using the default sysprep, skip this step. If you are creating a custom sysprep file for a pool of Windows virtual machines:

    1. Click the Show Advanced Options button.
    2. Click the Initial Run tab and select the Use Cloud-Init/Sysprep check box.
    3. Click the Authentication arrow and enter the User Name and Password or select Use already configured password.

      Note

      This User Name is the name of the local administrator. You can change its value from its default value (user) here in the Authentication section or in a custom sysprep file.

    4. Click the Custom Script arrow and paste the contents of the default sysprep file, located in /usr/share/ovirt-engine/conf/sysprep/, into the text box.
    5. You can modify the following values of the sysprep file:

      • Key. If you do not want to use the pre-defined Windows activation product key, replace <![CDATA[$ProductKey$]]> with a valid product key:

        <ProductKey>
            <Key><![CDATA[$ProductKey$]]></Key>
        </ProductKey>

        Example 2.2. Windows Product Key Example

        <ProductKey>
            <Key>0000-000-000-000</Key>
        </ProductKey>
      • Domain that the Windows virtual machines will join, the domain’s Password, and the domain administrator’s Username:

        <Credentials>
            <Domain>__AD_Domain__</Domain>
            <Password>__Domain_Password__</Password>
            <Username>__Domain_Administrator__</Username>
        </Credentials>

        Example 2.3. Domain Credentials Example

        <Credentials>
            <Domain>addomain.local</Domain>
            <Password>12345678</Password>
            <Username>Sarah_Smith</Username>
        </Credentials>
        Note

        The Domain, Password, and Username are required to join the domain. The Key is for activation. You do not necessarily need both.

        The domain and credentials cannot be modified in the Initial Run tab.

      • FullName of the local administrator:

        <UserData>
        ...
            <FullName>__Local_Administrator__</FullName>
        ...
        </UserData>
      • DisplayName and Name of the local administrator:

        <LocalAccounts>
            <LocalAccount wcm:action="add">
                <Password>
                    <Value><![CDATA[$AdminPassword$]]></Value>
                    <PlainText>true</PlainText>
                </Password>
                <DisplayName>__Local_Administrator__</DisplayName>
                <Group>administrators</Group>
                <Name>__Local_Administrator__</Name>
            </LocalAccount>
        </LocalAccounts>

        The remaining variables in the sysprep file can be filled in on the Initial Run tab.

  13. Optional. Set a Pool Type:

    1. Click the Type tab and select a Pool Type:

      • Manual - The administrator is responsible for explicitly returning the virtual machine to the pool.
      • Automatic - The virtual machine is automatically returned to the virtual machine pool.
    2. Select the Stateful Pool check box to ensure that virtual machines are started in a stateful mode. This ensures that changes made by a previous user will persist on a virtual machine.
    3. Click OK.
  14. Optional. Override the SPICE proxy:

    1. In the Console tab, select the Override SPICE Proxy check box.
    2. In the Overridden SPICE proxy address text field, specify the address of a SPICE proxy to override the global SPICE proxy.
    3. Click OK.
  15. For a pool of Windows virtual machines, click ComputeVirtual Machines, select each virtual machine from the pool, and click RunRun Once.

    Note

    If the virtual machine does not start and Info [windeploy.exe] Found no unattend file appears in %WINDIR%\panther\UnattendGC\setupact.log, add the UnattendFile key to the registry of the Windows virtual machine that was used to create the template for the pool:

    1. Check that the Windows virtual machine has an attached secondary CD-ROM device with the unattend file, for example, A:\Unattend.xml.
    2. Select the virtual machine and click RunRun once.
    3. Under Boot Options, check Attach Windows guest tools CD.
    4. Click Start, click Run, type regedit in the Open text box, and click OK.
    5. In the left pane, go to HKEY_LOCAL_MACHINESYSTEMSetup.
    6. Right-click the right pane and select NewString Value.
    7. Enter UnattendFile as the key name.
    8. Double-click the new key and enter the unattend file name and path, for example, A:\Unattend.xml, as the key’s value.
    9. Save the registry, seal the Windows virtual machine, and create a new template. See Templates in the Virtual Machine Management Guide for details.

You have created and configured a virtual machine pool with the specified number of identical virtual machines. You can view these virtual machines in ComputeVirtual Machines, or by clicking the name of a pool to open its details view; a virtual machine in a pool is distinguished from independent virtual machines by its icon.

2.7.3. Explanation of Settings and Controls in the New Pool and Edit Pool Windows

2.7.3.1. New Pool and Edit Pool General Settings Explained

The following table details the information required on the General tab of the New Pool and Edit Pool windows that are specific to virtual machine pools. All other settings are identical to those in the New Virtual Machine window.

Table 2.30. General settings

Field NameDescription

Template

The template and template sub-version on which the virtual machine pool is based. If you create a pool based on the latest sub-version of a template, all virtual machines in the pool, when rebooted, will automatically receive the latest template version. For more information on configuring templates for virtual machines see Virtual Machine General Settings Explained and Explanation of Settings in the New Template and Edit Template Windows in the Virtual Machine Management Guide.

Description

A meaningful description of the virtual machine pool.

Comment

A field for adding plain text human-readable comments regarding the virtual machine pool.

Prestarted VMs

Allows you to specify the number of virtual machines in the virtual machine pool that will be started before they are taken and kept in that state to be taken by users. The value of this field must be between 0 and the total number of virtual machines in the virtual machine pool.

Number of VMs/Increase number of VMs in pool by

Allows you to specify the number of virtual machines to be created and made available in the virtual machine pool. In the edit window it allows you to increase the number of virtual machines in the virtual machine pool by the specified number. By default, the maximum number of virtual machines you can create in a pool is 1000. This value can be configured using the MaxVmsInPool key of the engine-config command.

Maximum number of VMs per user

Allows you to specify the maximum number of virtual machines a single user can take from the virtual machine pool at any one time. The value of this field must be between 1 and 32,767.

Delete Protection

Allows you to prevent the virtual machines in the pool from being deleted.

Sealed

Ensures that machine-specific settings from the template are not reproduced in virtual machines that are provisioned from the template. For more information about the sealing process, see Sealing a Windows Virtual Machine for Deployment as a Template

2.7.3.2. New Pool and Edit Pool Type Settings Explained

The following table details the information required on the Type tab of the New Pool and Edit Pool windows.

Table 2.31. Type settings

Field NameDescription

Pool Type

This drop-down menu allows you to specify the type of the virtual machine pool. The following options are available:

  • Automatic: After a user finishes using a virtual machine taken from a virtual machine pool, that virtual machine is automatically returned to the virtual machine pool.
  • Manual: After a user finishes using a virtual machine taken from a virtual machine pool, that virtual machine is only returned to the virtual machine pool when an administrator manually returns the virtual machine.

Stateful Pool

Specify whether the state of virtual machines in the pool is preserved when a virtual machine is passed to a different user. This means that changes made by a previous user will persist on the virtual machine.

2.7.3.3. New Pool and Edit Pool Console Settings Explained

The following table details the information required on the Console tab of the New Pool or Edit Pool window that is specific to virtual machine pools. All other settings are identical to those in the New Virtual Machine and Edit Virtual Machine windows.

Table 2.32. Console settings

Field NameDescription

Override SPICE proxy

Select this check box to enable overriding the SPICE proxy defined in global configuration. This feature is useful in a case where the user (who is, for example, connecting via the VM Portal) is outside of the network where the hosts reside.

Overridden SPICE proxy address

The proxy by which the SPICE client connects to virtual machines. This proxy overrides both the global SPICE proxy defined for the Red Hat Virtualization environment and the SPICE proxy defined for the cluster to which the virtual machine pool belongs, if any. The address must be in the following format:

protocol://host:port

2.7.3.4. Virtual Machine Pool Host Settings Explained

The following table details the options available on the Host tab of the New Pool and Edit Pool windows.

Table 2.33. Virtual Machine Pool: Host Settings

Field NameSub-elementDescription

Start Running On

 

Defines the preferred host on which the virtual machine is to run. Select either:

  • Any Host in Cluster - The virtual machine can start and run on any available host in the cluster.
  • Specific Host(s) - The virtual machine will start running on a particular host in the cluster. However, the Manager or an administrator can migrate the virtual machine to a different host in the cluster depending on the migration and high-availability settings of the virtual machine. Select the specific host or group of hosts from the list of available hosts.

CPU options

Pass-Through Host CPU

When selected, allows virtual machines to use the host’s CPU flags. When selected, Migration Options is set to Allow manual migration only.

 

Migrate only to hosts with the same TSC frequency

When selected, this virtual machine can only be migrated to a host with the same TSC frequency. This option is only valid for High Performance virtual machines.

Migration Options

Migration mode

Defines options to run and migrate the virtual machine. If the options here are not used, the virtual machine will run or migrate according to its cluster’s policy.

  • Allow manual and automatic migration - The virtual machine can be automatically migrated from one host to another in accordance with the status of the environment, or manually by an administrator.
  • Allow manual migration only - The virtual machine can only be migrated from one host to another manually by an administrator.
  • Do not allow migration - The virtual machine cannot be migrated, either automatically or manually.
 

Migration policy

Defines the migration convergence policy. If the check box is left unselected, the host determines the policy.

  • Cluster default (Minimal downtime) - Overrides in vdsm.conf are still applied. The guest agent hook mechanism is disabled.
  • Minimal downtime - Allows the virtual machine to migrate in typical situations. Virtual machines should not experience any significant downtime. The migration will be aborted if virtual machine migration does not converge after a long time (dependent on QEMU iterations, with a maximum of 500 milliseconds). The guest agent hook mechanism is enabled.
  • Post-copy migration - When used, post-copy migration pauses the migrating virtual machine vCPUs on the source host, transfers only a minimum of memory pages, activates the virtual machine vCPUs on the destination host, and transfers the remaining memory pages while the virtual machine is running on the destination.

    The post-copy policy first tries pre-copy to verify whether convergence can occur. The migration switches to post-copy if the virtual machine migration does not converge after a long time.

    This significantly reduces the downtime of the migrated virtual machine, and also guarantees that the migration finishes regardless of how rapidly the memory pages of the source virtual machine change. It is optimal for migrating virtual machines in heavy continuous use, which would not be possible to migrate with standard pre-copy migration.

    The disadvantage of this policy is that in the post-copy phase, the virtual machine may slow down significantly as the missing parts of memory are transferred between the hosts.

    Warning

    If the network connection breaks prior to the completion of the post-copy process, the Manager pauses and then kills the running virtual machine. Do not use post-copy migration if the virtual machine availability is critical or if the migration network is unstable.

  • Suspend workload if needed - Allows the virtual machine to migrate in most situations, including when the virtual machine is running a heavy workload. Because of this, virtual machines may experience a more significant downtime than with some other settings. The migration may still be aborted for extreme workloads. The guest agent hook mechanism is enabled.
 

Enable migration encryption

Allows the virtual machine to be encrypted during migration.

  • Cluster default
  • Encrypt
  • Don’t encrypt
 

Parallel Migrations

Allows you to specify whether and how many parallel migration connections to use.

  • Cluster default: Parallel migration connections are determined by the cluster default.
  • Disabled: The virtual machine is migrated using a single, non-parallel connection.
  • Auto: The number of parallel connections is automatically determined. This settings might automatically disable parallel connections.
  • Auto Parallel: The number of parallel connections is automatically determined.
  • Custom: Allows you to specify the preferred number of parallel connections, the actual number may be lower.
 

Number of VM Migration Connections

This setting is only available when Custom is selected. The preferred number of custom parallel migrations, between 2 and 255.

Configure NUMA

NUMA Node Count

The number of virtual NUMA nodes available in a host that can be assigned to the virtual machine.

 

NUMA Pinning

Opens the NUMA Topology window. This window shows the host’s total CPUs, memory, and NUMA nodes, and the virtual machine’s virtual NUMA nodes. You can manually pin virtual NUMA nodes to host NUMA nodes by clicking and dragging each vNUMA from the box on the right to a NUMA node on the left.

You can also set Tune Mode for memory allocation:

Strict - Memory allocation will fail if the memory cannot be allocated on the target node.

Preferred - Memory is allocated from a single preferred node. If sufficient memory is not available, memory can be allocated from other nodes.

Interleave - Memory is allocated across nodes in a round-robin algorithm.

If you define NUMA pinning, Migration Options is set to Allow manual migration only.

2.7.3.5. New Pool and Edit Pool Resource Allocation Settings Explained

The following table details the information required on the Resource Allocation tab of the New Pool and Edit Pool windows that are specific to virtual machine pools. All other settings are identical to those in the New Virtual Machine window. See Virtual Machine Resource Allocation Settings Explained in the Virtual Machine Management Guide for more information.

Table 2.34. Resource Allocation settings

Field NameSub-elementDescription

Disk Allocation

Auto select target

Select this check box to automatically select the storage domain that has the most free space. The Target and Disk Profile fields are disabled.

 

Format

This field is read-only and always displays QCOW2.

2.7.3.6. Editing a Virtual Machine Pool

After a virtual machine pool has been created, its properties can be edited. The properties available when editing a virtual machine pool are identical to those available when creating a new virtual machine pool except that the Number of VMs property is replaced by Increase number of VMs in pool by.

Note

When editing a virtual machine pool, the changes introduced affect only new virtual machines. Virtual machines that existed already at the time of the introduced changes remain unaffected.

Procedure

  1. Click ComputePools and select a virtual machine pool.
  2. Click Edit.
  3. Edit the properties of the virtual machine pool.
  4. Click Ok.

2.7.3.7. Prestarting Virtual Machines in a Pool

The virtual machines in a virtual machine pool are powered down by default. When a user requests a virtual machine from a pool, a machine is powered up and assigned to the user. In contrast, a prestarted virtual machine is already running and waiting to be assigned to a user, decreasing the amount of time a user has to wait before being able to access a machine. When a prestarted virtual machine is shut down it is returned to the pool and restored to its original state. The maximum number of prestarted virtual machines is the number of virtual machines in the pool.

Prestarted virtual machines are suitable for environments in which users require immediate access to virtual machines which are not specifically assigned to them. Only automatic pools can have prestarted virtual machines.

Procedure

  1. Click ComputePools and select the virtual machine pool.
  2. Click Edit.
  3. Enter the number of virtual machines to be prestarted in the Prestarted VMs field.
  4. Click the Type tab. Ensure Pool Type is set to Automatic.
  5. Click OK.

2.7.3.8. Adding Virtual Machines to a Virtual Machine Pool

If you require more virtual machines than originally provisioned in a virtual machine pool, add more machines to the pool.

Procedure

  1. Click ComputePools and select the virtual machine pool.
  2. Click Edit.
  3. Enter the number of additional virtual machines in the Increase number of VMs in pool by field.
  4. Click OK.

2.7.3.9. Detaching Virtual Machines from a Virtual Machine Pool

You can detach virtual machines from a virtual machine pool. Detaching a virtual machine removes it from the pool to become an independent virtual machine.

Procedure

  1. Click ComputePools.
  2. Click the pool’s name. This opens the details view.
  3. Click the Virtual Machines tab to list the virtual machines in the pool.
  4. Ensure the virtual machine has a status of Down; you cannot detach a running virtual machine.
  5. Select one or more virtual machines and click Detach.
  6. Click OK.
Note

The virtual machine still exists in the environment and can be viewed and accessed from ComputeVirtual Machines. Note that the icon changes to denote that the detached virtual machine is an independent virtual machine.

2.7.3.10. Removing a Virtual Machine Pool

You can remove a virtual machine pool from a data center. You must first either delete or detach all of the virtual machines in the pool. Detaching virtual machines from the pool will preserve them as independent virtual machines.

Procedure

  1. Click ComputePools and select the virtual machine pool.
  2. Click Remove.
  3. Click OK.