saltext.vmware.modules.cluster_drs#

saltext.vmware.modules.cluster_drs.configure(cluster, datacenter, enable=False, enable_vm_behavior_overrides=True, default_vm_behavior=None, vmotion_rate=3, advanced_settings=None, service_instance=None)[source]#

Configure a Distributed Resource Scheduler (DRS) for a given cluster

Supported proxies: esxcluster

cluster

The cluster name

datacenter

The datacenter name to which the cluster belongs

enable

Enable DRS for the cluster

enable_vm_behavior_overrides

Flag that dictates whether DRS Behavior overrides for individual virtual machines are enabled. The default value is true. When this flag is true, overrides the default_vm_behavior. When this flag is false, the default_vm_behavior value applies to all virtual machines.

default_vm_behavior

Specifies the cluster-wide default DRS behavior for virtual machines. Valid Values:

  • fullyAutomated: Specifies that VirtualCenter should automate both the migration of virtual machines and their placement with a host at power on.

  • manual: Specifies that VirtualCenter should generate recommendations for virtual machine migration and for placement with a host, but should not implement the recommendations automatically.

  • partiallyAutomated: Specifies that VirtualCenter should generate recommendations for virtual machine migration and for placement with a host, but should automatically implement only the placement at power on.

vmotion_rate

Threshold for generated ClusterRecommendations. DRS generates only those recommendations that are above the specified vmotionRate. Ratings vary from 1 to 5. This setting applies to manual, partiallyAutomated, and fullyAutomated DRS clusters. 1 - Conservative, 5 - Aggressive. Default is 3.

advanced_settings

Advanced options for the cluster, to be passed in as a dictionary.

CLI Example:

salt '*' vmware_cluster_drs.configure cluster1 dc1 enable=True
saltext.vmware.modules.cluster_drs.get(cluster_name, datacenter_name, service_instance=None)[source]#

Get DRS info about a cluster in a datacenter

cluster_name

The cluster name

datacenter_name

The datacenter name to which the cluster belongs

service_instance

Use this vCenter service connection instance instead of creating a new one. (optional).

CLI Example:

salt '*' vmware_cluster_drs.get cluster_name=cl1 datacenter_name=dc1
saltext.vmware.modules.cluster_drs.vm_affinity_rule(name, affinity, vm_names, cluster_name, datacenter_name, enabled=True, mandatory=None, service_instance=None)[source]#

Configure a virtual machine to virtual machine DRS rule

name

The name of the rule.

affinity

(boolean) Describes whether to make affinity or anti affinity rule.

vm_names

List of virtual machines associated with DRS rule.

cluster_name

The name of the cluster to configure a rule on.

datacenter_name

The name of the datacenter where the cluster exists.

enabled

(optional, boolean) Enable the DRS rule being created. Defaults to True.

mandatory

(optional, boolean) Sets whether the rule being created is mandatory. Defaults to False.

service_instance

(optional) The Service Instance from which to obtain managed object references.

CLI Example:

salt '*' vmware_cluster_drs.vm_affinity_rule name="Example Anti-Affinity Rule" affinity=False vm_names='["vm1", "vm2"]' cluster_name=cl1 datacenter_name=dc1 mandatory=True
saltext.vmware.modules.cluster_drs.rule_info(cluster_name, datacenter_name, rule_name=None, service_instance=None)[source]#

Return a list of all the DRS rules on a given cluster, or one DRS rule if filtered by rule_name.

cluster_name

The name of the cluster to get rules from.

datacenter_name

The name of the datacenter where the cluster exists.

rule_name

(optional) Return only the rule with rule_name

service_instance

(optional) The Service Instance from which to obtain managed object references.

CLI Example:

salt '*' vmware_cluster_drs.rule_info cluster_name=cl1 datacenter_name=dc1