vmware_vm_vm_drs_rule – Configure VMware DRS Affinity rule for virtual machine in given cluster¶
New in version 2.5.
Synopsis¶
This module can be used to configure VMware DRS Affinity rule for virtual machine in given cluster.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.6
PyVmomi
Parameters¶
Examples¶
- name: Create DRS Affinity Rule for VM-VM
vmware_vm_vm_drs_rule:
hostname: "{{ esxi_server }}"
username: "{{ esxi_username }}"
password: "{{ esxi_password }}"
cluster_name: "{{ cluster_name }}"
validate_certs: no
vms:
- vm1
- vm2
drs_rule_name: vm1-vm2-affinity-rule-001
enabled: True
mandatory: True
affinity_rule: True
delegate_to: localhost
- name: Create DRS Anti-Affinity Rule for VM-VM
vmware_vm_vm_drs_rule:
hostname: "{{ esxi_server }}"
username: "{{ esxi_username }}"
password: "{{ esxi_password }}"
cluster_name: "{{ cluster_name }}"
validate_certs: no
enabled: True
vms:
- vm1
- vm2
drs_rule_name: vm1-vm2-affinity-rule-001
mandatory: True
affinity_rule: False
delegate_to: localhost
- name: Delete DRS Affinity Rule for VM-VM
vmware_vm_vm_drs_rule:
hostname: "{{ esxi_server }}"
username: "{{ esxi_username }}"
password: "{{ esxi_password }}"
cluster_name: "{{ cluster_name }}"
validate_certs: no
drs_rule_name: vm1-vm2-affinity-rule-001
state: absent
delegate_to: localhost
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Status¶
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Community. [community]
Authors¶
Abhijeet Kasurde (@Akasurde)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.