# salt.states.esxdatacenter

Salt states to create and manage VMware vSphere datacenters (datacenters).

codeauthor:

  Alexandru Bleotu <alexandru.bleotu@morganstaley.com>

Warning

This module will be deprecated in a future release of Salt. VMware strongly recommends using the VMware Salt extensions instead of the ESX data center module. Because the Salt extensions are newer and actively supported by VMware, they are more compatible with current versions of ESXi and they work well with the latest features in the VMware product line.

## Dependencies

- pyVmomi Python Module

## States

### datacenter_configured

Makes sure a datacenter exists and is correctly configured.

If the state is run by an `esxdatacenter` minion, the name of the datacenter is retrieved from the proxy details, otherwise the datacenter has the same name as the state.

Supported proxies: esxdatacenter

Example:

1. Make sure that a datacenter named `target_dc` exists on the vCenter, using a `esxdatacenter` proxy:

Proxy minion configuration (connects passthrough to the vCenter):

    proxy:
      proxytype: esxdatacenter
      datacenter: target_dc
      vcenter: vcenter.fake.com
      mechanism: sspi
      domain: fake.com
      principal: host

State configuration:

    datacenter_state:
      esxdatacenter.datacenter_configured

salt.states.esxdatacenter.datacenter_configured(name)

  Makes sure a datacenter exists.

  If the state is run by an `esxdatacenter` minion, the name of the datacenter is retrieved from the proxy details, otherwise the datacenter has the same name as the state.

  Supported proxies: esxdatacenter

  name:

    Datacenter name. Ignored if the proxytype is `esxdatacenter`.