neulab/tldr huggingface dataset:
salt.cloud.clouds.tencentcloud.avail_sizes(call=None) Return Tencent Cloud available instance type
salt-cloud --list-sizes my-tencentcloud-config salt-cloud -f avail_sizes my-tencentcloud-config
salt.cloud.clouds.tencentcloud.create(vm_) Create a single Tencent Cloud instance from a data dict.
Tencent Cloud profiles require a provider, availability_zone, image and size.  Set up profile at /etc/salt/cloud.profiles or /etc/salt/cloud.profiles.d/*.conf:
salt-cloud -p tencentcloud-guangzhou-s1 myinstance
salt.cloud.clouds.tencentcloud.destroy(name, call=None) Destroy a Tencent Cloud instance
salt.cloud.clouds.tencentcloud.get_configured_provider() Return the first configured instance.
salt.cloud.clouds.tencentcloud.get_dependencies() Warn if dependencies aren't met.
salt.cloud.clouds.tencentcloud.get_provider_client(name=None) Return a new provider client
salt.cloud.clouds.tencentcloud.list_availability_zones(call=None) Return all Tencent Cloud availability zones in current region
salt-cloud -f list_availability_zones my-tencentcloud-config
salt.cloud.clouds.tencentcloud.list_custom_images(call=None) Return all Tencent Cloud images in current region
salt-cloud -f list_custom_images my-tencentcloud-config
salt.cloud.clouds.tencentcloud.list_nodes(call=None) Return a list of instances that are on the provider
salt.cloud.clouds.tencentcloud.list_nodes_full(call=None) Return a list of instances that are on the provider, with full details
salt.cloud.clouds.tencentcloud.list_nodes_min(call=None) Return a list of instances that are on the provider, Only names, and their state, is returned.
salt-cloud -f list_nodes_min my-tencentcloud-config
salt.cloud.clouds.tencentcloud.list_nodes_select(call=None) Return a list of instances that are on the provider, with select fields
salt.cloud.clouds.tencentcloud.list_securitygroups(call=None) Return all Tencent Cloud security groups in current region
salt-cloud -f list_securitygroups my-tencentcloud-config
salt.cloud.clouds.tencentcloud.reboot(name, call=None) Reboot a Tencent Cloud instance
salt.cloud.clouds.tencentcloud.script(vm_) Return the script deployment object
salt.cloud.clouds.tencentcloud.show_disk(name, call=None) Show the disk details of Tencent Cloud instance
salt-cloud -a show_disk myinstance
salt.cloud.clouds.tencentcloud.show_image(kwargs, call=None) Show the details of Tencent Cloud image
salt-cloud -f show_image tencentcloud image=img-31tjrtph
salt.cloud.clouds.tencentcloud.show_instance(name, call=None) Show the details of Tencent Cloud instance
salt.cloud.clouds.tencentcloud.start(name, call=None) Start a Tencent Cloud instance Notice: the instance state must be stopped
salt.cloud.clouds.tencentcloud.stop(name, force=False, call=None) Stop a Tencent Cloud running instance Note: use force=True to make force stop
salt.cloud.clouds.vagrant Vagrant Cloud Driver The Vagrant cloud is designed to "vagrant up" a virtual machine as a Salt minion.
Use of this module requires some configuration in cloud profile and provider files as described in the Getting Started with Vagrant documentation.
salt.cloud.clouds.vagrant.avail_images(call=None) This function returns a list of images available for this cloud provider.  vagrant will return a list of profiles.  salt-cloud --list-images my-cloud-provider
salt.cloud.clouds.vagrant.avail_locations(call=None) This function returns a list of locations available.
# \[ vagrant will always returns an empty dictionary \]
salt.cloud.clouds.vagrant.avail_sizes(call=None) This function returns a list of sizes available for this cloud provider.
# \[ vagrant always returns an empty dictionary \]
salt.cloud.clouds.vagrant.create(vm_) Provision a single machine
salt-cloud -p my_profile new_node_1
salt.cloud.clouds.vagrant.destroy(name, call=None) Destroy a node.
salt.cloud.clouds.vagrant.get_configured_provider() Return the first configured instance.
salt.cloud.clouds.vagrant.list_nodes(call=None) List the nodes which have salt-cloud:driver:vagrant grains.
salt.cloud.clouds.vagrant.list_nodes_full(call=None) List the nodes, ask all 'vagrant' minions, return dict of grains (enhanced).
salt-call -F
salt.cloud.clouds.vagrant.list_nodes_select(call=None) Return a list of the minions that have salt-cloud grains, with select fields.
salt.cloud.clouds.vagrant.reboot(name, call=None) Reboot a vagrant minion.
salt.cloud.clouds.vagrant.show_instance(name, call=None) List the a single node, return dict of grains.
salt.cloud.clouds.virtualbox A salt cloud provider that lets you use virtualbox on your machine and act as a cloud.
depends vboxapi
For now this will only clone existing VMs. It's best to create a template from which we will clone.
Followed https://docs.saltproject.io/en/latest/topics/cloud/cloud.html#non-libcloud-based-modules to create this.
Dicts provided by salt:
__opts__ contains the options used to run Salt Cloud, as well as a set of configuration and environment variables
salt.cloud.clouds.virtualbox.create(vm_info) Creates a virtual machine from the given VM information
This is what is used to request a virtual machine to be created by the cloud provider, wait for it to become available, and then (optionally) log in and install Salt on it.
Events fired:
This function fires the event salt/cloud/vm_name/creating, with the payload containing the names of the VM, profile, and provider.
@param vm_info
{ name: <str> profile: <dict> driver: <provider>:<profile> clonefrom: <vm_name> clonemode: <mode> (default: state, choices: state, child, all) }
@type vm_info dict @return dict of resulting vm. !!!Passwords can and should be included!!!
salt.cloud.clouds.virtualbox.destroy(name, call=None) This function irreversibly destroys a virtual machine on the cloud provider.  Before doing so, it should fire an event on the Salt event bus.
salt.cloud.clouds.virtualbox.get_configured_provider() Return the first configured instance.
salt.cloud.clouds.virtualbox.list_nodes(kwargs=None, call=None) This function returns a list of nodes available on this cloud provider, using the following fields:
No other fields should be returned in this function, and all of these fields should be returned, even if empty.  The private_ips and public_ips fields should always be of a list type, even if empty, and the other fields should always be of a str type.  This function is normally called with the -Q option:
@param kwargs: @type kwargs: @param call: @type call: @return: @rtype:
salt.cloud.clouds.virtualbox.list_nodes_full(kwargs=None, call=None) All information available about all nodes should be returned in this function.  The fields in the list_nodes() function should also be returned, even if they would not normally be provided by the cloud provider.
This is because some functions both within Salt and 3rd party will break if an expected field is not present.  This function is normally called with the -F option:
salt.cloud.clouds.virtualbox.list_nodes_select(call=None) Return a list of the VMs that are on the provider, with select fields
salt.cloud.clouds.virtualbox.map_clonemode(vm_info) Convert the virtualbox config file values for clone_mode into the integers the API requires
salt.cloud.clouds.virtualbox.show_image(kwargs, call=None) Show the details of an image
salt.cloud.clouds.virtualbox.start(name, call=None) Start a machine.  @param name: Machine to start @type name: str @param call: Must be "action" @type call: str
salt.cloud.clouds.virtualbox.stop(name, call=None) Stop a running machine.  @param name: Machine to stop @type name: str @param call: Must be "action" @type call: str
salt.cloud.clouds.vmware VMware Cloud Module New in version 2015.5.4.
See Getting started with VMware to get started.
codeauthor Nitin Madhok <nmadhok@g.clemson.edu>
Dependencies • pyVmomi Python Module
pyVmomi PyVmomi can be installed via pip:
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.6, 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.
The 5.5.0.2014.1.1 is a known stable version that this original VMware cloud driver was developed against.
NOTE: Ensure python pyVmomi module is installed by running following one-liner check. The output should be 0.
python -c "import pyVmomi" ; echo $?
Configuration To use this module, set up the vCenter or ESX/ESXi URL, username and password in the cloud configuration at /etc/salt/cloud.providers or /etc/salt/cloud.providers.d/vmware.conf:
To test the connection for my-vmware-config specified in the cloud configuration, run test_vcenter_connection()
salt.cloud.clouds.vmware.add_host(kwargs=None, call=None) Add a host system to the specified cluster or datacenter in this VMware environment
NOTE: To use this function, you need to specify esxi_host_user and esxi_host_password under your provider configuration set up at /etc/salt/cloud.providers or /etc/salt/cloud.providers.d/vmware.conf:
vcenter01: driver: vmware user: 'DOMAIN\user' password: 'verybadpass' url: 'vcenter01.domain.com'
# Required when adding a host system esxi_host_user: 'root' esxi_host_password: 'myhostpassword' # Optional fields that can be specified when adding a host system esxi_host_ssl_thumbprint: '12:A3:45:B6:CD:7E:F8:90:A1:BC:23:45:D6:78:9E:FA:01:2B:34:CD'
The SSL thumbprint of the host system can be optionally specified by setting esxi_host_ssl_thumbprint under your provider configuration. To get the SSL thumbprint of the host system, execute the following command from a remote server:
echo -n | openssl s_client -connect <YOUR-HOSTSYSTEM-DNS/IP>:443 2>/dev/null | openssl x509 -noout -fingerprint -sha1
salt-cloud -f add_host my-vmware-config host="myHostSystemName" cluster="myClusterName" salt-cloud -f add_host my-vmware-config host="myHostSystemName" datacenter="myDatacenterName"
salt.cloud.clouds.vmware.avail_images(call=None) Return a list of all the templates present in this VMware environment with basic details
salt-cloud --list-images my-vmware-config
salt.cloud.clouds.vmware.avail_locations(call=None) Return a list of all the available locations/datacenters in this VMware environment
salt-cloud --list-locations my-vmware-config
salt.cloud.clouds.vmware.avail_sizes(call=None) Return a list of all the available sizes in this VMware environment.
salt-cloud --list-sizes my-vmware-config
NOTE: Since sizes are built into templates, this function will return an empty dictionary.
salt.cloud.clouds.vmware.build_clonespec(config_spec, object_ref, reloc_spec, template) Returns the clone spec
salt.cloud.clouds.vmware.connect_host(kwargs=None, call=None) Connect the specified host system in this VMware environment
salt-cloud -f connect_host my-vmware-config host="myHostSystemName"
salt.cloud.clouds.vmware.convert_to_template(name, kwargs=None, call=None) Convert the specified virtual machine to template.
salt-cloud -a convert_to_template vmname
salt.cloud.clouds.vmware.create(vm_) To create a single VM in the VMware environment.
Sample profile and arguments that can be specified in it can be found here.
salt-cloud -p vmware-centos6.5 vmname
salt.cloud.clouds.vmware.create_cluster(kwargs=None, call=None) Create a new cluster under the specified datacenter in this VMware environment
salt-cloud -f create_cluster my-vmware-config name="myNewCluster" datacenter="datacenterName"
salt.cloud.clouds.vmware.create_datacenter(kwargs=None, call=None) Create a new data center in this VMware environment
salt-cloud -f create_datacenter my-vmware-config name="MyNewDatacenter"
salt.cloud.clouds.vmware.create_datastore_cluster(kwargs=None, call=None) Create a new datastore cluster for the specified datacenter in this VMware environment
salt-cloud -f create_datastore_cluster my-vmware-config name="datastoreClusterName" datacenter="datacenterName"
salt.cloud.clouds.vmware.create_folder(kwargs=None, call=None) Create the specified folder path in this VMware environment
NOTE: To create a Host and Cluster Folder under a Datacenter, specify path="/yourDatacenterName/host/yourFolderName"
To create a Network Folder under a Datacenter, specify path="/yourDatacenterName/network/yourFolderName"
To create a Storage Folder under a Datacenter, specify path="/yourDatacenterName/datastore/yourFolderName"
To create a VM and Template Folder under a Datacenter, specify path="/yourDatacenterName/vm/yourFolderName"
salt-cloud -f create_folder my-vmware-config path="/Local/a/b/c" salt-cloud -f create_folder my-vmware-config path="/MyDatacenter/vm/MyVMFolder" salt-cloud -f create_folder my-vmware-config path="/MyDatacenter/host/MyHostFolder" salt-cloud -f create_folder my-vmware-config path="/MyDatacenter/network/MyNetworkFolder" salt-cloud -f create_folder my-vmware-config path="/MyDatacenter/storage/MyStorageFolder"
salt.cloud.clouds.vmware.create_snapshot(name, kwargs=None, call=None) Create a snapshot of the specified virtual machine in this VMware environment
NOTE: If the VM is powered on, the internal state of the VM (memory dump) is included in the snapshot by default which will also set the power state of the snapshot to "powered on". You can set memdump=False to override this. This field is ignored if the virtual machine is powered off or if the VM does not support snapshots with memory dumps. Default is memdump=True
NOTE: If the VM is powered on when the snapshot is taken, VMware Tools can be used to quiesce the file system in the virtual machine by setting quiesce=True. This field is ignored if the virtual machine is powered off; if VMware Tools are not available or if memdump=True. Default is quiesce=False
salt-cloud -a create_snapshot vmname snapshot_name="mySnapshot" salt-cloud -a create_snapshot vmname snapshot_name="mySnapshot" [description="My snapshot"] [memdump=False] [quiesce=True]
salt.cloud.clouds.vmware.destroy(name, call=None) To destroy a VM from the VMware environment
salt-cloud -d vmname salt-cloud --destroy vmname salt-cloud -a destroy vmname
salt.cloud.clouds.vmware.disconnect_host(kwargs=None, call=None) Disconnect the specified host system in this VMware environment
salt-cloud -f disconnect_host my-vmware-config host="myHostSystemName"
salt.cloud.clouds.vmware.enter_maintenance_mode(kwargs=None, call=None) To put the specified host system in maintenance mode in this VMware environment
salt-cloud -f enter_maintenance_mode my-vmware-config host="myHostSystemName"
salt.cloud.clouds.vmware.exit_maintenance_mode(kwargs=None, call=None) To take the specified host system out of maintenance mode in this VMware environment
salt-cloud -f exit_maintenance_mode my-vmware-config host="myHostSystemName"
salt.cloud.clouds.vmware.get_clonespec_for_valid_snapshot(config_spec, object_ref, reloc_spec, template, vm_) return clonespec only if values are valid
salt.cloud.clouds.vmware.get_configured_provider() Return the first configured instance.
salt.cloud.clouds.vmware.get_dependencies() Warn if dependencies aren't met.
salt.cloud.clouds.vmware.get_vcenter_version(kwargs=None, call=None) Show the vCenter Server version with build number.
salt-cloud -f get_vcenter_version my-vmware-config
salt.cloud.clouds.vmware.handle_snapshot(config_spec, object_ref, reloc_spec, template, vm_) Returns a clone spec for cloning from shapshots :rtype vim.vm.CloneSpec
salt.cloud.clouds.vmware.list_clusters(kwargs=None, call=None) List all the clusters for this VMware environment
salt-cloud -f list_clusters my-vmware-config
salt.cloud.clouds.vmware.list_clusters_by_datacenter(kwargs=None, call=None) List clusters for each datacenter; or clusters for a specified datacenter in this VMware environment
To list clusters for each datacenter:
salt-cloud -f list_clusters_by_datacenter my-vmware-config
To list clusters for a specified datacenter:
salt-cloud -f list_clusters_by_datacenter my-vmware-config datacenter="datacenterName"
salt.cloud.clouds.vmware.list_datacenters(kwargs=None, call=None) List all the data centers for this VMware environment
salt-cloud -f list_datacenters my-vmware-config
salt.cloud.clouds.vmware.list_datastore_clusters(kwargs=None, call=None) List all the datastore clusters for this VMware environment
salt-cloud -f list_datastore_clusters my-vmware-config
salt.cloud.clouds.vmware.list_datastores(kwargs=None, call=None) List all the datastores for this VMware environment
salt-cloud -f list_datastores my-vmware-config
salt.cloud.clouds.vmware.list_dvs(kwargs=None, call=None) List all the distributed virtual switches for this VMware environment
salt-cloud -f list_dvs my-vmware-config
salt.cloud.clouds.vmware.list_folders(kwargs=None, call=None) List all the folders for this VMware environment
salt-cloud -f list_folders my-vmware-config
salt.cloud.clouds.vmware.list_hbas(kwargs=None, call=None) List all HBAs for each host system; or all HBAs for a specified host system; or HBAs of specified type for each host system; or HBAs of specified type for a specified host system in this VMware environment
NOTE: You can specify type as either parallel, iscsi, block or fibre.
To list all HBAs for each host system:
salt-cloud -f list_hbas my-vmware-config
To list all HBAs for a specified host system:
salt-cloud -f list_hbas my-vmware-config host="hostSystemName"
To list HBAs of specified type for each host system:
salt-cloud -f list_hbas my-vmware-config type="HBAType"
To list HBAs of specified type for a specified host system:
salt-cloud -f list_hbas my-vmware-config host="hostSystemName" type="HBAtype"
salt.cloud.clouds.vmware.list_hosts(kwargs=None, call=None) List all the hosts for this VMware environment
salt-cloud -f list_hosts my-vmware-config
salt.cloud.clouds.vmware.list_hosts_by_cluster(kwargs=None, call=None) List hosts for each cluster; or hosts for a specified cluster in this VMware environment
To list hosts for each cluster:
salt-cloud -f list_hosts_by_cluster my-vmware-config
To list hosts for a specified cluster:
salt-cloud -f list_hosts_by_cluster my-vmware-config cluster="clusterName"
salt.cloud.clouds.vmware.list_hosts_by_datacenter(kwargs=None, call=None) List hosts for each datacenter; or hosts for a specified datacenter in this VMware environment
To list hosts for each datacenter:
salt-cloud -f list_hosts_by_datacenter my-vmware-config
To list hosts for a specified datacenter:
salt-cloud -f list_hosts_by_datacenter my-vmware-config datacenter="datacenterName"
salt.cloud.clouds.vmware.list_networks(kwargs=None, call=None) List all the standard networks for this VMware environment
salt-cloud -f list_networks my-vmware-config
salt.cloud.clouds.vmware.list_nodes(kwargs=None, call=None) Return a list of all VMs and templates that are on the specified provider, with basic fields
salt-cloud -f list_nodes my-vmware-config
To return a list of all VMs and templates present on ALL configured providers, with basic fields:
salt.cloud.clouds.vmware.list_nodes_full(kwargs=None, call=None) Return a list of all VMs and templates that are on the specified provider, with full details
salt-cloud -f list_nodes_full my-vmware-config
To return a list of all VMs and templates present on ALL configured providers, with full details:
salt.cloud.clouds.vmware.list_nodes_min(kwargs=None, call=None) Return a list of all VMs and templates that are on the specified provider, with no details
salt-cloud -f list_nodes_min my-vmware-config
salt.cloud.clouds.vmware.list_nodes_select(call=None) Return a list of all VMs and templates that are on the specified provider, with fields specified under query.selection in /etc/salt/cloud
salt-cloud -f list_nodes_select my-vmware-config
To return a list of all VMs and templates present on ALL configured providers, with fields specified under query.selection in /etc/salt/cloud:
salt.cloud.clouds.vmware.list_portgroups(kwargs=None, call=None) List all the distributed virtual portgroups for this VMware environment
salt-cloud -f list_portgroups my-vmware-config
salt.cloud.clouds.vmware.list_resourcepools(kwargs=None, call=None) List all the resource pools for this VMware environment
salt-cloud -f list_resourcepools my-vmware-config
salt.cloud.clouds.vmware.list_snapshots(kwargs=None, call=None) List snapshots either for all VMs and templates or for a specific VM/template in this VMware environment
To list snapshots for all VMs and templates:
salt-cloud -f list_snapshots my-vmware-config
To list snapshots for a specific VM/template:
salt-cloud -f list_snapshots my-vmware-config name="vmname"
salt.cloud.clouds.vmware.list_templates(kwargs=None, call=None) List all the templates present in this VMware environment
salt-cloud -f list_templates my-vmware-config
salt.cloud.clouds.vmware.list_vapps(kwargs=None, call=None) List all the vApps for this VMware environment
salt-cloud -f list_vapps my-vmware-config
salt.cloud.clouds.vmware.reboot_host(kwargs=None, call=None) Reboot the specified host system in this VMware environment
NOTE: If the host system is not in maintenance mode, it will not be rebooted. If you want to reboot the host system regardless of whether it is in maintenance mode, set force=True. Default is force=False.
salt-cloud -f reboot_host my-vmware-config host="myHostSystemName" [force=True]
salt.cloud.clouds.vmware.remove_all_snapshots(name, kwargs=None, call=None) Remove all the snapshots present for the specified virtual machine.
NOTE: All the snapshots higher up in the hierarchy of the current snapshot tree are consolidated and their virtual disks are merged. To override this behavior and only remove all snapshots, set merge_snapshots=False.  Default is merge_snapshots=True
salt-cloud -a remove_all_snapshots vmname [merge_snapshots=False]
salt.cloud.clouds.vmware.remove_host(kwargs=None, call=None) Remove the specified host system from this VMware environment
salt-cloud -f remove_host my-vmware-config host="myHostSystemName"
salt.cloud.clouds.vmware.remove_snapshot(name, kwargs=None, call=None) Remove a snapshot of the specified virtual machine in this VMware environment
salt-cloud -a remove_snapshot vmname snapshot_name="mySnapshot" salt-cloud -a remove_snapshot vmname snapshot_name="mySnapshot" [remove_children="True"]
salt.cloud.clouds.vmware.rescan_hba(kwargs=None, call=None) To rescan a specified HBA or all the HBAs on the Host System
salt-cloud -f rescan_hba my-vmware-config host="hostSystemName" salt-cloud -f rescan_hba my-vmware-config hba="hbaDeviceName" host="hostSystemName"
salt.cloud.clouds.vmware.reset(name, soft=False, call=None) To reset a VM using its name
NOTE: If soft=True then issues a command to the guest operating system asking it to perform a reboot. Otherwise hypervisor will terminate VM and start it again.  Default is soft=False
For soft=True vmtools should be installed on guest system.
salt-cloud -a reset vmname salt-cloud -a reset vmname soft=True
salt.cloud.clouds.vmware.revert_to_snapshot(name, kwargs=None, call=None) Revert virtual machine to its current snapshot. If no snapshot exists, the state of the virtual machine remains unchanged
NOTE: The virtual machine will be powered on if the power state of the snapshot when it was created was set to "Powered On". Set power_off=True so that the virtual machine stays powered off regardless of the power state of the snapshot when it was created. Default is power_off=False.
If the power state of the snapshot when it was created was "Powered On" and if power_off=True, the VM will be put in suspended state after it has been reverted to the snapshot.
salt-cloud -a revert_to_snapshot vmame [power_off=True] salt-cloud -a revert_to_snapshot vmame snapshot_name="selectedSnapshot" [power_off=True]
salt.cloud.clouds.vmware.script(vm_) Return the script deployment object
salt.cloud.clouds.vmware.show_instance(name, call=None) List all available details of the specified VM
salt-cloud -a show_instance vmname
salt.cloud.clouds.vmware.shutdown_host(kwargs=None, call=None) Shut down the specified host system in this VMware environment
NOTE: If the host system is not in maintenance mode, it will not be shut down. If you want to shut down the host system regardless of whether it is in maintenance mode, set force=True. Default is force=False.
salt-cloud -f shutdown_host my-vmware-config host="myHostSystemName" [force=True]
salt.cloud.clouds.vmware.start(name, call=None) To start/power on a VM using its name
salt-cloud -a start vmname
salt.cloud.clouds.vmware.stop(name, soft=False, call=None) To stop/power off a VM using its name
NOTE: If soft=True then issues a command to the guest operating system asking it to perform a clean shutdown of all services. Default is soft=False
salt-cloud -a stop vmname salt-cloud -a stop vmname soft=True
salt.cloud.clouds.vmware.suspend(name, call=None) To suspend a VM using its name
salt-cloud -a suspend vmname
salt.cloud.clouds.vmware.terminate(name, call=None) To do an immediate power off of a VM using its name. A SIGKILL is issued to the vmx process of the VM
salt-cloud -a terminate vmname
salt.cloud.clouds.vmware.test_vcenter_connection(kwargs=None, call=None) Test if the connection can be made to the vCenter server using the specified credentials inside /etc/salt/cloud.providers or /etc/salt/cloud.providers.d/vmware.conf
salt-cloud -f test_vcenter_connection my-vmware-config
salt.cloud.clouds.vmware.upgrade_tools(name, reboot=False, call=None) To upgrade VMware Tools on a specified virtual machine.
NOTE: If the virtual machine is running Windows OS, use reboot=True to reboot the virtual machine after VMware tools upgrade. Default is reboot=False
salt-cloud -a upgrade_tools vmname salt-cloud -a upgrade_tools vmname reboot=True
salt.cloud.clouds.vmware.upgrade_tools_all(call=None) To upgrade VMware Tools on all virtual machines present in the specified provider
NOTE: If the virtual machine is running Windows OS, this function will attempt to suppress the automatic reboot caused by a VMware Tools upgrade.
salt-cloud -f upgrade_tools_all my-vmware-config
salt.cloud.clouds.vultrpy Vultr Cloud Module using python-vultr bindings New in version 2016.3.0.
The Vultr cloud module is used to control access to the Vultr VPS system.
Use of this module only requires the api_key parameter.
Set up the cloud configuration at /etc/salt/cloud.providers or /etc/salt/cloud.providers.d/vultr.conf:
my-vultr-config: # Vultr account api key api_key: <supersecretapi_key> driver: vultr
Set up the cloud profile at /etc/salt/cloud.profiles or /etc/salt/cloud.profiles.d/vultr.conf:
nyc-4gb-4cpu-ubuntu-14-04: location: 1 provider: my-vultr-config image: 160 size: 95 enable_private_network: True
This driver also supports Vultr's startup script feature.  You can list startup scripts in your account with
salt-cloud -f list_scripts <name of vultr provider>
That list will include the IDs of the scripts in your account.  Thus, if you have a script called 'setup-networking' with an ID of 493234 you can specify that startup script in a profile like so:
nyc-2gb-1cpu-ubuntu-17-04: location: 1 provider: my-vultr-config image: 223 size: 13 startup_script_id: 493234
Similarly you can also specify a fiewall group ID using the option firewall_group_id. You can list firewall groups with
salt-cloud -f list_firewall_groups <name of vultr provider>
To specify SSH keys to be preinstalled on the server, use the ssh_key_names setting
nyc-2gb-1cpu-ubuntu-17-04: location: 1 provider: my-vultr-config image: 223 size: 13 ssh_key_names: dev1,dev2,salt-master
You can list SSH keys available on your account using
salt-cloud -f list_keypairs <name of vultr provider>
salt.cloud.clouds.vultrpy.avail_firewall_groups(conn=None) return available firewall groups
salt.cloud.clouds.vultrpy.avail_images(conn=None) Return available images
salt.cloud.clouds.vultrpy.avail_keys(conn=None) return available SSH keys
salt.cloud.clouds.vultrpy.avail_locations(conn=None) return available datacenter locations
salt.cloud.clouds.vultrpy.avail_scripts(conn=None) return available startup scripts
salt.cloud.clouds.vultrpy.avail_sizes(conn=None) Return available sizes ("plans" in VultrSpeak)
salt.cloud.clouds.vultrpy.create(vm_) Create a single VM from a data dict
salt.cloud.clouds.vultrpy.destroy(name) Remove a node from Vultr
salt.cloud.clouds.vultrpy.get_configured_provider() Return the first configured instance
salt.cloud.clouds.vultrpy.list_firewall_groups(conn=None, call=None) return list of firewall groups
salt.cloud.clouds.vultrpy.list_keypairs(conn=None, call=None) return list of SSH keys
salt.cloud.clouds.vultrpy.list_nodes(**kwargs) Return basic data on nodes
salt.cloud.clouds.vultrpy.list_nodes_full(**kwargs) Return all data on nodes
salt.cloud.clouds.vultrpy.list_nodes_select(conn=None, call=None) Return a list of the VMs that are on the provider, with select fields
salt.cloud.clouds.vultrpy.list_scripts(conn=None, call=None) return list of Startup Scripts
salt.cloud.clouds.vultrpy.show_instance(name, call=None) Show the details from the provider concerning an instance
salt.cloud.clouds.vultrpy.show_keypair(kwargs=None, call=None) return list of SSH keys
salt.cloud.clouds.vultrpy.start(*args, **kwargs) Execute a "start" action on a VM
salt.cloud.clouds.vultrpy.stop(*args, **kwargs) Execute a "stop" action on a VM
salt.cloud.clouds.xen XenServer Cloud Driver The XenServer driver is designed to work with a Citrix XenServer.
Requires XenServer SDK (can be downloaded from https://www.citrix.com/downloads/xenserver/product-software/ )
Place a copy of the XenAPI.py in the Python site-packages folder.
depends XenAPI
Example provider configuration:
# /etc/salt/cloud.providers.d/myxen.conf myxen: driver: xen url: http://10.0.0.120 user: root password: p@ssw0rd
Example profile configuration:
# /etc/salt/cloud.profiles.d/myxen.conf suse: provider: myxen user: root password: p@ssw0rd image: opensuseleap42_2-template storage_repo: 'Local storage' resource_pool: default_pool clone: True minion: master: 10.0.0.18 sles: provider: myxen user: root clone: False image: sles12sp2-template deploy: False w2k12: provider: myxen image: w2k12svr-template clone: True userdata_file: /srv/salt/win/files/windows-firewall.ps1 win_installer: /srv/salt/win/files/Salt-Minion-2016.11.3-AMD64-Setup.exe win_username: Administrator win_password: p@ssw0rd use_winrm: False ipv4_cidr: 10.0.0.215/24 ipv4_gw: 10.0.0.1
salt.cloud.clouds.xen.avail_images(call=None) Get a list of images from Xen
If called with the --list-images then it returns images with all details.
salt-cloud --list-images myxen
salt.cloud.clouds.xen.avail_locations(session=None, call=None) Return available Xen locations (not implemented)
salt-cloud --list-locations myxen
salt.cloud.clouds.xen.avail_sizes(session=None, call=None) Return a list of Xen template definitions
salt-cloud --list-sizes myxen
salt.cloud.clouds.xen.create(vm_) Create a VM in Xen
The configuration for this function is read from the profile settings.
salt-cloud -p some_profile xenvm01
salt.cloud.clouds.xen.destroy(name=None, call=None) Destroy Xen VM or template instance
salt-cloud -d xenvm01
salt.cloud.clouds.xen.destroy_template(name=None, call=None, kwargs=None) Destroy Xen VM or template instance
salt-cloud -f destroy_template myxen name=testvm2
salt.cloud.clouds.xen.destroy_vm_vdis(name=None, session=None, call=None) Get virtual block devices on VM
salt-cloud -a destroy_vm_vdis  xenvm01
salt.cloud.clouds.xen.get_configured_provider() Return the first configured instance.
salt.cloud.clouds.xen.get_pv_args(name, session=None, call=None) Get PV arguments for a VM
salt-cloud -a get_pv_args xenvm01
salt.cloud.clouds.xen.get_vm_ip(name=None, session=None, call=None) Get the IP address of the VM
salt-cloud -a get_vm_ip xenvm01
NOTE: Requires xen guest tools to be installed in VM
salt.cloud.clouds.xen.host_list(call=None) Get a list of Xen Servers
salt-cloud -f host_list myxen
salt.cloud.clouds.xen.list_nodes() List virtual machines
salt.cloud.clouds.xen.list_nodes_full(session=None) List full virtual machines
salt.cloud.clouds.xen.list_nodes_select(call=None) Perform a select query on Xen VM instances
salt.cloud.clouds.xen.pause(name, call=None, session=None) Pause a vm
salt-cloud -a pause xenvm01
salt.cloud.clouds.xen.pif_list(call=None) Get a list of Resource Pools
salt-cloud -f pool_list myxen
salt.cloud.clouds.xen.pool_list(call=None) Get a list of Resource Pools
salt.cloud.clouds.xen.reboot(name, call=None, session=None) Reboot a vm
salt-cloud -a reboot xenvm01
salt.cloud.clouds.xen.resume(name, call=None, session=None) Resume a vm from disk
salt-cloud -a resume xenvm01
salt.cloud.clouds.xen.set_pv_args(name, kwargs=None, session=None, call=None) Set PV arguments for a VM
salt-cloud -a set_pv_args xenvm01 pv_args="utf-8 graphical"
salt.cloud.clouds.xen.set_vm_ip(name=None, ipv4_cidr=None, ipv4_gw=None, session=None, call=None) Set the IP address on a virtual interface (vif)
salt.cloud.clouds.xen.show_instance(name, session=None, call=None) Show information about a specific VM or template
salt-cloud -a show_instance xenvm01
NOTE: memory is memory_dynamic_max
salt.cloud.clouds.xen.shutdown(name, call=None, session=None) Shutdown  a vm
salt-cloud -a shutdown xenvm01
salt.cloud.clouds.xen.sr_list(call=None) Geta list of storage repositories
salt-cloud -f sr_list myxen
salt.cloud.clouds.xen.start(name, call=None, session=None) Start  a vm
salt-cloud -a start xenvm01
salt.cloud.clouds.xen.stop(name, call=None, session=None) Stop a vm
salt-cloud -a stop xenvm01
salt.cloud.clouds.xen.suspend(name, call=None, session=None) Suspend a vm to disk
salt-cloud -a suspend xenvm01
salt.cloud.clouds.xen.template_list(call=None) Return available Xen template information.
This returns the details of each template to show number cores, memory sizes, etc..
salt-cloud -f template_list myxen
salt.cloud.clouds.xen.unpause(name, call=None, session=None) UnPause a vm
salt-cloud -a unpause xenvm01
salt.cloud.clouds.xen.vbd_list(name=None, call=None) Get a list of VBDs on a VM
requires: the name of the vm with the vbd definition
salt-cloud -a vbd_list xenvm01
salt.cloud.clouds.xen.vdi_list(call=None, kwargs=None) Return available Xen VDI images
If this function is called with the -f or --function then it can return a list with minimal deatil using the terse=True keyword argument.
salt-cloud -f vdi_list myxen terse=True
salt.cloud.clouds.xen.vif_list(name, call=None, kwargs=None) Get a list of virtual network interfaces  on a VM
salt-cloud -a vif_list xenvm01
salt.engines.docker_events Send events from Docker events :Depends:   Docker API >= 1.22
salt.engines.docker_events.start(docker_url='unix://var/run/docker.sock', timeout=60, tag='salt/engines/docker_events', filters=None) Scan for Docker events and fire events
engines: - docker_events: docker_url: unix://var/run/docker.sock filters: event: - start - stop - die - oom
The config above sets up engines to listen for events from the Docker daemon and publish them to the Salt event bus.
For filter reference, see https://docs.docker.com/engine/reference/commandline/events/
salt.engines.fluent An engine that reads messages from the salt event bus and pushes them onto a fluent endpoint.
All arguments are optional Example configuration of default settings
engines: - fluent: host: localhost port: 24224 app: engine
Example fluentd configuration
<source> @type forward port 24224 </source>
<match saltstack.**> @type file path /var/log/td-agent/saltstack </match>
depends fluent-logger
salt.engines.fluent.start(host='localhost', port=24224, app='engine') Listen to salt events and forward them to fluent
• host (str) -- Host running fluentd agent. Default is localhost
• port (int) -- Port of fluentd agent. Default is 24224
• app (str) -- Text sent as fluentd tag. Default is "engine". This text is appended to "saltstack." to form a fluentd tag, ex: "saltstack.engine"
salt.engines.http_logstash HTTP Logstash engine An engine that reads messages from the salt event bus and pushes them onto a logstash endpoint via HTTP requests.
Changed in version 2018.3.0.
NOTE: By default, this engine take everything from the Salt bus and exports into Logstash.  For a better selection of the events that you want to publish, you can use the tags and funs options.
configuration Example configuration
engines: - http_logstash: url: http://blabla.com/salt-stuff tags: - salt/job/*/new - salt/job/*/ret/* funs: - probes.results - bgp.config
salt.engines.http_logstash.start(url, funs=None, tags=None) Listen to salt events and forward them to logstash.
url    The Logstash endpoint.
funs: None A list of functions to be compared against, looking into the fun field from the event data. This option helps to select the events generated by one or more functions.  If an event does not have the fun field in the data section, it will be published. For a better selection, consider using the tags option.  By default, this option accepts any event to be submitted to Logstash.
tags: None A list of pattern to compare the event tag against.  By default, this option accepts any event to be submitted to Logstash.
salt.engines.ircbot IRC Bot engine
engines: - ircbot: nick: <nick> username: <username> password: <password> host: irc.oftc.net port: 7000 channels: - salt-test - '##something' use_ssl: True use_sasl: True disable_query: True allow_hosts: - salt/engineer/.* allow_nicks: - gtmanfred
Available commands on irc are:
ping   return pong
echo <stuff> return <stuff> targeted at the user who sent the commands
event <tag> [<extra>, <data>] fire event on the master or minion event stream with the tag salt/engines/ircbot/<tag> and a data object with a list of everything else sent in the message
08:33:57 @gtmanfred > !ping 08:33:57   gtmanbot > gtmanfred: pong 08:34:02 @gtmanfred > !echo ping 08:34:02   gtmanbot > ping 08:34:17 @gtmanfred > !event test/tag/ircbot irc is useful 08:34:17   gtmanbot > gtmanfred: TaDa!
[DEBUG   ] Sending event: tag = salt/engines/ircbot/test/tag/ircbot; data = {'_stamp': '2016-11-28T14:34:16.633623', 'data': ['irc', 'is', 'useful']}
class salt.engines.ircbot.Event(source, code, line)
code   Alias for field number 1
line   Alias for field number 2
source Alias for field number 0
class salt.engines.ircbot.IRCClient(nick, host, port=6667, username=None, password=None, channels=None, use_ssl=False, use_sasl=False, char='!', allow_hosts=False, allow_nicks=False, disable_query=True)
join_channel(channel)
on_closed()
on_connect()
read_messages()
send_message(line)
class salt.engines.ircbot.PrivEvent(source, nick, user, host, code, channel, command, line)
channel Alias for field number 5
code   Alias for field number 4
command Alias for field number 6
host   Alias for field number 3
line   Alias for field number 7
nick   Alias for field number 1
user   Alias for field number 2
salt.engines.ircbot.start(nick, host, port=6667, username=None, password=None, channels=None, use_ssl=False, use_sasl=False, char='!', allow_hosts=False, allow_nicks=False, disable_query=True) IRC Bot for interacting with salt.
nick   Nickname of the connected Bot.
host   irc server (example - irc.oftc.net).
port   irc port.  Default: 6667
password password for authenticating.  If not provided, user will not authenticate on the irc server.
channels channels to join.
use_ssl connect to server using ssl. Default: False
use_sasl authenticate using sasl, instead of messaging NickServ. Default: False
NOTE: This will allow the bot user to be fully authenticated before joining any channels
char   command character to look for. Default: !
allow_hosts hostmasks allowed to use commands on the bot.  Default: False True to allow all False to allow none List of regexes to allow matching
allow_nicks Nicks that are allowed to use commands on the bot. Default: False True to allow all False to allow none List of regexes to allow matching
disable_query Disable commands from being sent through private queries. Require they be sent to a channel, so that all communication can be controlled by access to the channel. Default: True
WARNING: Unauthenticated Access to event stream
This engine sends events calls to the event stream without authenticating them in salt.  Authentication will need to be configured and enforced on the irc server or enforced in the irc channel.  The engine only accepts commands from channels, so non authenticated users could be banned or quieted in the channel.
/mode +q $~a  # quiet all users who are not authenticated /mode +r      # do not allow unauthenticated users into the channel
It would also be possible to add a password to the irc channel, or only allow invited users to join.
salt.engines.junos_syslog Junos Syslog Engine New in version 2017.7.0.
depends pyparsing, twisted
An engine that listens to syslog message from Junos devices, extract event information and generate message on SaltStack bus.
The event topic sent to salt is dynamically generated according to the topic title specified by the user. The incoming event data (from the junos device) consists of the following fields:
1.  hostname
2.  hostip
3.  daemon
4.  event
5.  severity
6.  priority
7.  timestamp
8.  message
9.  pid
10. raw (the raw event data forwarded from the device)
The topic title can consist of any of the combination of above fields, but the topic has to start with 'jnpr/syslog'.  So, we can have different combinations:
• jnpr/syslog/hostip/daemon/event
• jnpr/syslog/daemon/severity
The corresponding dynamic topic sent on salt event bus would look something like:
• jnpr/syslog/1.1.1.1/mgd/UI_COMMIT_COMPLETED
• jnpr/syslog/sshd/7
The default topic title is 'jnpr/syslog/hostname/event'.
The user can choose the type of data they wants of the event bus.  Like, if one wants only events pertaining to a particular daemon, they can specify that in the configuration file:
daemon: mgd
One can even have a list of daemons like:
daemon: - mgd - sshd
Example configuration (to be written in master config file)
engines: - junos_syslog: port: 9999 topic: jnpr/syslog/hostip/daemon/event daemon: - mgd - sshd
For junos_syslog engine to receive events, syslog must be set on the junos device.  This can be done via following configuration:
set system syslog host <ip-of-the-salt-device> port 516 any any
Below is a sample syslog event which is received from the junos device:
'<30>May 29 05:18:12 bng-ui-vm-9 mspd[1492]: No chassis configuration found'
The source for parsing the syslog messages is taken from: https://gist.github.com/leandrosilva/3651640#file-xlog-py
class salt.engines.junos_syslog.DatagramProtocol
salt.engines.junos_syslog.start(port=516, **kwargs)
salt.engines.libvirt_events An engine that listens for libvirt events and resends them to the salt event bus.
The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with salt/engines/libvirt_events:
engines: - libvirt_events
Note that the automatically-picked libvirt connection will depend on the value of uri_default in /etc/libvirt/libvirt.conf. To force using another connection like the local LXC libvirt driver, set the uri property as in the following example configuration.
engines: - libvirt_events: uri: lxc:/// tag_prefix: libvirt filters: - domain/lifecycle - domain/reboot - pool
Filters is a list of event types to relay to the event bus. Items in this list can be either one of the main types (domain, network, pool, nodedev, secret), all or a more precise filter. These can be done with values like <main_type>/<subtype>. The possible values are in the CALLBACK_DEFS constant. If the filters list contains all, all events will be relayed.
Be aware that the list of events increases with libvirt versions, for example network events have been added in libvirt 1.2.1 and storage events in 2.0.0.
Running the engine on non-root Running this engine as non-root requires a special attention, which is surely the case for the master running as user salt. The engine is likely to fail to connect to libvirt with an error like this one: [ERROR   ] authentication unavailable: no polkit agent available to authenticate action 'org.libvirt.unix.monitor'
To fix this, the user running the engine, for example the salt-master, needs to have the rights to connect to libvirt in the machine polkit config.  A polkit rule like the following one will allow salt user to connect to libvirt:
polkit.addRule(function(action, subject) { if (action.id.indexOf("org.libvirt") == 0 && subject.user == "salt") { return polkit.Result.YES; } });
depends libvirt 1.0.0+ python binding
salt.engines.libvirt_events.start(uri=None, tag_prefix='salt/engines/libvirt_events', filters=None) Listen to libvirt events and forward them to salt.
• uri -- libvirt URI to listen on.  Defaults to None to pick the first available local hypervisor
• tag_prefix -- the beginning of the salt event tag to use. Defaults to 'salt/engines/libvirt_events'
• filters -- the list of event of listen on. Defaults to 'all'
salt.engines.logentries An engine that sends events to the Logentries logging service.
maintainer Jimmy Tang (jimmy_tang@rapid7.com)
depends ssl, certifi
To enable this engine the master and/or minion will need the following python libraries ssl certifi
If you are running a new enough version of python then the ssl library will be present already.
You will also need the following values configured in the minion or master config.
engines: - logentries: endpoint: data.logentries.com port: 10000 token: 057af3e2-1c05-47c5-882a-5cd644655dbf
The 'token' can be obtained from the Logentries service.
To test this engine
salt '*' test.ping cmd.run uptime
class salt.engines.logentries.PlainTextSocketAppender(verbose=True, LE_API='data.logentries.com', LE_PORT=80, LE_TLS_PORT=443)
close_connection()
open_connection()
put(data)
reopen_connection()
salt.engines.logentries.SocketAppender alias of salt.engines.logentries.TLSSocketAppender
class salt.engines.logentries.TLSSocketAppender(verbose=True, LE_API='data.logentries.com', LE_PORT=80, LE_TLS_PORT=443)
salt.engines.logentries.event_bus_context(opts)
salt.engines.logentries.start(endpoint='data.logentries.com', port=10000, token=None, tag='salt/engines/logentries') Listen to salt events and forward them to Logentries
salt.engines.logstash_engine An engine that reads messages from the salt event bus and pushes them onto a logstash endpoint.
depends logstash
salt.engines.logstash_engine.event_bus_context(opts)
salt.engines.logstash_engine.start(host, port=5959, tag='salt/engine/logstash', proto='udp') Listen to salt events and forward them to logstash
salt.engines.napalm_syslog NAPALM syslog engine New in version 2017.7.0.
An engine that takes syslog messages structured in OpenConfig or IETF format and fires Salt events.
As there can be many messages pushed into the event bus, the user is able to filter based on the object structure.
Requirements • napalm-logs
This engine transfers objects from the napalm-logs library into the event bus. The top dictionary has the following keys:
• ip
• host
• timestamp
• os: the network OS identified
• model_name: the OpenConfig or IETF model name
• error: the error name (consult the documentation)
• message_details: details extracted from the syslog message
• open_config: the OpenConfig model
The napalm-logs transfers the messages via widely used transport mechanisms such as: ZeroMQ (default), Kafka, etc.
The user can select the right transport using the transport option in the configuration.
engines: - napalm_syslog: transport: zmq address: 1.2.3.4 port: 49018
configuration Configuration example, excluding messages from IOS-XR devices:
engines: - napalm_syslog: transport: kafka address: 1.2.3.4 port: 49018 os_blacklist: - iosxr
Event example:
{ "_stamp": "2017-05-26T10:03:18.653045", "error": "BGP_PREFIX_THRESH_EXCEEDED", "host": "vmx01", "ip": "192.168.140.252", "message_details": { "date": "May 25", "host": "vmx01", "message": "192.168.140.254 (External AS 65001): Configured maximum prefix-limit threshold(22) exceeded for inet-unicast nlri: 28 (instance master)", "pri": "28", "processId": "2957", "processName": "rpd", "tag": "BGP_PREFIX_THRESH_EXCEEDED", "time": "20:50:41" }, "model_name": "openconfig_bgp", "open_config": { "bgp": { "neighbors": { "neighbor": { "192.168.140.254": { "afi_safis": { "afi_safi": { "inet": { "afi_safi_name": "inet", "ipv4_unicast": { "prefix_limit": { "state": { "max_prefixes": 22 } } }, "state": { "prefixes": { "received": 28 } } } } }, "neighbor_address": "192.168.140.254", "state": { "peer_as": 65001 } } } } } }, "os": "junos", "timestamp": "1495741841" }
To consume the events and eventually react and deploy a configuration changes on the device(s) firing the event, one is able to identify the minion ID, using one of the following alternatives, but not limited to:
• Host grains to match the event tag
• Host DNS grain to match the IP address in the event data
• Hostname grains to match the event tag
• Define static grains
• Write a grains module