mnecas.ovirt.ovirt_cluster (1.5.5) — module

Module to manage clusters in oVirt/RHV

| "added in version" 1.0.0 of mnecas.ovirt"

Authors: Ondra Machacek (@machacekondra), Martin Necas (@mnecas)

Install collection

Install with ansible-galaxy collection install mnecas.ovirt:==1.5.5


Add to requirements.yml

  collections:
    - name: mnecas.ovirt
      version: 1.5.5

Description

Module to manage clusters in oVirt/RHV


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Examples don't contain auth parameter for simplicity,
# look at ovirt_auth module to see how to reuse authentication:

# Create cluster
- mnecas.ovirt.ovirt_cluster:
    data_center: mydatacenter
    name: mycluster
    cpu_type: Intel SandyBridge Family
    description: mycluster
    compatibility_version: 4.0
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create virt service cluster:
- mnecas.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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create cluster with default network provider
- mnecas.ovirt.ovirt_cluster:
    name: mycluster
    data_center: Default
    cpu_type: Intel SandyBridge Family
    external_network_providers:
      - name: ovirt-provider-ovn
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Remove cluster
- mnecas.ovirt.ovirt_cluster:
    state: absent
    name: mycluster
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Change cluster Name
- mnecas.ovirt.ovirt_cluster:
    id: 00000000-0000-0000-0000-000000000000
    name: "new_cluster_name"

Inputs

    
id:
    description:
    - ID of the cluster to manage.
    type: str

ksm:
    description:
    - I I(True) MoM enables to run Kernel Same-page Merging I(KSM) when necessary and
      when it can yield a memory saving benefit that outweighs its CPU cost.
    type: bool

auth:
    description:
    - 'Dictionary with values needed to create HTTP/HTTPS connection to oVirt:'
    required: true
    suboptions:
      ca_file:
        description:
        - A PEM file containing the trusted CA certificates.
        - The certificate presented by the server will be verified using these CA certificates.
        - If C(ca_file) parameter is not set, system wide CA certificate store is used.
        - Default value is set by C(OVIRT_CAFILE) environment variable.
        type: str
      compress:
        default: true
        description: Flag indicating if compression is used for connection.
        type: bool
      headers:
        description:
        - Dictionary of HTTP headers to be added to each API call.
        type: dict
      hostname:
        description:
        - A string containing the hostname of the server, usually something like `I(server.example.com)`.
        - Default value is set by C(OVIRT_HOSTNAME) environment variable.
        - Either C(url) or C(hostname) is required.
        type: str
      insecure:
        default: false
        description:
        - A boolean flag that indicates if the server TLS certificate and host name should
          be checked.
        type: bool
      kerberos:
        description:
        - A boolean flag indicating if Kerberos authentication should be used instead
          of the default basic authentication.
        type: bool
      password:
        description:
        - The password of the user.
        - Default value is set by C(OVIRT_PASSWORD) environment variable.
        required: true
        type: str
      timeout:
        description: Number of seconds to wait for response.
        type: int
      token:
        description:
        - Token to be used instead of login with username/password.
        - Default value is set by C(OVIRT_TOKEN) environment variable.
        type: str
      url:
        description:
        - A string containing the API URL of the server, usually something like `I(https://server.example.com/ovirt-engine/api)`.
        - Default value is set by C(OVIRT_URL) environment variable.
        - Either C(url) or C(hostname) is required.
        type: str
      username:
        description:
        - The name of the user, something like I(admin@internal).
        - Default value is set by C(OVIRT_USERNAME) environment variable.
        required: true
        type: str
    type: dict

name:
    description:
    - Name of the cluster to manage.
    required: true
    type: str

virt:
    description:
    - If I(True), hosts in this cluster will be used to run virtual machines.
    type: bool

wait:
    default: true
    description:
    - C(yes) if the module should wait for the entity to get into desired state.
    type: bool

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Should the cluster be present or absent.
    type: str

comment:
    description:
    - Comment of the cluster.
    type: str

gluster:
    description:
    - If I(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.
    type: bool

network:
    description:
    - Management network of cluster to access cluster hosts.
    type: str

timeout:
    default: 180
    description:
    - The amount of time in seconds the module should wait for the instance to get into
      desired state.
    type: int

cpu_arch:
    choices:
    - x86_64
    - ppc64
    - undefined
    description:
    - CPU architecture of cluster.
    type: str

cpu_type:
    description:
    - CPU codename. For example I(Intel SandyBridge Family).
    type: str

ksm_numa:
    description:
    - If I(True) enables KSM C(ksm) for best performance inside NUMA nodes.
    type: bool

mac_pool:
    description:
    - MAC pool to be used by this cluster.
    - C(Note:)
    - This is supported since oVirt version 4.1.
    type: str

vm_reason:
    description:
    - If I(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.
    type: bool

ballooning:
    aliases:
    - balloon
    description:
    - If I(True) enable memory balloon optimization. Memory balloon is used to re-distribute
      / reclaim the host memory based on VM needs in a dynamic way.
    type: bool

data_center:
    description:
    - Datacenter name where cluster reside.
    type: str

description:
    description:
    - Description of the cluster.
    type: str

host_reason:
    description:
    - If I(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.
    type: bool

rng_sources:
    description:
    - List that specify the random number generator devices that all hosts in the cluster
      will use.
    - 'Supported generators are: I(hwrng) and I(random).'
    elements: str
    type: list

spice_proxy:
    description:
    - The proxy by which the SPICE client will connect to virtual machines.
    - 'The address must be in the following format: I(protocol://[host]:[port])'
    type: str

switch_type:
    choices:
    - legacy
    - ovs
    description:
    - Type of switch to be used by all networks in given cluster. Either I(legacy) which
      is using linux bridge or I(ovs) using Open vSwitch.
    type: str

fetch_nested:
    default: false
    description:
    - If I(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 C(nested_attributes).
    type: bool

fence_enabled:
    description:
    - If I(True) enables fencing on the cluster.
    - Fencing is enabled by default.
    type: bool

firewall_type:
    choices:
    - firewalld
    - iptables
    description:
    - The type of firewall to be used on hosts in this cluster.
    - Up to version 4.1, it was always I(iptables). Since version 4.2, you can choose
      between I(iptables) and I(firewalld). For clusters with a compatibility version
      of 4.2 and higher, the default firewall type is I(firewalld).
    type: str

memory_policy:
    aliases:
    - performance_preset
    choices:
    - disabled
    - server
    - desktop
    description:
    - I(disabled) - Disables memory page sharing.
    - I(server) - Sets the memory page sharing threshold to 150% of the system memory
      on each host.
    - I(desktop) - Sets the memory page sharing threshold to 200% of the system memory
      on each host.
    type: str

poll_interval:
    default: 3
    description:
    - Number of the seconds the module waits until another poll request on entity status
      is sent.
    type: int

serial_policy:
    choices:
    - vm
    - host
    - custom
    description:
    - Specify a serial number policy for the virtual machines in the cluster.
    - 'Following options are supported:'
    - C(vm) - Sets the virtual machine's UUID as its serial number.
    - C(host) - Sets the host's UUID as the virtual machine's serial number.
    - C(custom) - Allows you to specify a custom serial number in C(serial_policy_value).
    type: str

ha_reservation:
    description:
    - If I(True) enables the oVirt/RHV to monitor cluster capacity for highly available
      virtual machines.
    type: bool

trusted_service:
    description:
    - If I(True) enables integration with an OpenAttestation server.
    type: bool

migration_policy:
    choices:
    - legacy
    - minimal_downtime
    - suspend_workload
    - post_copy
    description:
    - A migration policy defines the conditions for live migrating virtual machines in
      the event of host failure.
    - 'Following policies are supported:'
    - C(legacy) - Legacy behavior of 3.6 version.
    - C(minimal_downtime) - Virtual machines should not experience any significant downtime.
    - C(suspend_workload) - Virtual machines may experience a more significant downtime.
    - C(post_copy) - Virtual machines should not experience any significant downtime.
      If the VM migration is not converging for a long time, the migration will be switched
      to post-copy. Added in version I(2.4).
    type: str

threads_as_cores:
    description:
    - If I(True) the exposed host threads would be treated as cores which can be utilized
      by virtual machines.
    type: bool

nested_attributes:
    description:
    - Specifies list of the attributes which should be fetched from the API.
    - This parameter apply only when C(fetch_nested) is I(true).
    elements: str
    type: list

resilience_policy:
    choices:
    - do_not_migrate
    - migrate
    - migrate_highly_available
    description:
    - The resilience policy defines how the virtual machines are prioritized in the migration.
    - 'Following values are supported:'
    - 'C(do_not_migrate) -  Prevents virtual machines from being migrated. '
    - C(migrate) - Migrates all virtual machines in order of their defined priority.
    - C(migrate_highly_available) - Migrates only highly available virtual machines to
      prevent overloading other hosts.
    type: str

scheduling_policy:
    description:
    - Name of the scheduling policy to be used for cluster.
    type: str

migration_bandwidth:
    choices:
    - auto
    - hypervisor_default
    - custom
    description:
    - The bandwidth settings define the maximum bandwidth of both outgoing and incoming
      migrations per host.
    - 'Following bandwidth options are supported:'
    - C(auto) - Bandwidth is copied from the I(rate limit) [Mbps] setting in the data
      center host network QoS.
    - C(hypervisor_default) - Bandwidth is controlled by local VDSM setting on sending
      host.
    - C(custom) - Defined by user (in Mbps).
    type: str

migration_encrypted:
    choices:
    - 'true'
    - 'false'
    - inherit
    description:
    - If I(True) encryption is used during live migration of the virtual machine.
    - 'Following options are supported:'
    - C(true) - Override the global setting to I(true).
    - C(false) - Override the global setting to I(false).
    - C(inherit) - Use value which is set globally.
    type: str

serial_policy_value:
    description:
    - Allows you to specify a custom serial number.
    - This parameter is used only when C(serial_policy) is I(custom).
    type: str

migration_compressed:
    choices:
    - 'true'
    - 'false'
    - inherit
    description:
    - If I(True) compression is used during live migration of the virtual machine.
    - Used only when C(migration_policy) is set to I(legacy).
    - 'Following options are supported:'
    - C(true) - Override the global setting to I(true).
    - C(false) - Override the global setting to I(false).
    - C(inherit) - Use value which is set globally.
    type: str

compatibility_version:
    description:
    - The compatibility version of the cluster. All hosts in this cluster must support
      at least this compatibility version.
    type: str

gluster_tuned_profile:
    description:
    - The name of the U(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 I(virtual-host), I(rhgs-sequential-io), I(rhgs-random-io)
    type: str

fence_skip_if_sd_active:
    description:
    - If I(True) any hosts in the cluster that are Non Responsive and still connected
      to storage will not be fenced.
    type: bool

migration_auto_converge:
    choices:
    - 'true'
    - 'false'
    - inherit
    description:
    - If I(True) auto-convergence is used during live migration of virtual machines.
    - Used only when C(migration_policy) is set to I(legacy).
    - 'Following options are supported:'
    - C(true) - Override the global setting to I(true).
    - C(false) - Override the global setting to I(false).
    - C(inherit) - Use value which is set globally.
    type: str

migration_bandwidth_limit:
    description:
    - Set the I(custom) migration bandwidth limit.
    - This parameter is used only when C(migration_bandwidth) is I(custom).
    type: int

external_network_providers:
    description:
    - 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.
    elements: dict
    suboptions:
      id:
        description:
        - ID of the external network provider. Either C(name) or C(id) is required.
      name:
        description:
        - Name of the external network provider. Either C(name) or C(id) is required.
    type: list

fence_connectivity_threshold:
    description:
    - The threshold used by C(fence_skip_if_connectivity_broken).
    type: int

scheduling_policy_properties:
    description:
    - Custom scheduling policy properties of the cluster.
    - These optional properties override the properties of the scheduling policy specified
      by the C(scheduling_policy) parameter.
    elements: dict
    suboptions:
      name:
        description:
        - Name of the scheduling policy property.
      value:
        description:
        - Value of scheduling policy property.
    type: list

fence_skip_if_gluster_bricks_up:
    description:
    - 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`.
    type: bool

fence_skip_if_connectivity_broken:
    description:
    - If I(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 C(fence_connectivity_threshold).
    type: bool

fence_skip_if_gluster_quorum_not_met:
    description:
    - 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`.
    type: bool

Outputs

cluster:
  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.
  type: dict
id:
  description: ID of the cluster which is managed
  returned: On success if cluster is found.
  sample: 7de90f31-222c-436c-a1ca-7e655bd5b60c
  type: str