community / community.vmware / 4.2.0 / module / vmware_cluster_ha Manage High Availability (HA) on VMware vSphere clusters Authors: Joseph Callen (@jcpowermac), Abhijeet Kasurde (@Akasurde)community.vmware.vmware_cluster_ha (4.2.0) — module
Install with ansible-galaxy collection install community.vmware:==4.2.0
collections: - name: community.vmware version: 4.2.0
Manages HA configuration on VMware vSphere clusters.
All values and VMware object names are case sensitive.
- name: Enable HA without admission control community.vmware.vmware_cluster_ha: hostname: '{{ vcenter_hostname }}' username: '{{ vcenter_username }}' password: '{{ vcenter_password }}' datacenter_name: datacenter cluster_name: cluster enable: true delegate_to: localhost
- name: Enable HA and VM monitoring without admission control community.vmware.vmware_cluster_ha: hostname: "{{ vcenter_hostname }}" username: "{{ vcenter_username }}" password: "{{ vcenter_password }}" datacenter_name: DC0 cluster_name: "{{ cluster_name }}" enable: true ha_vm_monitoring: vmMonitoringOnly delegate_to: localhost
- name: Enable HA with admission control reserving 50% of resources for HA community.vmware.vmware_cluster_ha: hostname: '{{ vcenter_hostname }}' username: '{{ vcenter_username }}' password: '{{ vcenter_password }}' datacenter_name: datacenter cluster_name: cluster enable: true reservation_based_admission_control: auto_compute_percentages: false failover_level: 1 cpu_failover_resources_percent: 50 memory_failover_resources_percent: 50 delegate_to: localhost
port: default: 443 description: - The port number of the vSphere vCenter or ESXi server. - If the value is not specified in the task, the value of environment variable E(VMWARE_PORT) will be used instead. type: int enable: default: true description: - Whether to enable HA. type: bool hostname: description: - The hostname or IP address of the vSphere vCenter or ESXi server. - If the value is not specified in the task, the value of environment variable E(VMWARE_HOST) will be used instead. type: str password: aliases: - pass - pwd description: - The password of the vSphere vCenter or ESXi server. - If the value is not specified in the task, the value of environment variable E(VMWARE_PASSWORD) will be used instead. type: str username: aliases: - admin - user description: - The username of the vSphere vCenter or ESXi server. - If the value is not specified in the task, the value of environment variable E(VMWARE_USER) will be used instead. type: str apd_delay: default: 180 description: - The response recovery delay time in sec for storage failures categorized as All Paths Down (APD). - Only set if O(apd_response=restartConservative) or O(apd_response=restartAggressive). type: int datacenter: aliases: - datacenter_name description: - The name of the datacenter. required: true type: str proxy_host: description: - Address of a proxy that will receive all HTTPS requests and relay them. - The format is a hostname or a IP. - If the value is not specified in the task, the value of environment variable E(VMWARE_PROXY_HOST) will be used instead. required: false type: str proxy_port: description: - Port of the HTTP proxy that will receive all HTTPS requests and relay them. - If the value is not specified in the task, the value of environment variable E(VMWARE_PROXY_PORT) will be used instead. required: false type: int apd_reaction: choices: - reset - none default: reset description: - VM response recovery reaction for storage failures categorized as All Paths Down (APD). - Only set if O(apd_response=restartConservative) or O(apd_response=restartAggressive). type: str apd_response: choices: - disabled - warning - restartConservative - restartAggressive default: warning description: - VM storage protection setting for storage failures categorized as All Paths Down (APD). type: str cluster_name: description: - The name of the cluster to be managed. required: true type: str pdl_response: choices: - disabled - warning - restartAggressive default: warning description: - VM storage protection setting for storage failures categorized as Permenant Device Loss (PDL). type: str validate_certs: default: true description: - Allows connection when SSL certificates are not valid. Set to V(false) when certificates are not trusted. - If the value is not specified in the task, the value of environment variable E(VMWARE_VALIDATE_CERTS) will be used instead. type: bool ha_vm_monitoring: choices: - vmAndAppMonitoring - vmMonitoringOnly - vmMonitoringDisabled default: vmMonitoringDisabled description: - State of virtual machine health monitoring service. - If set to V(vmAndAppMonitoring), HA response to both virtual machine and application heartbeat failure. - If set to V(vmMonitoringDisabled), virtual machine health monitoring is disabled. - If set to V(vmMonitoringOnly), HA response to virtual machine heartbeat failure. - If O(enable=false), then this value is ignored. type: str advanced_settings: default: {} description: - A dictionary of advanced HA settings. type: dict ha_vm_min_up_time: default: 120 description: - The number of seconds for the virtual machine's heartbeats to stabilize after the virtual machine has been powered on. - Valid only when O(ha_vm_monitoring=vmAndAppMonitoring) or O(ha_vm_monitoring=vmMonitoringOnly). - Unit is seconds. type: int ha_host_monitoring: choices: - enabled - disabled default: enabled description: - Whether HA restarts virtual machines after a host fails. - If set to V(enabled), HA restarts virtual machines after a host fails. - If set to V(disabled), HA does not restart virtual machines after a host fails. - If O(enable=false), this value is ignored. type: str ha_vm_max_failures: default: 3 description: - Maximum number of failures and automated resets allowed during the time that O(ha_vm_max_failure_window) specifies. - Valid only when O(ha_vm_monitoring=vmAndAppMonitoring) or O(ha_vm_monitoring=vmMonitoringOnly). type: int ha_restart_priority: choices: - disabled - high - low - medium default: medium description: - Priority HA gives to a virtual machine if sufficient capacity is not available to power on all failed virtual machines. - Valid only when O(ha_vm_monitoring=vmAndAppMonitoring) or O(ha_vm_monitoring=vmMonitoringOnly). - If set to V(disabled), then HA is disabled for this virtual machine. - If set to V(high), then virtual machine with this priority have a higher chance of powering on after a failure, when there is insufficient capacity on hosts to meet all virtual machine needs. - If set to V(medium), then virtual machine with this priority have an intermediate chance of powering on after a failure, when there is insufficient capacity on hosts to meet all virtual machine needs. - If set to V(low), then virtual machine with this priority have a lower chance of powering on after a failure, when there is insufficient capacity on hosts to meet all virtual machine needs. type: str ha_vm_failure_interval: default: 30 description: - The number of seconds after which virtual machine is declared as failed if no heartbeat has been received. - This setting is only valid if O(ha_vm_monitoring=vmAndAppMonitoring) or O(ha_vm_monitoring=vmMonitoringOnly). - Unit is seconds. type: int host_isolation_response: choices: - none - powerOff - shutdown default: none description: - Indicates whether or VMs should be powered off if a host determines that it is isolated from the rest of the compute resource. - If set to V(none), do not power off VMs in the event of a host network isolation. - If set to V(powerOff), power off VMs in the event of a host network isolation. - If set to V(shutdown), shut down VMs guest operating system in the event of a host network isolation. type: str ha_vm_max_failure_window: default: -1 description: - The number of seconds for the window during which up to O(ha_vm_max_failures) resets can occur before automated responses stop. - Valid only when O(ha_vm_monitoring=vmAndAppMonitoring) or O(ha_vm_monitoring=vmMonitoringOnly). - Unit is seconds. - Default specifies no failure window. type: int slot_based_admission_control: description: - Configure slot based admission control policy. - O(slot_based_admission_control), O(reservation_based_admission_control) and O(failover_host_admission_control) are mutually exclusive. suboptions: failover_level: description: - Number of host failures that should be tolerated. required: true type: int type: dict failover_host_admission_control: description: - Configure dedicated failover hosts. - O(slot_based_admission_control), O(reservation_based_admission_control) and O(failover_host_admission_control) are mutually exclusive. suboptions: failover_hosts: description: - List of dedicated failover hosts. elements: str required: true type: list type: dict reservation_based_admission_control: description: - Configure reservation based admission control policy. - O(slot_based_admission_control), O(reservation_based_admission_control) and O(failover_host_admission_control) are mutually exclusive. suboptions: auto_compute_percentages: default: true description: - By default, O(reservation_based_admission_control.failover_level) is used to calculate O(reservation_based_admission_control.cpu_failover_resources_percent) and O(reservation_based_admission_control.memory_failover_resources_percent). If a user wants to override the percentage values, he has to set this field to false. type: bool cpu_failover_resources_percent: default: 50 description: - Percentage of CPU resources in the cluster to reserve for failover. Ignored if O(reservation_based_admission_control.auto_compute_percentages) is not set to false. type: int failover_level: description: - Number of host failures that should be tolerated. required: true type: int memory_failover_resources_percent: default: 50 description: - Percentage of memory resources in the cluster to reserve for failover. Ignored if O(reservation_based_admission_control.auto_compute_percentages) is not set to false. type: int type: dict