vmware_maintenancemode - Place a host into maintenance mode
New in version 2.1.
Synopsis
- Place an ESXI host into maintenance mode
- Support for VSAN compliant maintenance mode when selected
Requirements (on host that executes module)
- python >= 2.6
- PyVmomi
Options
parameter | required | default | choices | comments |
---|---|---|---|---|
esxi_hostname | yes | Name of the host as defined in vCenter | ||
evacuate | no |
| If True, evacuate all powered off VMs | |
hostname | yes | The hostname or IP address of the vSphere vCenter. | ||
password | yes | The password of the vSphere vCenter. aliases: pass, pwd | ||
state | no | present |
| Enter or exit maintenance mode |
timeout | no | Specify a timeout for the operation | ||
username | yes | The username of the vSphere vCenter. aliases: user, admin | ||
validate_certs | no | True |
| Allows connection when SSL certificates are not valid. Set to false when certificates are not trusted. |
vsan_mode | no |
| Specify which VSAN compliant mode to enter |
Examples
- name: Enter VSAN-Compliant Maintenance Mode local_action: module: vmware_maintenancemode hostname: vc_host username: vc_user password: vc_pass esxi_hostname: esxi.host.example vsan: ensureObjectAccessibility evacuate: yes timeout: 3600 state: present
Return Values
Common return values are documented here Return Values, the following are the fields unique to this module:
name | description | returned | type | sample |
---|---|---|---|---|
hostname | Name of host in vCenter | always | string | esxi.local.domain |
hostsystem | Name of vim reference | always | string | 'vim.HostSystem:host-236' |
status | Action taken | always | string | ENTER |
Notes
Note
- Tested on vSphere 5.5 and 6.0
Status
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.4/vmware_maintenancemode_module.html