salt.states.esxcluster module

Manage VMware ESXi Clusters.

Dependencies

  • pyVmomi Python Module

pyVmomi

PyVmomi can be installed via pip:

pip install pyVmomi

Note

Version 6.0 of pyVmomi has some problems with SSL error handling on certain versions of Python. If using version 6.0 of pyVmomi, Python 2.7.9, or newer must be present. This is due to an upstream dependency in pyVmomi 6.0 that is not supported in Python versions 2.7 to 2.7.8. If the version of Python is not in the supported range, you will need to install an earlier version of pyVmomi. See Issue #29537 for more information.

Based on the note above, to install an earlier version of pyVmomi than the version currently listed in PyPi, run the following:

pip install pyVmomi==5.5.0.2014.1.1

The 5.5.0.2014.1.1 is a known stable version that this original ESXi State Module was developed against.

salt.states.esxcluster.cluster_configured(name, cluster_config)

Configures a cluster. Creates a new cluster, if it doesn't exist on the vCenter or reconfigures it if configured differently

Supported proxies: esxdatacenter, esxcluster

name

Name of the state. If the state is run in by an esxdatacenter proxy, it will be the name of the cluster.

cluster_config

Configuration applied to the cluster. Complex datastructure following the ESXClusterConfigSchema. Valid example is:

salt.states.esxcluster.licenses_configured(name, licenses=None)

Configures licenses on the cluster entity

Checks if each license exists on the server:
  • if it doesn't, it creates it

Check if license is assigned to the cluster:
  • if it's not assigned to the cluster:
    • assign it to the cluster if there is space

    • error if there's no space

  • if it's assigned to the cluster nothing needs to be done

salt.states.esxcluster.vsan_datastore_configured(name, datastore_name)

Configures the cluster's VSAN datastore

WARNING: The VSAN datastore is created automatically after the first ESXi host is added to the cluster; the state assumes that the datastore exists and errors if it doesn't.