ovirt_clusters - Module to manage clusters in oVirt

New in version 2.3.

Synopsis

Module to manage clusters in oVirt

Requirements (on host that executes module)

  • python >= 2.7
  • ovirt-engine-sdk-python >= 4.0.0

Options

parameter required default choices comments
auth
yes
    Dictionary with values needed to create HTTP/HTTPS connection to oVirt:
    username[required] - The name of the user, something like `admin@internal`.
    password[required] - The password of the user.
    url[required] - A string containing the base URL of the server, usually something like `https://server.example.com/ovirt-engine/api`.
    token - Token to be used instead of login with username/password.
    insecure - A boolean flag that indicates if the server TLS certificate and host name should be checked.
    ca_file - A PEM file containing the trusted CA certificates. The certificate presented by the server will be verified using these CA certificates. If `ca_file` parameter is not set, system wide CA certificate store is used.
    kerberos - A boolean flag indicating if Kerberos authentication should be used instead of the default basic authentication.
    ballooning
    no
      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.
      comment
      no
        Comment of the cluster.
        compatibility_version
        no
          The compatibility version of the cluster. All hosts in this cluster must support at least this compatibility version.
          cpu_arch
          no
          • x86_64
          • ppc64
          • undefined
          CPU architecture of cluster.
          cpu_type
          no
            CPU codename. For example Intel SandyBridge Family.
            datacenter
            no
              Datacenter name where cluster reside.
              description
              no
                Description of the cluster.
                fence_connectivity_threshold
                no
                  The threshold used by fence_skip_if_connectivity_broken.
                  fence_enabled
                  no
                    If (True) enables fencing on the cluster.
                    Fencing is enabled by default.
                    fence_skip_if_connectivity_broken
                    no
                      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 fence_connectivity_threshold.
                      fence_skip_if_sd_active
                      no
                        If (True) any hosts in the cluster that are Non Responsive and still connected to storage will not be fenced.
                        gluster
                        no
                          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.
                          ha_reservation
                          no
                            If (True) enable the oVirt to monitor cluster capacity for highly available virtual machines.
                            host_reason
                            no
                              If (True) enable 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.
                              ksm
                              no
                                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.
                                ksm_numa
                                no
                                  If (True) enables KSM ksm for best berformance inside NUMA nodes.
                                  memory_policy
                                  no
                                  • disabled
                                  • server
                                  • desktop
                                  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.
                                  migration_auto_converge
                                  no
                                  • true
                                  • false
                                  • inherit
                                  If (True) auto-convergence is used during live migration of virtual machines.
                                  Used only when migration_policy is set to legacy.
                                  Following options are supported:
                                  true - Override the global setting to true.
                                  false - Override the global setting to false.
                                  inherit - Use value which is set globally.
                                  migration_bandwidth
                                  no
                                  • auto
                                  • hypervisor_default
                                  • custom
                                  The bandwidth settings define the maximum bandwidth of both outgoing and incoming migrations per host.
                                  Following bandwith options are supported:
                                  auto - Bandwidth is copied from the rate limit [Mbps] setting in the data center host network QoS.
                                  hypervisor_default - Bandwidth is controlled by local VDSM setting on sending host.
                                  custom - Defined by user (in Mbps).
                                  migration_bandwidth_limit
                                  no
                                    Set the custom migration bandwidth limit.
                                    This parameter is used only when migration_bandwidth is custom.
                                    migration_compressed
                                    no
                                    • true
                                    • false
                                    • inherit
                                    If (True) compression is used during live migration of the virtual machine.
                                    Used only when migration_policy is set to legacy.
                                    Following options are supported:
                                    true - Override the global setting to true.
                                    false - Override the global setting to false.
                                    inherit - Use value which is set globally.
                                    migration_policy
                                    no
                                    • legacy
                                    • minimal_downtime
                                    • suspend_workload
                                    A migration policy defines the conditions for live migrating virtual machines in the event of host failure.
                                    Following policies are supported:
                                    legacy - Legacy behavior of 3.6 version.
                                    minimal_downtime - Virtual machines should not experience any significant downtime.
                                    suspend_workload - Virtual machines may experience a more significant downtime.
                                    name
                                    yes
                                      Name of the the cluster to manage.
                                      network
                                      no
                                        Management network of cluster to access cluster hosts.
                                        poll_interval
                                        no 3
                                          Number of the seconds the module waits until another poll request on entity status is sent.
                                          resilience_policy
                                          no
                                          • do_not_migrate
                                          • migrate
                                          • migrate_highly_available
                                          The resilience policy defines how the virtual machines are prioritized in the migration.
                                          Following values are supported:
                                          do_not_migrate - Prevents virtual machines from being migrated.
                                          migrate - Migrates all virtual machines in order of their defined priority.
                                          migrate_highly_available - Migrates only highly available virtual machines to prevent overloading other hosts.
                                          rng_sources
                                          no
                                            List that specify the random number generator devices that all hosts in the cluster will use.
                                            Supported generators are: hwrng and random.
                                            scheduling_policy
                                            no
                                              Name of the scheduling policy to be used for cluster.
                                              serial_policy
                                              no
                                                Specify a serial number policy for the virtual machines in the cluster.
                                                Following options are supported:
                                                vm - Sets the virtual machine's UUID as its serial number.
                                                host - Sets the host's UUID as the virtual machine's serial number.
                                                custom - Allows you to specify a custom serial number in serial_policy_value.
                                                serial_policy_value
                                                no
                                                  Allows you to specify a custom serial number.
                                                  This parameter is used only when serial_policy is custom.
                                                  spice_proxy
                                                  no
                                                    The proxy by which the SPICE client will connect to virtual machines.
                                                    The address must be in the following format: protocol://[host]:[port]
                                                    state
                                                    no present
                                                    • present
                                                    • absent
                                                    Should the cluster be present or absent
                                                    switch_type
                                                    no
                                                    • legacy
                                                    • ovs
                                                    Type of switch to be used by all networks in given cluster. Either legacy which is using linux brigde or ovs using Open vSwitch.
                                                    threads_as_cores
                                                    no
                                                      If (True) the exposed host threads would be treated as cores which can be utilized by virtual machines.
                                                      timeout
                                                      no 180
                                                        The amount of time in seconds the module should wait for the instance to get into desired state.
                                                        trusted_service
                                                        no
                                                          If (True) enable integration with an OpenAttestation server.
                                                          virt
                                                          no
                                                            If (True), hosts in this cluster will be used to run virtual machines.
                                                            vm_reason
                                                            no
                                                              If (True) enable an optional reason field when a virtual machine is shut down from the Manager, allowing the administrator to provide an explanation for the maintenance.
                                                              wait
                                                              no
                                                                True if the module should wait for the entity to get into desired state.

                                                                Examples

                                                                # Examples don't contain auth parameter for simplicity,
                                                                # look at ovirt_auth module to see how to reuse authentication:
                                                                
                                                                # Create cluster
                                                                - ovirt_clusters:
                                                                    datacenter: mydatacenter
                                                                    name: mycluster
                                                                    cpu_type: Intel SandyBridge Family
                                                                    description: mycluster
                                                                    compatibility_version: 4.0
                                                                
                                                                # Create virt service cluster:
                                                                - ovirt_clusters:
                                                                    datacenter: 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
                                                                
                                                                # Remove cluster
                                                                - ovirt_clusters:
                                                                    state: absent
                                                                    name: mycluster
                                                                

                                                                Return Values

                                                                Common return values are documented here common_return_values, the following are the fields unique to this module:

                                                                name description returned type sample
                                                                cluster Dictionary of all the cluster attributes. Cluster attributes can be found on your oVirt instance at following url: https://ovirt.example.com/ovirt-engine/api/model#types/cluster. On success if cluster is found.
                                                                id ID of the cluster which is managed On success if cluster is found. str 7de90f31-222c-436c-a1ca-7e655bd5b60c


                                                                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.0.0

                                                                This is an Extras Module

                                                                For more information on what this means please read modules_extra

                                                                For help in developing on modules, should you be so inclined, please read community, developing_test_pr and developing_modules.