Ce contenu n'est pas disponible dans la langue sélectionnée.
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.
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:
-
Copy the relevant sections for each operating system from
/usr/share/ovirt-engine/conf/osinfo-defaults.properties
to a new file and save as99-defaults.properties
. In
99-defaults.properties
, specify the Windows product activation key and the path of your new customsysprep
file:os.operating_system.productKey.value=Windows_product_activation_key … os.operating_system.sysprepPath.value = ${ENGINE_USR}/conf/sysprep/sysprep.operating_system
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
-
Click
. - Click New.
- Select a Cluster from the drop-down list.
- Select a Template and version from the drop-down menu. A template provides standard settings for all the virtual machines in the pool.
- Select an Operating System from the drop-down list.
Use Optimized for to optimize virtual machines for Desktop or Server.
NoteHigh 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.
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
- Enter the Number of VMs for the pool.
- Enter the number of virtual machines to be prestarted in the Prestarted field.
- Select the Maximum number of VMs per user that a single user is allowed to run in a session. The minimum is 1.
- Select the Delete Protection check box to enable delete protection.
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 customsysprep
file for a pool of Windows virtual machines:- Click the Show Advanced Options button.
- Click the Initial Run tab and select the Use Cloud-Init/Sysprep check box.
Click the Authentication arrow and enter the User Name and Password or select Use already configured password.
NoteThis
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 customsysprep
file.-
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. 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’sPassword
, and the domain administrator’sUsername
:<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>
NoteThe
Domain
,Password
, andUsername
are required to join the domain. TheKey
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
andName
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.
Optional. Set a Pool Type:
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.
- 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.
- Click .
Optional. Override the SPICE proxy:
- In the Console tab, select the Override SPICE Proxy check box.
- In the Overridden SPICE proxy address text field, specify the address of a SPICE proxy to override the global SPICE proxy.
- Click .
For a pool of Windows virtual machines, click
, select each virtual machine from the pool, and click . NoteIf 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:-
Check that the Windows virtual machine has an attached secondary CD-ROM device with the unattend file, for example,
A:\Unattend.xml
. -
Select the virtual machine and click
. - Under Boot Options, check Attach Windows guest tools CD.
-
Click Start, click Run, type
regedit
in the Open text box, and click OK. -
In the left pane, go to
. -
Right-click the right pane and select
. - Enter UnattendFile as the key name.
-
Double-click the new key and enter the
unattend
file name and path, for example, A:\Unattend.xml, as the key’s value. - Save the registry, seal the Windows virtual machine, and create a new template. See Templates in the Virtual Machine Management Guide for details.
-
Check that the Windows virtual machine has an attached secondary CD-ROM device with the unattend file, for example,
You have created and configured a virtual machine pool with the specified number of identical virtual machines. You can view these virtual machines in
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.
Field Name | Description |
---|---|
Template |
The template and template sub-version on which the virtual machine pool is based. If you create a pool based on the |
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 |
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 |
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 |
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.
Field Name | Description |
---|---|
Pool Type | This drop-down menu allows you to specify the type of the virtual machine pool. The following options are available:
|
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.
Field Name | Description |
---|---|
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.
Field Name | Sub-element | Description |
---|---|---|
Start Running On | Defines the preferred host on which the virtual machine is to run. Select either:
| |
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.
|
Migration policy | Defines the migration convergence policy. If the check box is left unselected, the host determines the policy.
| |
Enable migration encryption | Allows the virtual machine to be encrypted during migration.
| |
Parallel Migrations | Allows you to specify whether and how many parallel migration connections to use.
| |
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.
Field Name | Sub-element | Description |
---|---|---|
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.
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
-
Click
and select a virtual machine pool. - Click Edit.
- Edit the properties of the virtual machine pool.
- 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
-
Click
and select the virtual machine pool. - Click Edit.
- Enter the number of virtual machines to be prestarted in the Prestarted VMs field.
- Click the Type tab. Ensure Pool Type is set to Automatic.
- Click .
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
-
Click
and select the virtual machine pool. - Click Edit.
- Enter the number of additional virtual machines in the Increase number of VMs in pool by field.
- Click .
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
-
Click
. - Click the pool’s name. This opens the details view.
- Click the Virtual Machines tab to list the virtual machines in the pool.
-
Ensure the virtual machine has a status of
Down
; you cannot detach a running virtual machine. - Select one or more virtual machines and click Detach.
- Click .
The virtual machine still exists in the environment and can be viewed and accessed from
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
-
Click
and select the virtual machine pool. - Click Remove.
- Click .