saltext.vmware.utils.esxi#
- saltext.vmware.utils.esxi.get_hosts(service_instance, datacenter_name=None, host_names=None, cluster_name=None, get_all_hosts=False)[source]#
Returns a list of vim.HostSystem objects representing ESXi hosts in a vcenter filtered by their names and/or datacenter, cluster membership.
- service_instance
The Service Instance Object from which to obtain the hosts.
- datacenter_name
The datacenter name. Default is None.
- host_names
The host_names to be retrieved. Default is None.
- cluster_name
The cluster name - used to restrict the hosts retrieved. Only used if the datacenter is set. This argument is optional.
- get_all_hosts
Specifies whether to retrieve all hosts in the container. Default value is False.
- saltext.vmware.utils.esxi.configure_host_cache(host_ref, datastore_ref, swap_size_MiB, host_cache_manager=None)[source]#
Configures the host cahe of the specified host
- host_ref
The vim.HostSystem object representing the host that contains the requested disks.
- datastore_ref
The vim.Datastore opject representing the datastore the host cache will be configured on.
- swap_size_MiB
The size in Mibibytes of the swap.
- host_cache_manager
The vim.HostCacheConfigurationManager object representing the cache configuration manager on the specified host. Default is None. If None, it will be retrieved in the method
- saltext.vmware.utils.esxi.list_hosts(service_instance)[source]#
Returns a list of hosts associated with a given service instance.
- service_instance
The Service Instance Object from which to obtain hosts.
- saltext.vmware.utils.esxi.disconnect_host(host, service_instance)[source]#
Disconnects host from vCenter instance
Returns connection state of host
- host
Name of ESXi instance in vCenter.
- service_instance
The Service Instance Object from which to obtain host.
- saltext.vmware.utils.esxi.reconnect_host(host, service_instance)[source]#
Reconnects host from vCenter instance
Returns connection state of host
- host
Name of ESXi instance in vCenter.
- service_instance
The Service Instance Object from which to obtain host.
- saltext.vmware.utils.esxi.move_host(host, cluster_name, service_instance)[source]#
Move host to a different cluster.
Returns connection state of host
- host
Name of ESXi instance in vCenter.
- cluster_name
Name of cluster to move host to.
- service_instance
The Service Instance Object from which to obtain host.
- saltext.vmware.utils.esxi.remove_host(host, service_instance)[source]#
Removes host from vCenter instance.
Returns connection state of host
- host
Name of ESXi instance in vCenter.
- service_instance
The Service Instance Object from which to obtain host.
- saltext.vmware.utils.esxi.add_host(host, root_user, password, cluster_name, datacenter_name, verify_host_cert, connect, service_instance)[source]#
Adds host from vCenter instance
Returns connection state of host
- host
IP address or hostname of ESXI instance.
- root_user
Username with root privilege to ESXi instance.
- password
Password to root user.
- cluster_name
Name of cluster ESXi host is being added to.
- datacenter
Datacenter that contains cluster that ESXi instance is being added to.
- verify_host_cert
Validates the host’s SSL certificate is signed by a CA, and that the hostname in the certificate matches the host.
- connect
Specifies whether host should be connected after being added.
- service_instance
The Service Instance Object to place host on.