neulab/tldr huggingface dataset:
salt.modules.vsphere.get_proxy_type() Returns the proxy type retrieved either from the pillar of from the proxy minion's config.  Returns <undefined> otherwise.
salt '*' vsphere.get_proxy_type
salt.modules.vsphere.get_service_instance_via_proxy(service_instance=None) Returns a service instance to the proxied endpoint (vCenter/ESXi host).
NOTE: Should be used by state functions not invoked directly.
CLI Example: See note above
salt.modules.vsphere.get_service_policy(host, username, password, service_name, protocol=None, port=None, host_names=None, verify_ssl=True) Get the service name's policy for a given host or list of hosts.
service_name
The name of the service for which to retrieve the policy. Supported service names are:
• DCUI
• TSM
• SSH
• lbtd
• lsassd
• lwiod
• netlogond
• ntpd
• sfcbd-watchdog
• snmpd
• vprobed
• vpxa
• xorg
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter the hosts for which to get service policy information.
If host_names is not provided, the service policy information will be retrieved for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
# Used for single ESXi host connection information salt '*' vsphere.get_service_policy my.esxi.host root bad-password 'ssh'
# Used for connecting to a vCenter Server salt '*' vsphere.get_service_policy my.vcenter.location root bad-password 'ntpd'         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.get_service_running(host, username, password, service_name, protocol=None, port=None, host_names=None, verify_ssl=True) Get the service name's running state for a given host or list of hosts.
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter the hosts for which to get the service's running state.
If host_names is not provided, the service's running state will be retrieved for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
# Used for single ESXi host connection information salt '*' vsphere.get_service_running my.esxi.host root bad-password 'ssh'
# Used for connecting to a vCenter Server salt '*' vsphere.get_service_running my.vcenter.location root bad-password 'ntpd'         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.get_ssh_key(host, username, password, protocol=None, port=None, certificate_verify=None) Retrieve the authorized_keys entry for root.  This function only works for ESXi, not vCenter.
• host -- The location of the ESXi Host
• username -- Username to connect as
• password -- Password for the ESXi web endpoint
• protocol -- defaults to https, can be http if ssl is disabled on ESXi
• port -- defaults to 443 for https
• certificate_verify -- If true require that the SSL connection present a valid certificate. Default: True
Returns True if upload is successful
salt '*' vsphere.get_ssh_key my.esxi.host root bad-password certificate_verify=True
salt.modules.vsphere.get_syslog_config(host, username, password, protocol=None, port=None, esxi_hosts=None, credstore=None) Retrieve the syslog configuration.
Returns Dictionary with keys and values corresponding to the syslog configuration, per host.
# Used for ESXi host connection information salt '*' vsphere.get_syslog_config my.esxi.host root bad-password
# Used for connecting to a vCenter Server salt '*' vsphere.get_syslog_config my.vcenter.location root bad-password             esxi_hosts='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.get_vm(name, datacenter=None, vm_properties=None, traversal_spec=None, parent_ref=None, service_instance=None) Returns vm object properties.
name   Name of the virtual machine.
datacenter Datacenter name
vm_properties List of vm properties.
traversal_spec Traversal Spec object(s) for searching.
parent_ref Container Reference object for searching under a given object.
salt.modules.vsphere.get_vm_config(name, datacenter=None, objects=True, service_instance=None) Queries and converts the virtual machine properties to the available format from the schema. If the objects attribute is True the config objects will have extra properties, like 'object' which will include the vim.vm.device.VirtualDevice, this is necessary for deletion and update actions.
datacenter Datacenter's name where the virtual machine is available
objects Indicates whether to return the vmware object properties (eg. object, key) or just the properties which can be set
salt.modules.vsphere.get_vm_config_file(name, datacenter, placement, datastore, service_instance=None) Queries the virtual machine config file and returns vim.host.DatastoreBrowser.SearchResults object on success None on failure
datastore Datastore where the virtual machine files are stored
salt.modules.vsphere.get_vmotion_enabled(host, username, password, protocol=None, port=None, host_names=None, verify_ssl=True) Get the VMotion enabled status for a given host or a list of host_names. Returns True if VMotion is enabled, False if it is not enabled.
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter which hosts to check if VMotion is enabled.
If host_names is not provided, the VMotion status will be retrieved for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
# Used for single ESXi host connection information salt '*' vsphere.get_vmotion_enabled my.esxi.host root bad-password
# Used for connecting to a vCenter Server salt '*' vsphere.get_vmotion_enabled my.vcenter.location root bad-password         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.get_vsan_eligible_disks(host, username, password, protocol=None, port=None, host_names=None, verify_ssl=True) Returns a list of VSAN-eligible disks for a given host or list of host_names.
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter which hosts to check if any VSAN-eligible disks are available.
If host_names is not provided, the VSAN-eligible disks will be retrieved for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
# Used for single ESXi host connection information salt '*' vsphere.get_vsan_eligible_disks my.esxi.host root bad-password
# Used for connecting to a vCenter Server salt '*' vsphere.get_vsan_eligible_disks my.vcenter.location root bad-password         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.get_vsan_enabled(host, username, password, protocol=None, port=None, host_names=None, verify_ssl=True) Get the VSAN enabled status for a given host or a list of host_names. Returns True if VSAN is enabled, False if it is not enabled, and None if a VSAN Host Config is unset, per host.
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter which hosts to check if VSAN enabled.
If host_names is not provided, the VSAN status will be retrieved for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
# Used for single ESXi host connection information salt '*' vsphere.get_vsan_enabled my.esxi.host root bad-password
# Used for connecting to a vCenter Server salt '*' vsphere.get_vsan_enabled my.vcenter.location root bad-password         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.list_assigned_licenses(entity, entity_display_name, license_keys=None, service_instance=None) Lists the licenses assigned to an entity
entity Dictionary representation of an entity.  See _get_entity docstrings for format.
license_keys: List of license keys to be retrieved. Default is None.
salt '*' vsphere.list_assigned_licenses entity={type:cluster,datacenter:dc,cluster:cl} entiy_display_name=cl
salt.modules.vsphere.list_attached_tags(object_id, managed_obj='ClusterComputeResource', server=None, username=None, password=None, service_instance=None, verify_ssl=None, ca_bundle=None) List existing tags a user has access to.
salt vm_minion vsphere.list_attached_tags domain-c2283
salt.modules.vsphere.list_capability_definitions(service_instance=None) Returns a list of the metadata of all capabilities in the vCenter.
salt '*' vsphere.list_capabilities
salt.modules.vsphere.list_cluster(datacenter=None, cluster=None, service_instance=None) Returns a dict representation of an ESX cluster.
# vcenter proxy salt '*' vsphere.list_cluster datacenter=dc1 cluster=cl1
# esxdatacenter proxy salt '*' vsphere.list_cluster cluster=cl1
# esxcluster proxy salt '*' vsphere.list_cluster
salt.modules.vsphere.list_clusters(host, username, password, protocol=None, port=None, verify_ssl=True) Returns a list of clusters for the specified host.
salt '*' vsphere.list_clusters 1.2.3.4 root bad-password
salt.modules.vsphere.list_datacenters(host, username, password, protocol=None, port=None, verify_ssl=True) Returns a list of datacenters for the specified host.
salt '*' vsphere.list_datacenters 1.2.3.4 root bad-password
salt.modules.vsphere.list_datacenters_via_proxy(datacenter_names=None, service_instance=None) Returns a list of dict representations of VMware datacenters. Connection is done via the proxy details.
datacenter_names List of datacenter names.  Default is None.
salt '*' vsphere.list_datacenters_via_proxy
salt '*' vsphere.list_datacenters_via_proxy dc1
salt '*' vsphere.list_datacenters_via_proxy dc1,dc2
salt '*' vsphere.list_datacenters_via_proxy datacenter_names=[dc1, dc2]
salt.modules.vsphere.list_datastore_clusters(host, username, password, protocol=None, port=None, verify_ssl=True) Returns a list of datastore clusters for the specified host.
salt '*' vsphere.list_datastore_clusters 1.2.3.4 root bad-password
salt.modules.vsphere.list_datastores(host, username, password, protocol=None, port=None, verify_ssl=True) Returns a list of datastores for the specified host.
salt '*' vsphere.list_datastores 1.2.3.4 root bad-password
salt.modules.vsphere.list_datastores_via_proxy(datastore_names=None, backing_disk_ids=None, backing_disk_scsi_addresses=None, service_instance=None) Returns a list of dict representations of the datastores visible to the proxy object. The list of datastores can be filtered by datastore names, backing disk ids (canonical names) or backing disk scsi addresses.
Supported proxy types: esxi, esxcluster, esxdatacenter
datastore_names List of the names of datastores to filter on
backing_disk_ids List of canonical names of the backing disks of the datastores to filer.  Default is None.
backing_disk_scsi_addresses List of scsi addresses of the backing disks of the datastores to filter.  Default is None.
salt '*' vsphere.list_datastores_via_proxy
salt '*' vsphere.list_datastores_via_proxy datastore_names=[ds1, ds2]
salt.modules.vsphere.list_default_storage_policy_of_datastore(datastore, service_instance=None) Returns a list of datastores assign the storage policies.
salt '*' vsphere.list_default_storage_policy_of_datastore datastore=ds1
salt.modules.vsphere.list_default_vsan_policy(service_instance=None) Returns the default vsan storage policy.
salt '*' vsphere.list_storage_policies
salt '*' vsphere.list_storage_policy policy_names=[policy_name]
salt.modules.vsphere.list_disk_partitions(disk_id=None, scsi_address=None, service_instance=None) Lists the partitions on a disk.  The disk can be specified either by the canonical name, or by the scsi_address.
scsi_address` Scsi address of the disk.  disk_id or scsi_address needs to be specified (disk_id supersedes scsi_address.
salt '*' vsphere.list_disk_partitions scsi_address='vmhaba0:C0:T0:L0'
salt '*' vsphere.list_disk_partitions disk_id='naa.000000000000001'
salt.modules.vsphere.list_diskgroups(cache_disk_ids=None, service_instance=None) Returns a list of disk group dict representation on an ESXi host. The list of disk groups can be filtered by the cache disks canonical names. If no filtering is applied, all disk groups are returned.
cache_disk_ids: List of cache disk canonical names of the disk groups to be retrieved.  Default is None.
use_proxy_details Specify whether to use the proxy minion's details instead of the arguments
salt '*' vsphere.list_diskgroups
salt '*' vsphere.list_diskgroups cache_disk_ids='[naa.000000000000001]'
salt.modules.vsphere.list_disks(disk_ids=None, scsi_addresses=None, service_instance=None) Returns a list of dict representations of the disks in an ESXi host.  The list of disks can be filtered by disk canonical names or scsi addresses.
disk_ids: List of disk canonical names to be retrieved. Default is None.
scsi_addresses List of scsi addresses of disks to be retrieved. Default is None
salt '*' vsphere.list_disks
salt '*' vsphere.list_disks disk_ids='[naa.00, naa.001]'
salt '*' vsphere.list_disks scsi_addresses='[vmhba0:C0:T0:L0, vmhba1:C0:T0:L0]'
salt.modules.vsphere.list_dvportgroups(dvs=None, portgroup_names=None, service_instance=None) Returns a list of distributed virtual switch portgroups.  The list can be filtered by the portgroup names or by the DVS.
dvs    Name of the DVS containing the portgroups.  Default value is None.
portgroup_names List of portgroup names to look for. If None, all portgroups are returned.  Default value is None
salt '*' vsphere.list_dvporgroups
salt '*' vsphere.list_dvportgroups dvs=dvs1
salt '*' vsphere.list_dvportgroups portgroup_names=[pg1]
salt '*' vsphere.list_dvportgroups dvs=dvs1 portgroup_names=[pg1]
salt.modules.vsphere.list_dvs(host, username, password, protocol=None, port=None, verify_ssl=True) Returns a list of distributed virtual switches for the specified host.
salt '*' vsphere.list_dvs 1.2.3.4 root bad-password
salt.modules.vsphere.list_dvss(datacenter=None, dvs_names=None, service_instance=None) Returns a list of distributed virtual switches (DVSs).  The list can be filtered by the datacenter or DVS names.
datacenter The datacenter to look for DVSs in.  Default value is None.
dvs_names List of DVS names to look for. If None, all DVSs are returned.  Default value is None.
salt '*' vsphere.list_dvss
salt '*' vsphere.list_dvss dvs_names=[dvs1,dvs2]
salt.modules.vsphere.list_folders(host, username, password, protocol=None, port=None, verify_ssl=True) Returns a list of folders for the specified host.
salt '*' vsphere.list_folders 1.2.3.4 root bad-password
salt.modules.vsphere.list_hosts(host, username, password, protocol=None, port=None, verify_ssl=True) Returns a list of hosts for the specified VMware environment.
salt '*' vsphere.list_hosts 1.2.3.4 root bad-password
salt.modules.vsphere.list_hosts_via_proxy(hostnames=None, datacenter=None, cluster=None, service_instance=None) Returns a list of hosts for the specified VMware environment. The list of hosts can be filtered by datacenter name and/or cluster name
hostnames Hostnames to filter on.
datacenter_name Name of datacenter. Only hosts in this datacenter will be retrieved.  Default is None.
cluster_name Name of cluster. Only hosts in this cluster will be retrieved. If a datacenter is not specified the first cluster with this name will be considerred. Default is None.
salt '*' vsphere.list_hosts_via_proxy
salt '*' vsphere.list_hosts_via_proxy hostnames=[esxi1.example.com]
salt '*' vsphere.list_hosts_via_proxy datacenter=dc1 cluster=cluster1
salt.modules.vsphere.list_licenses(service_instance=None) Lists all licenses on a vCenter.
salt '*' vsphere.list_licenses
salt.modules.vsphere.list_networks(host, username, password, protocol=None, port=None, verify_ssl=True) Returns a list of networks for the specified host.
salt '*' vsphere.list_networks 1.2.3.4 root bad-password
salt.modules.vsphere.list_non_ssds(host, username, password, protocol=None, port=None, host_names=None, verify_ssl=True) Returns a list of Non-SSD disks for the given host or list of host_names.
NOTE: In the pyVmomi StorageSystem, ScsiDisks may, or may not have an ssd attribute.  This attribute indicates if the ScsiDisk is SSD backed. As this option is optional, if a relevant disk in the StorageSystem does not have ssd = true, it will end up in the non_ssds list here.
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter the hosts for which to retrieve Non-SSD disks.
If host_names is not provided, Non-SSD disks will be retrieved for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
# Used for single ESXi host connection information salt '*' vsphere.list_non_ssds my.esxi.host root bad-password
# Used for connecting to a vCenter Server salt '*' vsphere.list_non_ssds my.vcenter.location root bad-password         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.list_resourcepools(host, username, password, protocol=None, port=None, verify_ssl=True) Returns a list of resource pools for the specified host.
salt '*' vsphere.list_resourcepools 1.2.3.4 root bad-password
salt.modules.vsphere.list_ssds(host, username, password, protocol=None, port=None, host_names=None, verify_ssl=True) Returns a list of SSDs for the given host or list of host_names.
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter the hosts for which to retrieve SSDs.
If host_names is not provided, SSDs will be retrieved for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
# Used for single ESXi host connection information salt '*' vsphere.list_ssds my.esxi.host root bad-password
# Used for connecting to a vCenter Server salt '*' vsphere.list_ssds my.vcenter.location root bad-password         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.list_storage_policies(policy_names=None, service_instance=None) Returns a list of storage policies.
policy_names Names of policies to list. If None, all policies are listed.  Default is None.
salt.modules.vsphere.list_tag_categories(server=None, username=None, password=None, service_instance=None, verify_ssl=None, ca_bundle=None) List existing categories a user has access to.
salt vm_minion vsphere.list_tag_categories
Returns Value(s) of category_id.
salt.modules.vsphere.list_tags(server=None, username=None, password=None, service_instance=None, verify_ssl=None, ca_bundle=None) List existing tags a user has access to.
salt vm_minion vsphere.list_tags
Returns Value(s) of tag_id.
salt.modules.vsphere.list_uplink_dvportgroup(dvs, service_instance=None) Returns the uplink portgroup of a distributed virtual switch.
dvs    Name of the DVS containing the portgroup.
salt '*' vsphere.list_uplink_dvportgroup dvs=dvs_name
salt.modules.vsphere.list_vapps(host, username, password, protocol=None, port=None, verify_ssl=True) Returns a list of vApps for the specified host.
# List vapps from all minions salt '*' vsphere.list_vapps 1.2.3.4 root bad-password
salt.modules.vsphere.list_vms(host, username, password, protocol=None, port=None, verify_ssl=True) Returns a list of VMs for the specified host.
salt '*' vsphere.list_vms 1.2.3.4 root bad-password
salt.modules.vsphere.power_off_vm(name, datacenter=None, service_instance=None) Powers off a virtual machine specified by its name.
salt '*' vsphere.power_off_vm name=my_vm
salt.modules.vsphere.power_on_vm(name, datacenter=None, service_instance=None) Powers on a virtual machine specified by its name.
salt '*' vsphere.power_on_vm name=my_vm
salt.modules.vsphere.register_vm(name, datacenter, placement, vmx_path, service_instance=None) Registers a virtual machine to the inventory with the given vmx file.  Returns comments and change list
placement Placement dictionary of the virtual machine, host or cluster
vmx_path: Full path to the vmx file, datastore name should be included
salt.modules.vsphere.remove_capacity_from_diskgroup(cache_disk_id, capacity_disk_ids, data_evacuation=True, safety_checks=True, service_instance=None) Remove capacity disks from the disk group with the specified cache disk.
data_evacuation Specifies whether to gracefully evacuate the data on the capacity disks before removing them from the disk group. Default value is True.
salt '*' vsphere.remove_capacity_from_diskgroup cache_disk_id='naa.000000000000001' capacity_disk_ids='[naa.000000000000002, naa.000000000000003]'
salt.modules.vsphere.remove_datastore(datastore, service_instance=None) Removes a datastore. If multiple datastores an error is raised.
datastore Datastore name
salt '*' vsphere.remove_datastore ds_name
salt.modules.vsphere.remove_diskgroup(cache_disk_id, data_accessibility=True, service_instance=None) Remove the diskgroup with the specified cache disk.
data_accessibility Specifies whether to ensure data accessibility. Default value is True.
salt '*' vsphere.remove_diskgroup cache_disk_id='naa.000000000000001'
salt.modules.vsphere.remove_dvportgroup(portgroup, dvs, service_instance=None) Removes a distributed virtual portgroup.
portgroup Name of the portgroup to be removed.
dvs    Name of the DVS containing the portgroups.
salt '*' vsphere.remove_dvportgroup portgroup=pg1 dvs=dvs1
salt.modules.vsphere.rename_datastore(datastore_name, new_datastore_name, service_instance=None) Renames a datastore. The datastore needs to be visible to the proxy.
datastore_name Current datastore name.
new_datastore_name New datastore name.
salt '*' vsphere.rename_datastore old_name new_name
salt.modules.vsphere.reset_syslog_config(host, username, password, protocol=None, port=None, syslog_config=None, esxi_hosts=None, credstore=None) Reset the syslog service to its default settings.
Valid syslog_config values are logdir, loghost, logdir-unique, default-rotate, default-size, default-timeout, or all for all of these.
syslog_config List of parameters to reset, provided as a comma-delimited string, or 'all' to reset all syslog configuration parameters. Required.
Returns Dictionary with a top-level key of 'success' which indicates if all the parameters were reset, and individual keys for each parameter indicating which succeeded or failed, per host.
syslog_config can be passed as a quoted, comma-separated string, e.g.
# Used for ESXi host connection information salt '*' vsphere.reset_syslog_config my.esxi.host root bad-password             syslog_config='logdir,loghost'
# Used for connecting to a vCenter Server salt '*' vsphere.reset_syslog_config my.vcenter.location root bad-password             syslog_config='logdir,loghost' esxi_hosts='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.service_restart(host, username, password, service_name, protocol=None, port=None, host_names=None, verify_ssl=True) Restart the named service for the given host or list of hosts.
The name of the service for which to set the policy. Supported service names are:
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter the hosts for which to restart the service.
If host_names is not provided, the service will be restarted for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
# Used for single ESXi host connection information salt '*' vsphere.service_restart my.esxi.host root bad-password 'ntpd'
# Used for connecting to a vCenter Server salt '*' vsphere.service_restart my.vcenter.location root bad-password 'ntpd'         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.service_start(host, username, password, service_name, protocol=None, port=None, host_names=None, verify_ssl=True) Start the named service for the given host or list of hosts.
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter the hosts for which to start the service.
If host_names is not provided, the service will be started for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
# Used for single ESXi host connection information salt '*' vsphere.service_start my.esxi.host root bad-password 'ntpd'
# Used for connecting to a vCenter Server salt '*' vsphere.service_start my.vcenter.location root bad-password 'ntpd'         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.service_stop(host, username, password, service_name, protocol=None, port=None, host_names=None, verify_ssl=True) Stop the named service for the given host or list of hosts.
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter the hosts for which to stop the service.
If host_names is not provided, the service will be stopped for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
# Used for single ESXi host connection information salt '*' vsphere.service_stop my.esxi.host root bad-password 'ssh'
# Used for connecting to a vCenter Server salt '*' vsphere.service_stop my.vcenter.location root bad-password 'ssh'         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.set_advanced_configs(vm_name, datacenter, advanced_configs, service_instance=None) Appends extra config parameters to a virtual machine advanced config list
advanced_configs Dictionary with advanced parameter key value pairs
salt.modules.vsphere.set_coredump_network_config(host, username, password, dump_ip, protocol=None, port=None, host_vnic='vmk0', dump_port=6500, esxi_hosts=None, credstore=None) Set the network parameters for a network coredump collection. Note that ESXi requires that the dumps first be enabled (see coredump_network_enable) before these parameters may be set.
dump_ip IP address of host that will accept the dump.
host_vnic Host VNic port through which to communicate. Defaults to vmk0.
dump_port TCP port to use for the dump, defaults to 6500.
Returns A standard cmd.run_all dictionary with a success key added, per host.  success will be True if the set succeeded, False otherwise.
# Used for ESXi host connection information salt '*' vsphere.set_coredump_network_config my.esxi.host root bad-password 'dump_ip.host.com'
# Used for connecting to a vCenter Server salt '*' vsphere.set_coredump_network_config my.vcenter.location root bad-password 'dump_ip.host.com'             esxi_hosts='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.set_ntp_config(host, username, password, ntp_servers, protocol=None, port=None, host_names=None, verify_ssl=True) Set NTP configuration for a given host of list of host_names.
ntp_servers A list of servers that should be added to and configured for the specified host's NTP configuration.
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter which hosts to configure ntp servers.
If host_names is not provided, the NTP servers will be configured for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
# Used for single ESXi host connection information salt '*' vsphere.ntp_configure my.esxi.host root bad-password '[192.174.1.100, 192.174.1.200]'
# Used for connecting to a vCenter Server salt '*' vsphere.ntp_configure my.vcenter.location root bad-password '[192.174.1.100, 192.174.1.200]'         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.set_service_policy(host, username, password, service_name, service_policy, protocol=None, port=None, host_names=None, verify_ssl=True) Set the service name's policy for a given host or list of hosts.
service_policy The policy to set for the service. For example, 'automatic'.
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter the hosts for which to set the service policy.
# Used for single ESXi host connection information salt '*' vsphere.set_service_policy my.esxi.host root bad-password 'ntpd' 'automatic'
# Used for connecting to a vCenter Server salt '*' vsphere.set_service_policy my.vcenter.location root bad-password 'ntpd' 'automatic'         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.set_syslog_config(host, username, password, syslog_config, config_value, protocol=None, port=None, firewall=True, reset_service=True, esxi_hosts=None, credstore=None) Set the specified syslog configuration parameter. By default, this function will reset the syslog service after the configuration is set.
host   ESXi or vCenter host to connect to.
username User to connect as, usually root.
password Password to connect with.
syslog_config Name of parameter to set (corresponds to the command line switch for esxcli without the double dashes (--))
Valid syslog_config values are logdir, loghost, default-rotate`, ``default-size, default-timeout, and logdir-unique.
config_value Value for the above parameter. For loghost, URLs or IP addresses to use for logging. Multiple log servers can be specified by listing them, comma-separated, but without spaces before or after commas.
(reference: https://blogs.vmware.com/vsphere/2012/04/configuring-multiple-syslog-servers-for-esxi-5.html)
firewall Enable the firewall rule set for syslog. Defaults to True.
reset_service After a successful parameter set, reset the service. Defaults to True.
# Used for ESXi host connection information salt '*' vsphere.set_syslog_config my.esxi.host root bad-password             loghost ssl://localhost:5432,tcp://10.1.0.1:1514
# Used for connecting to a vCenter Server salt '*' vsphere.set_syslog_config my.vcenter.location root bad-password             loghost ssl://localhost:5432,tcp://10.1.0.1:1514             esxi_hosts='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.syslog_service_reload(host, username, password, protocol=None, port=None, esxi_hosts=None, credstore=None) Reload the syslog service so it will pick up any changes.
Returns A standard cmd.run_all dictionary.  This dictionary will at least have a retcode key.  If retcode is 0 the command was successful.
# Used for ESXi host connection information salt '*' vsphere.syslog_service_reload my.esxi.host root bad-password
# Used for connecting to a vCenter Server salt '*' vsphere.syslog_service_reload my.vcenter.location root bad-password             esxi_hosts='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.system_info(host, username, password, protocol=None, port=None, verify_ssl=True) Return system information about a VMware environment.
salt '*' vsphere.system_info 1.2.3.4 root bad-password
salt.modules.vsphere.test_vcenter_connection(service_instance=None) Checks if a connection is to a vCenter
salt '*' vsphere.test_vcenter_connection
salt.modules.vsphere.unregister_vm(name, datacenter, placement=None, power_off=False, service_instance=None) Unregisters a virtual machine defined by name and placement
salt '*' vsphere.unregister_vm name=my_vm datacenter=my_datacenter
salt.modules.vsphere.update_cluster(cluster_dict, datacenter=None, cluster=None, service_instance=None) Updates a cluster.
# esxdatacenter proxy salt '*' vsphere.update_cluster cluster_dict=$cluster_dict cluster=cl1
# esxcluster proxy salt '*' vsphere.update_cluster cluster_dict=$cluster_dict
salt.modules.vsphere.update_dvportgroup(portgroup_dict, portgroup, dvs, service_instance=True) Updates a distributed virtual portgroup.
portgroup_dict Dictionary with the values the portgroup should be update with (example in salt.states.dvs).
portgroup Name of the portgroup to be updated.
salt '*' vsphere.update_dvportgroup portgroup_dict=<dict> portgroup=pg1
salt '*' vsphere.update_dvportgroup portgroup_dict=<dict> portgroup=pg1 dvs=dvs1
salt.modules.vsphere.update_dvs(dvs_dict, dvs, service_instance=None) Updates a distributed virtual switch (DVS).
Note: Updating the product info, capability, uplinks of a DVS is not supported so the corresponding entries in dvs_dict will be ignored.
dvs_dict Dictionary with the values the DVS should be update with (example in salt.states.dvs)
dvs    Name of the DVS to be updated.
salt '*' vsphere.update_dvs dvs_dict=$dvs_dict dvs=dvs1
salt.modules.vsphere.update_host_datetime(host, username, password, protocol=None, port=None, host_names=None, verify_ssl=True) Update the date/time on the given host or list of host_names. This function should be used with caution since network delays and execution delays can result in time skews.
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter which hosts should update their date/time.
If host_names is not provided, the date/time will be updated for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
# Used for single ESXi host connection information salt '*' vsphere.update_date_time my.esxi.host root bad-password
# Used for connecting to a vCenter Server salt '*' vsphere.update_date_time my.vcenter.location root bad-password         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.update_host_password(host, username, password, new_password, protocol=None, port=None, verify_ssl=True) Update the password for a given host.
NOTE: Currently only works with connections to ESXi hosts. Does not work with vCenter servers.
host   The location of the ESXi host.
username The username used to login to the ESXi host, such as root.
password The password used to login to the ESXi host.
new_password The new password that will be updated for the provided username on the ESXi host.
salt '*' vsphere.update_host_password my.esxi.host root original-bad-password new-bad-password
salt.modules.vsphere.update_storage_policy(policy, policy_dict, service_instance=None) Updates a storage policy.
policy Name of the policy to update.
salt '*' vsphere.update_storage_policy policy='policy name' policy_dict="$policy_dict"
salt.modules.vsphere.update_vm(vm_name, cpu=None, memory=None, image=None, version=None, interfaces=None, disks=None, scsi_devices=None, serial_ports=None, datacenter=None, datastore=None, cd_dvd_drives=None, sata_controllers=None, advanced_configs=None, service_instance=None) Updates the configuration of the virtual machine if the config differs
vm_name Virtual Machine name to be updated
cpu    CPU configuration options
memory Memory configuration options
interfaces Network interfaces configuration options
disks  Disks configuration options
scsi_devices SCSI devices configuration options
serial_ports Serial ports configuration options
datacenter Datacenter where the virtual machine is available
datastore Datastore where the virtual machine config files are available
cd_dvd_drives CD/DVD drives configuration options
salt.modules.vsphere.upload_ssh_key(host, username, password, ssh_key=None, ssh_key_file=None, protocol=None, port=None, certificate_verify=None) Upload an ssh key for root to an ESXi host via http PUT.  This function only works for ESXi, not vCenter.  Only one ssh key can be uploaded for root.  Uploading a second key will replace any existing key.
• ssh_key -- Public SSH key, will be added to authorized_keys on ESXi
• ssh_key_file -- File containing the SSH key.  Use 'ssh_key' or ssh_key_file, but not both.
Returns Dictionary with a 'status' key, True if upload is successful.  If upload is unsuccessful, 'status' key will be False and an 'Error' key will have an informative message.
salt '*' vsphere.upload_ssh_key my.esxi.host root bad-password ssh_key_file='/etc/salt/my_keys/my_key.pub'
salt.modules.vsphere.vmotion_disable(host, username, password, protocol=None, port=None, host_names=None, verify_ssl=True) Disable vMotion for a given host or list of host_names.
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter which hosts should disable VMotion.
If host_names is not provided, VMotion will be disabled for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
# Used for single ESXi host connection information salt '*' vsphere.vmotion_disable my.esxi.host root bad-password
# Used for connecting to a vCenter Server salt '*' vsphere.vmotion_disable my.vcenter.location root bad-password         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.vmotion_enable(host, username, password, protocol=None, port=None, host_names=None, device='vmk0', verify_ssl=True) Enable vMotion for a given host or list of host_names.
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter which hosts should enable VMotion.
If host_names is not provided, VMotion will be enabled for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
device The device that uniquely identifies the VirtualNic that will be used for VMotion for each host. Defaults to vmk0.
# Used for single ESXi host connection information salt '*' vsphere.vmotion_enable my.esxi.host root bad-password
# Used for connecting to a vCenter Server salt '*' vsphere.vmotion_enable my.vcenter.location root bad-password         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.vsan_add_disks(host, username, password, protocol=None, port=None, host_names=None, verify_ssl=True) Add any VSAN-eligible disks to the VSAN System for the given host or list of host_names.
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter which hosts need to add any VSAN-eligible disks to the host's VSAN system.
If host_names is not provided, VSAN-eligible disks will be added to the hosts's VSAN system for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
# Used for single ESXi host connection information salt '*' vsphere.vsan_add_disks my.esxi.host root bad-password
# Used for connecting to a vCenter Server salt '*' vsphere.vsan_add_disks my.vcenter.location root bad-password         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.vsan_disable(host, username, password, protocol=None, port=None, host_names=None, verify_ssl=True) Disable VSAN for a given host or list of host_names.
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter which hosts should disable VSAN.
If host_names is not provided, VSAN will be disabled for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
# Used for single ESXi host connection information salt '*' vsphere.vsan_disable my.esxi.host root bad-password
# Used for connecting to a vCenter Server salt '*' vsphere.vsan_disable my.vcenter.location root bad-password         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.vsphere.vsan_enable(host, username, password, protocol=None, port=None, host_names=None, verify_ssl=True) Enable VSAN for a given host or list of host_names.
host_names List of ESXi host names. When the host, username, and password credentials are provided for a vCenter Server, the host_names argument is required to tell vCenter which hosts should enable VSAN.
If host_names is not provided, VSAN will be enabled for the host location instead. This is useful for when service instance connection information is used for a single ESXi host.
# Used for single ESXi host connection information salt '*' vsphere.vsan_enable my.esxi.host root bad-password
# Used for connecting to a vCenter Server salt '*' vsphere.vsan_enable my.vcenter.location root bad-password         host_names='[esxi-1.host.com, esxi-2.host.com]'
salt.modules.webutil Support for htpasswd command. Requires the apache2-utils package for Debian-based distros.
The functions here will load inside the webutil module. This allows other functions that don't use htpasswd to use the webutil module name.
salt.modules.webutil.useradd(pwfile, user, password, opts='', runas=None) Add a user to htpasswd file using the htpasswd command. If the htpasswd file does not exist, it will be created.
pwfile Path to htpasswd file
user   User name
password User password
opts   Valid options that can be passed are:
• n  Don't update file; display results on stdout.
• m  Force MD5 encryption of the password (default).
• d  Force CRYPT encryption of the password.
• p  Do not encrypt the password (plaintext).
• s  Force SHA encryption of the password.
runas  The system user to run htpasswd command with
salt '*' webutil.useradd /etc/httpd/htpasswd larry badpassword salt '*' webutil.useradd /etc/httpd/htpasswd larry badpass opts=ns
salt.modules.webutil.userdel(pwfile, user, runas=None, all_results=False) Delete a user from the specified htpasswd file.
all_results Return stdout, stderr, and retcode, not just stdout
salt '*' webutil.userdel /etc/httpd/htpasswd larry
salt.modules.webutil.verify(pwfile, user, password, opts='', runas=None) Return True if the htpasswd file exists, the user has an entry, and their password matches.
pwfile Fully qualified path to htpasswd file
salt '*' webutil.verify /etc/httpd/htpasswd larry maybepassword salt '*' webutil.verify /etc/httpd/htpasswd larry maybepassword opts=ns
salt.modules.win_auditpol A salt module for modifying the audit policies on the machine
Though this module does not set group policy for auditing, it displays how all auditing configuration is applied on the machine, either set directly or via local or domain group policy.
New in version 2018.3.4.
New in version 2019.2.1.
This module allows you to view and modify the audit settings as they are applied on the machine. The audit settings are broken down into nine categories:
• Account Logon
• Account Management
• Detailed Tracking
• DS Access
• Logon/Logoff
• Object Access
• Policy Change
• Privilege Use
• System
The get_settings function will return the subcategories for all nine of the above categories in one dictionary along with their auditing status.
To modify a setting you only need to specify the subcategory name and the value you wish to set. Valid settings are:
• No Auditing
• Success
• Failure
• Success and Failure
# Get current state of all audit settings salt * auditpol.get_settings
# Get the current state of all audit settings in the "Account Logon" # category salt * auditpol.get_settings category="Account Logon"
# Get current state of the "Credential Validation" setting salt * auditpol.get_setting name="Credential Validation"
# Set the state of the "Credential Validation" setting to Success and # Failure salt * auditpol.set_setting name="Credential Validation" value="Success and Failure"
# Set the state of the "Credential Validation" setting to No Auditing salt * auditpol.set_setting name="Credential Validation" value="No Auditing"
salt.modules.win_auditpol.get_setting(name) Get the current configuration for the named audit setting
Parameters name (str) -- The name of the setting to retrieve
Returns The current configuration for the named setting
• KeyError -- On invalid setting name
• CommandExecutionError -- If an error is encountered retrieving the settings
# Get current state of the "Credential Validation" setting salt * auditpol.get_setting "Credential Validation"
salt.modules.win_auditpol.get_settings(category='All') Get the current configuration for all audit settings specified in the category
Parameters category (str) --
One of the nine categories to return. Can also be All to return the settings for all categories. Valid options are:
Default value is All
A dictionary containing all subcategories for the specified category along with their current configuration
• KeyError -- On invalid category
# Get current state of all audit settings salt * auditipol.get_settings
# Get the current state of all audit settings in the "Account Logon" # category salt * auditpol.get_settings "Account Logon"
salt.modules.win_auditpol.set_setting(name, value) Set the configuration for the named audit setting
• name (str) -- The name of the setting to configure
• value (str) --
The configuration for the named value. Valid options are:
• KeyError -- On invalid name or value
• CommandExecutionError -- If an error is encountered modifying the setting
# Set the state of the "Credential Validation" setting to Success and # Failure salt * auditpol.set_setting "Credential Validation" "Success and Failure"
# Set the state of the "Credential Validation" setting to No Auditing salt * auditpol.set_setting "Credential Validation" "No Auditing"
salt.modules.win_autoruns Module for listing programs that automatically run on startup (very alpha...not tested on anything but my Win 7x64)
salt.modules.win_autoruns.list_() Get a list of automatically running programs
salt '*' autoruns.list
salt.modules.win_certutil This module allows you to install certificates into the windows certificate manager.
salt '*' certutil.add_store salt://cert.cer "TrustedPublisher"
salt.modules.win_certutil.add_store(source, store, retcode=False, saltenv='base') Add the given cert into the given Certificate Store
source The source certificate file this can be in the form salt://path/to/file
store  The certificate store to add the certificate to
retcode If true, return the retcode instead of stdout. Default is False
saltenv The salt environment to use this is ignored if the path is local
salt '*' certutil.add_store salt://cert.cer TrustedPublisher
salt.modules.win_certutil.del_store(source, store, retcode=False, saltenv='base') Delete the given cert into the given Certificate Store
store  The certificate store to delete the certificate from
salt '*' certutil.del_store salt://cert.cer TrustedPublisher
salt.modules.win_certutil.get_cert_serial(cert_file) Get the serial number of a certificate file
cert_file The certificate file to find the serial for
salt '*' certutil.get_cert_serial <certificate name>
salt.modules.win_certutil.get_stored_cert_serials(store) Get all of the certificate serials in the specified store
store  The store to get all the certificate serials from
salt '*' certutil.get_stored_cert_serials <store>
salt.modules.win_dacl Manage DACLs on Windows
• winreg Python module
salt.modules.win_dacl.add_ace(path, objectType, user, permission, acetype, propagation) add an ace to an object
path:  path to the object (i.e. c:\temp\file, HKEY_LOCAL_MACHINE\SOFTWARE\KEY, etc) user: user to add permission:  permissions for the user acetype:  either allow/deny for each user/permission (ALLOW, DENY) propagation: how the ACE applies to children for Registry Keys and Directories(KEY, KEY&SUBKEYS, SUBKEYS)
allow domain\fakeuser full control on HKLM\\SOFTWARE\\somekey, propagate to this key and subkeys salt 'myminion' win_dacl.add_ace 'HKEY_LOCAL_MACHINE\\SOFTWARE\\somekey' 'Registry' 'domain\fakeuser' 'FULLCONTROL' 'ALLOW' 'KEY&SUBKEYS'
salt.modules.win_dacl.check_ace(path, objectType, user, permission=None, acetype=None, propagation=None, exactPermissionMatch=False) Checks a path to verify the ACE (access control entry) specified exists
• path -- path to the file/reg key
• objectType -- The type of object (FILE, DIRECTORY, REGISTRY)
• user -- user that the ACL is for
• permission -- permission to test for (READ, FULLCONTROL, etc)
• acetype -- the type of ACE (ALLOW or DENY)
• propagation -- the propagation type of the ACE (FILES, FOLDERS, KEY, KEY&SUBKEYS, SUBKEYS, etc)
• exactPermissionMatch -- the ACL must match exactly, IE if READ is specified, the user must have READ exactly and not FULLCONTROL (which also has the READ permission obviously)
Returns (dict): 'Exists' true if the ACE exists, false if it does not
salt 'minion-id' win_dacl.check_ace c:  emp directory <username> fullcontrol