community.vmware.vmware_drs_group_manager – Manage VMs and Hosts in DRS group.¶
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_drs_group_manager
.
New in version 1.7.0: of community.vmware
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.7
PyVmomi
Parameters¶
Examples¶
---
- name: Add VMs in an existing DRS VM group
delegate_to: localhost
community.vmware.vmware_drs_group_manager:
hostname: "{{ vcenter_hostname }}"
password: "{{ vcenter_password }}"
username: "{{ vcenter_username }}"
cluster: DC0_C0
datacenter: DC0
group_name: TEST_VM_01
vms:
- DC0_C0_RP0_VM0
- DC0_C0_RP0_VM1
state: present
- name: Add Hosts in an existing DRS Host group
delegate_to: localhost
community.vmware.vmware_drs_group_manager:
hostname: "{{ vcenter_hostname }}"
password: "{{ vcenter_password }}"
username: "{{ vcenter_username }}"
cluster: DC0_C0
datacenter: DC0
group_name: TEST_HOST_01
hosts:
- DC0_C0_H0
- DC0_C0_H1
- DC0_C0_H2
state: present
- name: Remove VM from an existing DRS VM group
delegate_to: localhost
community.vmware.vmware_drs_group_manager:
hostname: "{{ vcenter_hostname }}"
password: "{{ vcenter_password }}"
username: "{{ vcenter_username }}"
cluster: DC0_C0
datacenter: DC0
group_name: TEST_VM_01
vms:
- DC0_C0_RP0_VM0
state: absent
- name: Remove host from an existing DRS Host group
delegate_to: localhost
community.vmware.vmware_drs_group_manager:
hostname: "{{ vcenter_hostname }}"
password: "{{ vcenter_password }}"
username: "{{ vcenter_username }}"
cluster: DC0_C0
datacenter: DC0
group_name: TEST_HOST_01
hosts:
- DC0_C0_H0
state: absent
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Abhijeet Kasurde (@Akasurde)