ovirt.ovirt.ovirt_instance_type module – Module to manage Instance Types in oVirt/RHV
Note
This module is part of the ovirt.ovirt collection (version 3.2.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install ovirt.ovirt
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: ovirt.ovirt.ovirt_instance_type
.
New in ovirt.ovirt 1.0.0
Synopsis
This module manages whole lifecycle of the Instance Type in oVirt/RHV.
Requirements
The below requirements are needed on the host that executes this module.
python >= 2.7
ovirt-engine-sdk-python >= 4.4.0
Parameters
Parameter |
Comments |
---|---|
Dictionary with values needed to create HTTP/HTTPS connection to oVirt: |
|
A PEM file containing the trusted CA certificates. The certificate presented by the server will be verified using these CA certificates. If Default value is set by |
|
Flag indicating if compression is used for connection. Choices:
|
|
Dictionary of HTTP headers to be added to each API call. |
|
A string containing the hostname of the server, usually something like `server.example.com`. Default value is set by Either |
|
A boolean flag that indicates if the server TLS certificate and host name should be checked. Choices:
|
|
A boolean flag indicating if Kerberos authentication should be used instead of the default basic authentication. Choices:
|
|
The password of the user. Default value is set by |
|
Number of seconds to wait for response. |
|
Token to be used instead of login with username/password. Default value is set by |
|
A string containing the API URL of the server, usually something like `https://server.example.com/ovirt-engine/api`. Default value is set by Either |
|
The name of the user, something like admin@internal. Default value is set by |
|
If true, use memory ballooning. Memory balloon is a guest device, which may be used to re-distribute / reclaim the host memory based on instance type needs in a dynamic way. In this way it’s possible to create memory over commitment states. Choices:
|
|
List of boot devices which should be used to boot. For example Default value is set by oVirt/RHV engine. Choices:
|
|
Number of virtual CPUs cores of the Instance Type. Default value is set by oVirt/RHV engine. |
|
CPU mode of the instance type. It can be some of the following: host_passthrough, host_model or custom. For host_passthrough CPU type you need to set If no value is passed, default value is set by oVirt/RHV engine. |
|
CPU Pinning topology to map instance type CPU to host CPU. CPU Pinning topology is a list of dictionary which can have following values: |
|
Number of the host CPU. |
|
Number of the instance type CPU. |
|
Number of virtual CPUs sockets of the Instance Type. Default value is set by oVirt/RHV engine. |
|
Number of virtual CPUs sockets of the Instance Type. Default value is set by oVirt/RHV engine. |
|
Description of the instance type. |
|
If True the module will fetch additional data from the API. It will fetch IDs of the VMs disks, snapshots, etc. User can configure to fetch other attributes of the nested entities by specifying Choices:
|
|
Assign graphical console to the instance type. Graphical console is a dictionary which can have following values:
|
|
If yes Instance Type will be set as highly available. If no Instance Type won’t be set as highly available. If no value is passed, default value is set by oVirt/RHV engine. Choices:
|
|
Indicates the priority of the instance type inside the run and migration queues. Instance Type with higher priorities will be started and migrated before instance types with lower priorities. The value is an integer between 0 and 100. The higher the value, the higher the priority. If no value is passed, default value is set by oVirt/RHV engine. |
|
Specify host where Instance Type should be running. By default the host is chosen by engine scheduler. This parameter is used only when |
|
ID of the Instance Type to manage. |
|
Number of IO threads used by instance type. 0 means IO threading disabled. |
|
Amount of memory of the Instance Type. Prefix uses IEC 60027-2 standard (for example 1GiB, 1024MiB). Default value is set by engine. |
|
Amount of minimal guaranteed memory of the Instance Type. Prefix uses IEC 60027-2 standard (for example 1GiB, 1024MiB).
Default value is set by engine. |
|
Upper bound of instance type memory up to which memory hot-plug can be performed. Prefix uses IEC 60027-2 standard (for example 1GiB, 1024MiB). Default value is set by engine. |
|
Name of the Instance Type to manage. If instance type don’t exists |
|
Specifies list of the attributes which should be fetched from the API. This parameter apply only when |
|
List of NICs, which should be attached to Virtual Machine. NIC is described by following dictionary. NOTE - This parameter is used only when |
|
Type of the network interface. Choices:
|
|
Custom MAC address of the network interface, by default it’s obtained from MAC pool. |
|
Name of the NIC. |
|
Profile name where NIC should be attached. |
|
Operating system of the Instance Type, for example ‘rhel_8x64’. Default value is set by oVirt/RHV engine. Use the ovirt.ovirt.ovirt_vm_os_info module to obtain the current list. |
|
The configuration of the instance type’s placement policy. Placement policy can be one of the following values:
If no value is passed, default value is set by oVirt/RHV engine. |
|
Number of the seconds the module waits until another poll request on entity status is sent. Default: |
|
Number of bytes allowed to consume per period. |
|
Random number generator (RNG). You can choose of one the following devices urandom, random or hwrng. In order to select hwrng, you must have it enabled on cluster first. /dev/urandom is used for cluster version >= 4.1, and /dev/random for cluster version <= 4.0 |
|
Duration of one period in milliseconds. |
|
True enable VirtIO serial console, False to disable it. By default is chosen by oVirt/RHV engine. Choices:
|
|
If true, use smart card authentication. Choices:
|
|
If true, the sound card is added to the instance type. Choices:
|
|
Should the Instance Type be present/absent. present state will create/update instance type and don’t change its state if it already exists. Choices:
|
|
The amount of time in seconds the module should wait for the instance to get into desired state. Default: |
|
True enable USB support, False to disable it. By default is chosen by oVirt/RHV engine. Choices:
|
|
If true, virtio scsi will be enabled. Choices:
|
|
Choices:
|
|
Assign watchdog device for the instance type. Watchdogs is a dictionary which can have following values:
|
Notes
Note
In order to use this module you have to install oVirt Python SDK. To ensure it’s installed with correct version you can create the following task: pip: name=ovirt-engine-sdk-python version=4.4.0
Examples
# Examples don't contain auth parameter for simplicity,
# look at ovirt_auth module to see how to reuse authentication:
# Create instance type
- name: Create instance type
ovirt.ovirt.ovirt_instance_type:
state: present
name: myit
rng_device: hwrng
rng_bytes: 200
rng_period: 200
soundcard_enabled: true
virtio_scsi: true
boot_devices:
- network
# Remove instance type
- ovirt.ovirt.ovirt_instance_type:
state: absent
name: myit
# Create instance type with predefined memory and cpu limits.
- ovirt.ovirt.ovirt_instance_type:
state: present
name: myit
memory: 2GiB
cpu_cores: 2
cpu_sockets: 2
nics:
- name: nic1
# Enable usb support and serial console
- ovirt.ovirt.ovirt_instance_type:
name: myit
usb_support: True
serial_console: True
# Use graphical console with spice and vnc
- name: Create a instance type that has the console configured for both Spice and VNC
ovirt.ovirt.ovirt_instance_type:
name: myit
graphical_console:
protocol:
- spice
- vnc
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
ID of the instance type which is managed Returned: On success if instance type is found. Sample: |
|
Dictionary of all the instance type attributes. instance type attributes can be found on your oVirt/RHV instance at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/instance_type. Returned: On success if instance type is found. |