ovirt.ovirt.ovirt_cluster – Module to manage clusters in oVirt/RHV
Note
This plugin is part of the ovirt.ovirt collection (version 1.6.6).
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
.
To use it in a playbook, specify: ovirt.ovirt.ovirt_cluster
.
New in version 1.0.0: of ovirt.ovirt
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 :emphasis:`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 :emphasis:`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 enable memory balloon optimization. Memory balloon is used to re-distribute / reclaim the host memory based on VM needs in a dynamic way. Choices:
|
|
Comment of the cluster. |
|
The compatibility version of the cluster. All hosts in this cluster must support at least this compatibility version. |
|
CPU architecture of cluster. Choices:
|
|
CPU codename. For example Intel SandyBridge Family. |
|
Datacenter name where cluster reside. |
|
Description of the cluster. |
|
List of references to the external network providers available in the cluster. If the automatic deployment of the external network provider is supported, the networks of the referenced network provider are available on every host in the cluster. This is supported since oVirt version 4.2. |
|
ID of the external network provider. Either |
|
Name of the external network provider. Either |
|
The threshold used by |
|
If True enables fencing on the cluster. Fencing is enabled by default. Choices:
|
|
If True fencing will be temporarily disabled if the percentage of hosts in the cluster that are experiencing connectivity issues is greater than or equal to the defined threshold. The threshold can be specified by Choices:
|
|
A flag indicating if fencing should be skipped if Gluster bricks are up and running in the host being fenced. This flag is optional, and the default value is false. Choices:
|
|
A flag indicating if fencing should be skipped if Gluster bricks are up and running and Gluster quorum will not be met without those bricks. This flag is optional, and the default value is false. Choices:
|
|
If True any hosts in the cluster that are Non Responsive and still connected to storage will not be fenced. Choices:
|
|
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:
|
|
The type of firewall to be used on hosts in this cluster. Up to version 4.1, it was always iptables. Since version 4.2, you can choose between iptables and firewalld. For clusters with a compatibility version of 4.2 and higher, the default firewall type is firewalld. Choices:
|
|
If True, hosts in this cluster will be used as Gluster Storage server nodes, and not for running virtual machines. By default the cluster is created for virtual machine hosts. Choices:
|
|
The name of the https://fedorahosted.org/tuned to set on all the hosts in the cluster. This is not mandatory and relevant only for clusters with Gluster service. Could be for example virtual-host, rhgs-sequential-io, rhgs-random-io |
|
If True enables the oVirt/RHV to monitor cluster capacity for highly available virtual machines. Choices:
|
|
If True enables an optional reason field when a host is placed into maintenance mode from the Manager, allowing the administrator to provide an explanation for the maintenance. Choices:
|
|
ID of the cluster to manage. |
|
I True MoM enables to run Kernel Same-page Merging KSM when necessary and when it can yield a memory saving benefit that outweighs its CPU cost. Choices:
|
|
If True enables KSM Choices:
|
|
MAC pool to be used by this cluster.
This is supported since oVirt version 4.1. |
|
disabled - Disables memory page sharing. server - Sets the memory page sharing threshold to 150% of the system memory on each host. desktop - Sets the memory page sharing threshold to 200% of the system memory on each host. Choices:
|
|
If True auto-convergence is used during live migration of virtual machines. Used only when Following options are supported:
Choices:
|
|
The bandwidth settings define the maximum bandwidth of both outgoing and incoming migrations per host. Following bandwidth options are supported:
Choices:
|
|
Set the custom migration bandwidth limit. This parameter is used only when |
|
If True compression is used during live migration of the virtual machine. Used only when Following options are supported:
Choices:
|
|
If True encryption is used during live migration of the virtual machine. Following options are supported:
Choices:
|
|
A migration policy defines the conditions for live migrating virtual machines in the event of host failure. Following policies are supported:
Choices:
|
|
Name of the cluster to manage. |
|
Specifies list of the attributes which should be fetched from the API. This parameter apply only when |
|
Management network of cluster to access cluster hosts. |
|
Number of the seconds the module waits until another poll request on entity status is sent. Default: 3 |
|
The resilience policy defines how the virtual machines are prioritized in the migration. Following values are supported:
Choices:
|
|
List that specify the random number generator devices that all hosts in the cluster will use. Supported generators are: hwrng and random. |
|
Name of the scheduling policy to be used for cluster. |
|
Custom scheduling policy properties of the cluster. These optional properties override the properties of the scheduling policy specified by the |
|
Name of the scheduling policy property. |
|
Value of scheduling policy property. |
|
Specify a serial number policy for the virtual machines in the cluster. Following options are supported:
Choices:
|
|
Allows you to specify a custom serial number. This parameter is used only when |
|
The proxy by which the SPICE client will connect to virtual machines. The address must be in the following format: protocol://[host]:[port] |
|
Should the cluster be present or absent. Choices:
|
|
Type of switch to be used by all networks in given cluster. Either legacy which is using linux bridge or ovs using Open vSwitch. Choices:
|
|
If True the exposed host threads would be treated as cores which can be utilized by virtual machines. Choices:
|
|
The amount of time in seconds the module should wait for the instance to get into desired state. Default: 180 |
|
If True enables integration with an OpenAttestation server. Choices:
|
|
If True, hosts in this cluster will be used to run virtual machines. Choices:
|
|
If True enables an optional reason field when a virtual machine is shut down from the Manager, allowing the administrator to provide an explanation for the maintenance. Choices:
|
|
Choices:
|
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 cluster
- ovirt.ovirt.ovirt_cluster:
data_center: mydatacenter
name: mycluster
cpu_type: Intel SandyBridge Family
description: mycluster
compatibility_version: 4.0
# Create virt service cluster:
- ovirt.ovirt.ovirt_cluster:
data_center: mydatacenter
name: mycluster
cpu_type: Intel Nehalem Family
description: mycluster
switch_type: legacy
compatibility_version: 4.0
ballooning: true
gluster: false
threads_as_cores: true
ha_reservation: true
trusted_service: false
host_reason: false
vm_reason: true
ksm_numa: true
memory_policy: server
rng_sources:
- hwrng
- random
# Create cluster with default network provider
- ovirt.ovirt.ovirt_cluster:
name: mycluster
data_center: Default
cpu_type: Intel SandyBridge Family
external_network_providers:
- name: ovirt-provider-ovn
# Remove cluster
- ovirt.ovirt.ovirt_cluster:
state: absent
name: mycluster
# Change cluster Name
- ovirt.ovirt.ovirt_cluster:
id: 00000000-0000-0000-0000-000000000000
name: "new_cluster_name"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Dictionary of all the cluster attributes. Cluster attributes can be found on your oVirt/RHV instance at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/cluster. Returned: On success if cluster is found. |
|
ID of the cluster which is managed Returned: On success if cluster is found. Sample: “7de90f31-222c-436c-a1ca-7e655bd5b60c” |
Authors
Ondra Machacek (@machacekondra)
Martin Necas (@mnecas)