community.vmware.vmware_datastore_maintenancemode – Place a datastore into maintenance mode¶
Note
This plugin is part of the community.vmware collection (version 1.9.0).
To install it use: ansible-galaxy collection install community.vmware
.
To use it in a playbook, specify: community.vmware.vmware_datastore_maintenancemode
.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.6
PyVmomi
Parameters¶
Examples¶
- name: Enter datastore into Maintenance Mode
community.vmware.vmware_datastore_maintenancemode:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datastore: '{{ datastore_name }}'
state: present
delegate_to: localhost
- name: Enter all datastores under cluster into Maintenance Mode
community.vmware.vmware_datastore_maintenancemode:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
cluster_name: '{{ cluster_name }}'
state: present
delegate_to: localhost
- name: Enter all datastores under datastore cluster into Maintenance Mode
community.vmware.vmware_datastore_maintenancemode:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datastore_cluster: '{{ datastore_cluster_name }}'
state: present
delegate_to: localhost
- name: Exit datastore into Maintenance Mode
community.vmware.vmware_datastore_maintenancemode:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datastore: '{{ datastore_name }}'
state: absent
delegate_to: localhost
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
datastore_status
dictionary
|
always |
Action taken for datastore
Sample:
{'ds_226_01': "Datastore 'ds_226_01' is already in maintenance mode."}
|
Authors¶
Abhijeet Kasurde (@Akasurde)