community / community.vmware / 1.18.2 / module / vmware_cluster Manage VMware vSphere clusters Authors: Joseph Callen (@jcpowermac), Abhijeet Kasurde (@Akasurde)community.vmware.vmware_cluster (1.18.2) — module
Install with ansible-galaxy collection install community.vmware:==1.18.2
collections: - name: community.vmware version: 1.18.2
Adds or removes VMware vSphere clusters.
Although this module can manage DRS, HA and VSAN related configurations, this functionality is deprecated and will be removed in 2.12.
To manage DRS, HA and VSAN related configurations, use the new modules vmware_cluster_drs, vmware_cluster_ha and vmware_cluster_vsan.
All values and VMware object names are case sensitive.
- name: Create Cluster community.vmware.vmware_cluster: hostname: '{{ vcenter_hostname }}' username: '{{ vcenter_username }}' password: '{{ vcenter_password }}' datacenter_name: datacenter cluster_name: cluster enable_ha: true enable_drs: true enable_vsan: true delegate_to: localhost
- name: Create Cluster with additional changes community.vmware.vmware_cluster: hostname: "{{ vcenter_hostname }}" username: "{{ vcenter_username }}" password: "{{ vcenter_password }}" datacenter_name: DC0 cluster_name: "{{ cluster_name }}" enable_ha: True ha_vm_monitoring: vmMonitoringOnly enable_drs: True drs_default_vm_behavior: partiallyAutomated enable_vsan: True register: cl_result delegate_to: localhost
- name: Delete Cluster community.vmware.vmware_cluster: hostname: "{{ vcenter_hostname }}" username: "{{ vcenter_username }}" password: "{{ vcenter_password }}" datacenter_name: datacenter cluster_name: cluster enable_ha: true enable_drs: true enable_vsan: true state: absent 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 C(VMWARE_PORT) will be used instead. - Environment variable support added in Ansible 2.6. type: int state: choices: - absent - present default: present description: - Create C(present) or remove C(absent) a VMware vSphere cluster. type: str 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 C(VMWARE_HOST) will be used instead. - Environment variable support added in Ansible 2.6. 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 C(VMWARE_PASSWORD) will be used instead. - Environment variable support added in Ansible 2.6. 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 C(VMWARE_USER) will be used instead. - Environment variable support added in Ansible 2.6. type: str enable_ha: default: false description: - If set to C(True) will enable HA when the cluster is created. - Use C(enable_ha) of M(community.vmware.vmware_cluster_ha) instead. - Deprecated option, will be removed in version 2.12. type: bool ignore_ha: default: false description: - If set to C(True), HA will not be configured; all explicit and default HA related configurations will be ignored. type: bool datacenter: aliases: - datacenter_name description: - The name of the datacenter. required: true type: str enable_drs: default: false description: - If set to C(True), will enable DRS when the cluster is created. - Use C(enable_drs) of M(community.vmware.vmware_cluster_drs) instead. - Deprecated option, will be removed in version 2.12. type: bool ignore_drs: default: false description: - If set to C(True), DRS will not be configured; all explicit and default DRS related configurations will be ignored. type: bool 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 C(VMWARE_PROXY_HOST) will be used instead. - This feature depends on a version of pyvmomi greater than v6.7.1.2018.12 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 C(VMWARE_PROXY_PORT) will be used instead. required: false type: int enable_vsan: default: false description: - If set to C(True) will enable vSAN when the cluster is created. - Use C(enable_vsan) of M(community.vmware.vmware_cluster_vsan) instead. - Deprecated option, will be removed in version 2.12. type: bool ignore_vsan: default: false description: - If set to C(True), VSAN will not be configured; all explicit and default VSAN related configurations will be ignored. type: bool cluster_name: description: - The name of the cluster to be managed. required: true type: str validate_certs: default: true description: - Allows connection when SSL certificates are not valid. Set to C(false) when certificates are not trusted. - If the value is not specified in the task, the value of environment variable C(VMWARE_VALIDATE_CERTS) will be used instead. - Environment variable support added in Ansible 2.6. - If set to C(true), please make sure Python >= 2.7.9 is installed on the given machine. type: bool drs_vmotion_rate: choices: - 1 - 2 - 3 - 4 - 5 default: 3 description: - Threshold for generated ClusterRecommendations. - Use C(drs_vmotion_rate) of M(community.vmware.vmware_cluster_drs) instead. - Deprecated option, will be removed in version 2.12. type: int ha_vm_monitoring: choices: - vmAndAppMonitoring - vmMonitoringOnly - vmMonitoringDisabled default: vmMonitoringDisabled description: - Indicates the state of virtual machine health monitoring service. - If set to C(vmAndAppMonitoring), HA response to both virtual machine and application heartbeat failure. - If set to C(vmMonitoringDisabled), virtual machine health monitoring is disabled. - If set to C(vmMonitoringOnly), HA response to virtual machine heartbeat failure. - If C(enable_ha) is set to C(False), then this value is ignored. - Use C(ha_vm_monitoring) of M(community.vmware.vmware_cluster_ha) instead. - Deprecated option, will be removed in version 2.12. type: str ha_failover_level: default: 2 description: - Number of host failures that should be tolerated, still guaranteeing sufficient resources to restart virtual machines on available hosts. - Accepts integer values only. - Use C(slot_based_admission_control), C(reservation_based_admission_control) or C(failover_host_admission_control) of M(community.vmware.vmware_cluster_ha) instead. - Deprecated option, will be removed in version 2.12. type: int 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. - This setting is only valid if C(ha_vm_monitoring) is set to, either C(vmAndAppMonitoring) or C(vmMonitoringOnly). - Unit is seconds. - Use C(ha_vm_min_up_time) of M(community.vmware.vmware_cluster_ha) instead. - Deprecated option, will be removed in version 2.12. type: int ha_host_monitoring: choices: - enabled - disabled default: enabled description: - Indicates whether HA restarts virtual machines after a host fails. - If set to C(enabled), HA restarts virtual machines after a host fails. - If set to C(disabled), HA does not restart virtual machines after a host fails. - If C(enable_ha) is set to C(False), then this value is ignored. - Use C(ha_host_monitoring) of M(community.vmware.vmware_cluster_ha) instead. - Deprecated option, will be removed in version 2.12. type: str ha_vm_max_failures: default: 3 description: - Maximum number of failures and automated resets allowed during the time that C(ha_vm_max_failure_window) specifies. - This setting is only valid if C(ha_vm_monitoring) is set to, either C(vmAndAppMonitoring) or C(vmMonitoringOnly). - Use C(ha_vm_max_failures) of M(community.vmware.vmware_cluster_ha) instead. - Deprecated option, will be removed in version 2.12. type: int ha_restart_priority: choices: - disabled - high - low - medium default: medium description: - Determines the preference that HA gives to a virtual machine if sufficient capacity is not available to power on all failed virtual machines. - This setting is only valid if C(ha_vm_monitoring) is set to, either C(vmAndAppMonitoring) or C(vmMonitoringOnly). - If set to C(disabled), then HA is disabled for this virtual machine. - If set to C(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 C(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 C(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. - Use C(ha_restart_priority) of M(community.vmware.vmware_cluster_ha) instead. - Deprecated option, will be removed in version 2.12. 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 C(ha_vm_monitoring) is set to, either C(vmAndAppMonitoring) or C(vmMonitoringOnly). - Unit is seconds. - Use C(ha_vm_failure_interval) of M(community.vmware.vmware_cluster_ha) instead. - Deprecated option, will be removed in version 2.12. type: int drs_default_vm_behavior: choices: - fullyAutomated - manual - partiallyAutomated default: fullyAutomated description: - Specifies the cluster-wide default DRS behavior for virtual machines. - If set to C(partiallyAutomated), then vCenter generate recommendations for virtual machine migration and for the placement with a host. vCenter automatically implement placement at power on. - If set to C(manual), then vCenter generate recommendations for virtual machine migration and for the placement with a host. vCenter should not implement the recommendations automatically. - If set to C(fullyAutomated), then vCenter should automate both the migration of virtual machines and their placement with a host at power on. - Use C(drs_default_vm_behavior) of M(community.vmware.vmware_cluster_drs) instead. - Deprecated option, will be removed in version 2.12. type: str vsan_auto_claim_storage: default: false description: - Determines whether the VSAN service is configured to automatically claim local storage on VSAN-enabled hosts in the cluster. - Use C(vsan_auto_claim_storage) of M(community.vmware.vmware_cluster_vsan) instead. - Deprecated option, will be removed in version 2.12. type: bool ha_vm_max_failure_window: default: -1 description: - The number of seconds for the window during which up to C(ha_vm_max_failures) resets can occur before automated responses stop. - This setting is only valid if C(ha_vm_monitoring) is set to, either C(vmAndAppMonitoring) or C(vmMonitoringOnly). - Unit is seconds. - Default specifies no failure window. - Use C(ha_vm_max_failure_window) of M(community.vmware.vmware_cluster_ha) instead. - Deprecated option, will be removed in version 2.12. type: int ha_admission_control_enabled: default: true description: - Determines if strict admission control is enabled. - It is recommended to set this parameter to C(True), please refer documentation for more details. - Use C(slot_based_admission_control), C(reservation_based_admission_control) or C(failover_host_admission_control) of M(community.vmware.vmware_cluster_ha) instead. - Deprecated option, will be removed in version 2.12. type: bool drs_enable_vm_behavior_overrides: default: true description: - Determines whether DRS Behavior overrides for individual virtual machines are enabled. - If set to C(True), overrides C(drs_default_vm_behavior). - Use C(drs_enable_vm_behavior_overrides) of M(community.vmware.vmware_cluster_drs) instead. - Deprecated option, will be removed in version 2.12. type: bool