Repository: ansible-collections/community.vmware

Issue:
Document `vmware_cluster` parameters that will deprecated and removed in 2.12
##### SUMMARY
Since 2.9 (I think), we face a deprecated message when using the `vmware_cluster` module.

```
[DEPRECATION WARNING]: Configuring HA using vmware_cluster module is deprecated and will be removed in version 2.12. Please use vmware_cluster_ha module for the new functionality.. This feature will be removed in version 2.12. Deprecation warnings can be disabled by
setting deprecation_warnings=False in ansible.cfg.
[DEPRECATION WARNING]: Configuring DRS using vmware_cluster module is deprecated and will be removed in version 2.12. Please use vmware_cluster_drs module for the new functionality.. This feature will be removed in version 2.12. Deprecation warnings can be disabled by
setting deprecation_warnings=False in ansible.cfg.
```

As far as I understand the messages and the discussion ansible/ansible#58023 and associated PR ansible/ansible#58468, it's not the entire module `vmware_cluster` that will become deprecated but only the arguments used to configure the HA, DRS and vSAN. 
Like it's done for [`ip_address` param of `vmware_vmkernel`](https://docs.ansible.com/ansible/latest/modules/vmware_vmkernel_module.html#parameter-ip_address), I think that it could be great to add comment for each nearly deprecated parameter. Like that it will be easier for everybody to identify if you need to update your playbook.

I assume that all parameters starting with `[drs_|ha_|vsan]` will be deprecated, but it's not clear to me for the `enable_[drs|ha|vsan]` …

##### ISSUE TYPE
- Documentation Report

##### COMPONENT NAME
- vmware_cluster
- vmware_cluster_drs
- vmware_cluster_ha
- vmware_cluster_vsan

##### ANSIBLE VERSION
```paste below
ansible 2.9.5
  config file = /home/myuser/Projects/313/etc/ansible.cfg
  configured module search path = ['/home/myuser/Projects/313/library']
  ansible python module location = /home/myuser/.virtualenvs/313/lib/python3.7/site-packages/ansible
  executable location = /home/myuser/.virtualenvs/313/bin/ansible
  python version = 3.7.6 (default, Dec 19 2019, 22:50:01) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)]
```

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below
CACHE_PLUGIN(/home/myuser/Projects/313/etc/ansible.cfg) = jsonfile
CACHE_PLUGIN_CONNECTION(/home/myuser/Projects/313/etc/ansible.cfg) = $HOME/.ansible/facts/
CACHE_PLUGIN_TIMEOUT(/home/myuser/Projects/313/etc/ansible.cfg) = 3600
DEFAULT_ACTION_PLUGIN_PATH(env: ANSIBLE_ACTION_PLUGINS) = ['/home/myuser/.virtualenvs/313/lib/python3.7/site-packages/ara/plugins/actions']
DEFAULT_CALLBACK_PLUGIN_PATH(env: ANSIBLE_CALLBACK_PLUGINS) = ['/home/myuser/.virtualenvs/313/lib/python3.7/site-packages/ara/plugins/callbacks']
DEFAULT_CALLBACK_WHITELIST(/home/myuser/Projects/313/etc/ansible.cfg) = ['profile_tasks']
DEFAULT_FILTER_PLUGIN_PATH(env: ANSIBLE_FILTER_PLUGINS) = ['/home/myuser/Projects/313/plugins/filter']
DEFAULT_GATHERING(/home/myuser/Projects/313/etc/ansible.cfg) = smart
DEFAULT_HOST_LIST(/home/myuser/Projects/313/etc/ansible.cfg) = ['/home/myuser/Projects/313/inventories/T40', '/home/myuser/Projects/313/inventories/setupenv']
DEFAULT_LOG_PATH(/home/myuser/Projects/313/etc/ansible.cfg) = /home/myuser/.ansible/log/ansible.log
DEFAULT_MODULE_PATH(env: ANSIBLE_LIBRARY) = ['/home/myuser/Projects/313/library']
DEFAULT_ROLES_PATH(env: ANSIBLE_ROLES_PATH) = ['/home/myuser/Projects/313/roles.galaxy', '/home/myuser/Projects/313/roles']
DEFAULT_STDOUT_CALLBACK(/home/myuser/Projects/313/etc/ansible.cfg) = yaml
GALAXY_ROLE_SKELETON(env: ANSIBLE_GALAXY_ROLE_SKELETON) = /home/myuser/Projects/313/etc/skel/default
HOST_KEY_CHECKING(/home/myuser/Projects/313/etc/ansible.cfg) = False
```

##### OS / ENVIRONMENT
na

##### ADDITIONAL INFORMATION
na



Discussion:
Moved from ansible/ansible ([#68041](https://github.com/ansible/ansible/issues/68041)) to ansible-collections/vmware.
@xenlo Thanks for providing information and providing your concern. AFAIK, `enable_[ha|drs|vsan]` will also deprecate with the other options (Since they are related). I think @mariolenz would be the right person to comment on this.

Thanks.
I'll have a look at this.

Resolving patch:
diff --git a/plugins/modules/vmware_cluster.py b/plugins/modules/vmware_cluster.py
--- a/plugins/modules/vmware_cluster.py
+++ b/plugins/modules/vmware_cluster.py
@@ -60,12 +60,16 @@
     enable_drs:
       description:
       - If set to C(yes), will enable DRS when the cluster is created.
+      - Use C(enable_drs) of M(vmware_cluster_drs) instead.
+      - Deprecated option, will be removed in version 2.12.
       type: bool
       default: 'no'
     drs_enable_vm_behavior_overrides:
       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(vmware_cluster_drs) instead.
+      - Deprecated option, will be removed in version 2.12.
       type: bool
       default: True
     drs_default_vm_behavior:
@@ -77,16 +81,22 @@
         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(vmware_cluster_drs) instead.
+      - Deprecated option, will be removed in version 2.12.
       default: fullyAutomated
       choices: [ fullyAutomated, manual, partiallyAutomated ]
     drs_vmotion_rate:
       description:
       - Threshold for generated ClusterRecommendations.
+      - Use C(drs_vmotion_rate) of M(vmware_cluster_drs) instead.
+      - Deprecated option, will be removed in version 2.12.
       default: 3
       choices: [ 1, 2, 3, 4, 5 ]
     enable_ha:
       description:
       - If set to C(yes) will enable HA when the cluster is created.
+      - Use C(enable_ha) of M(vmware_cluster_ha) instead.
+      - Deprecated option, will be removed in version 2.12.
       type: bool
       default: 'no'
     ha_host_monitoring:
@@ -95,6 +105,8 @@
       - 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(no), then this value is ignored.
+      - Use C(ha_host_monitoring) of M(vmware_cluster_ha) instead.
+      - Deprecated option, will be removed in version 2.12.
       choices: [ 'enabled', 'disabled' ]
       default: 'enabled'
     ha_vm_monitoring:
@@ -104,6 +116,8 @@
       - 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(no), then this value is ignored.
+      - Use C(ha_vm_monitoring) of M(vmware_cluster_ha) instead.
+      - Deprecated option, will be removed in version 2.12.
       choices: ['vmAndAppMonitoring', 'vmMonitoringOnly', 'vmMonitoringDisabled']
       default: 'vmMonitoringDisabled'
     ha_failover_level:
@@ -111,11 +125,15 @@
       - 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(vmware_cluster_ha) instead.
+      - Deprecated option, will be removed in version 2.12.
       default: 2
     ha_admission_control_enabled:
       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(vmware_cluster_ha) instead.
+      - Deprecated option, will be removed in version 2.12.
       default: True
       type: bool
     ha_vm_failure_interval:
@@ -124,6 +142,8 @@
         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(vmware_cluster_ha) instead.
+      - Deprecated option, will be removed in version 2.12.
       default: 30
     ha_vm_min_up_time:
       description:
@@ -131,12 +151,16 @@
         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(vmware_cluster_ha) instead.
+      - Deprecated option, will be removed in version 2.12.
       default: 120
     ha_vm_max_failures:
       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(vmware_cluster_ha) instead.
+      - Deprecated option, will be removed in version 2.12.
       default: 3
     ha_vm_max_failure_window:
       description:
@@ -145,6 +169,8 @@
       - 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(vmware_cluster_ha) instead.
+      - Deprecated option, will be removed in version 2.12.
       default: -1
     ha_restart_priority:
       description:
@@ -158,17 +184,23 @@
         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(vmware_cluster_ha) instead.
+      - Deprecated option, will be removed in version 2.12.
       default: 'medium'
       choices: [ 'disabled', 'high', 'low', 'medium' ]
     enable_vsan:
       description:
       - If set to C(yes) will enable vSAN when the cluster is created.
+      - Use C(enable_vsan) of M(vmware_cluster_vsan) instead.
+      - Deprecated option, will be removed in version 2.12.
       type: bool
       default: 'no'
     vsan_auto_claim_storage:
       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(vmware_cluster_vsan) instead.
+      - Deprecated option, will be removed in version 2.12.
       type: bool
       default: False
     state:
@@ -176,6 +208,10 @@
       - Create C(present) or remove C(absent) a VMware vSphere cluster.
       choices: [ absent, present ]
       default: present
+seealso:
+- module: vmware_cluster_drs
+- module: vmware_cluster_ha
+- module: vmware_cluster_vsan
 extends_documentation_fragment:
 - community.vmware.vmware.documentation
 


Test patch: