vmware_drs - Create VMWare DRS Rule

New in version 2.3.

Synopsis

  • Create VMWare DRS Rule.

Options

parameter required default choices comments
cluster
yes
The cluster name for the DRS rule.
force_update
no false
  • True
  • False
Force an update.
Performs a delete and create.
Note: Task will always be marked as changed.
gather_facts
no false
  • True
  • False
If set to true, fact gather only.
Return rules defined on cluster.
If vms are defined, return vm facts.
hostname
yes
The hostname or IP address of the vSphere vCenter.
keep_together
no
  • True
  • False
Required when state is set to present.
Set to true will create an Affinity rule.
Set to false will create an AntiAffinity rule.
Use force_update to change an existing rule.
name
no
The name of the DRS rule to manage.
Required when gather_facts is false
password
yes
The password of the vSphere vCenter.
state
no present
  • present
  • absent
Create or delete the DRS rule.
username
yes
The username of the vSphere vCenter.
validate_certs
no true
  • True
  • False
Allows connection when SSL certificates are not valid.
Set to false when certificates are not trusted.
vms
no
A list of vms for the DRS rule.
Required when state is present

Examples

# gather facts on cluster and vms
- vmware_drs:
    hostname: "vcenter.example.com"
    username: "vcuser"
    password: "vcpass"
    cluster: "Cluster Name"
    gather_facts: true
    vms:
        - vma
        - vmb

# gather facts on just cluster
- vmware_drs:
    hostname: "vcenter.example.com"
    username: "vcuser"
    password: "vcpass"
    cluster: "Cluster Name"
    gather_facts: true

# create vmware drs rule
- vmware_drs:
    hostname: "vcenter.example.com"
    username: "vcuser"
    password: "vcpass"
    cluster: "Cluster Name"
    name: "drs-rule-name"
    vms:
        - vma
        - vmb
    keep_together: false

# delete vmware drs rule
- vmware_drs:
    hostname: "vcenter.example.com"
    username: "vcuser"
    password: "vcpass"
    cluster: "vcenter-cluster"
    state: "absent"
    name: "drs-rule-name"

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Support

This module is community maintained without core committer oversight.

For more information on what this means please read modules_support

For help in developing on modules, should you be so inclined, please read community, dev_guide/developing_test_pr and dev_guide/developing_modules.