salt.cloud.clouds.vsphere

vSphere Cloud Module

New in version 2014.7.0.

The vSphere cloud module is used to control access to VMWare vSphere.

depends:
  • PySphere Python module

Use of this module only requires a URL, username and password. Set up the cloud configuration at:

/etc/salt/cloud.providers or /etc/salt/cloud.providers.d/vsphere.conf:

my-vsphere-config:
  provider: vsphere
  user: myuser
  password: verybadpass
  url: 'https://10.1.1.1:443'
folder: Name of the folder that will contain the new VM. If not set, the VM will
be added to the folder the original VM belongs to.
resourcepool: MOR of the resourcepool to be used for the new vm. If not set, it
uses the same resourcepool than the original vm.
datastore: MOR of the datastore where the virtual machine should be located. If
not specified, the current datastore is used.
host: MOR of the host where the virtual machine should be registered.
IF not specified:
  • if resourcepool is not specified, current host is used.
  • if resourcepool is specified, and the target pool represents a stand-alone host, the host is used.
  • if resourcepool is specified, and the target pool represents a DRS-enabled cluster, a host selected by DRS is used.
  • if resourcepool is specified and the target pool represents a cluster without DRS enabled, an InvalidArgument exception will be thrown.
template: Specifies whether or not the new virtual machine should be marked as a
template. Default is False.
salt.cloud.clouds.vsphere.avail_images()

Return a dict of all available VM images on the cloud provider.

salt.cloud.clouds.vsphere.avail_locations()

Return a dict of all available VM locations on the cloud provider with relevant data

salt.cloud.clouds.vsphere.create(vm_)

Create a single VM from a data dict

salt.cloud.clouds.vsphere.destroy(name, call=None)

Destroy a node.

CLI Example:

salt-cloud --destroy mymachine
salt.cloud.clouds.vsphere.get_configured_provider()

Return the first configured instance.

salt.cloud.clouds.vsphere.get_conn()

Return a conn object for the passed VM data

salt.cloud.clouds.vsphere.list_clusters(kwargs=None, call=None)

List the clusters for this VMware environment

salt.cloud.clouds.vsphere.list_datacenters(kwargs=None, call=None)

List the data centers for this VMware environment

salt.cloud.clouds.vsphere.list_datastores(kwargs=None, call=None)

List the datastores for this VMware environment

salt.cloud.clouds.vsphere.list_folders(kwargs=None, call=None)

List the folders for this VMWare environment

salt.cloud.clouds.vsphere.list_hosts(kwargs=None, call=None)

List the hosts for this VMware environment

salt.cloud.clouds.vsphere.list_nodes()

Return a list of the VMs that are on the provider

salt.cloud.clouds.vsphere.list_nodes_full()

Return a list of the VMs that are on the provider

salt.cloud.clouds.vsphere.list_nodes_min()

Return a list of the nodes in the provider, with no details

salt.cloud.clouds.vsphere.list_nodes_select()

Return a list of the VMs that are on the provider, with select fields

salt.cloud.clouds.vsphere.list_resourcepools(kwargs=None, call=None)

List the hosts for this VMware environment

salt.cloud.clouds.vsphere.script(vm_)

Return the script deployment object

salt.cloud.clouds.vsphere.show_instance(name, call=None)

Show the details from vSphere concerning a guest