W3cubDocs

/Ansible

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
  • True
  • False
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
  • present
  • absent
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
  • True
  • False
Allows connection when SSL certificates are not valid. Set to false when certificates are not trusted.
vsan_mode
no
  • ensureObjectAccessibility
  • evacuateAllData
  • noAction
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 Common Return Values, the following are the fields unique to this module:

name description returned type sample
status Action taken string ENTER
hostsystem Name of vim reference always string 'vim.HostSystem:host-236'
hostname Name of host in vCenter always string esxi.local.domain

Notes

Note

Tested on vSphere 5.5 and 6.0

This is an Extras Module

For more information on what this means please read Extras Modules

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, developing_test_pr and Developing Modules.

© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/vmware_maintenancemode_module.html