Disable HA, DRS on Cluster and set up Maintenance mode on ESXi host via Ansible playbook
I create playbook to disable HA and DRS on vmware cluster and put esxi host in maintanance mode.
First part of playbook use module call vmware_cluster.
To install it use: ansible-galaxy collection install community.vmware
.
To use it in a playbook, specify: community.vmware.vmware_cluster
.
Ansible documentation. https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware_cluster_module.html
Second part playbook related with esxi host maintenance mode use module call vmware_maintenancemode.
Ansible documentation https://docs.ansible.com/ansible/2.5/modules/vmware_maintenancemode_module.html
Download playbook >> ClusterConfVcenter
Let’s test it.
- Create or download playbook ClusterConfVcenter.yml
Playbook should looks like below, so you need to modyfy some passwords, vcenter ip’s , esxi host name, datacenter name.
2. Before run playbook you need to Install module by ansible-galaxy collection install community.vmware
.
3. Run playbook by type command >> ansible-playbook ansible/ClusterConfVcenter.yml
4. If you don’t notice any errors you can check Cluster settings and Maintenance mode for esx’i host.
DRS
HA
Maintenance Mode
Please Comment and Subscribe