neulab/tldr huggingface dataset:
salt.cloud.clouds.ec2.del_tags(name=None, kwargs=None, call=None, instance_id=None, resource_id=None) Delete tags for a resource. Normally a VM name or instance_id is passed in, but a resource_id may be passed instead. If both are passed in, the instance_id will be used.
salt-cloud -a del_tags mymachine tags=mytag, salt-cloud -a del_tags mymachine tags=tag1,tag2,tag3 salt-cloud -a del_tags resource_id=vol-3267ab32 tags=tag1,tag2,tag3
salt.cloud.clouds.ec2.delete_keypair(kwargs=None, call=None) Delete an SSH keypair
salt.cloud.clouds.ec2.delete_snapshot(kwargs=None, call=None) Delete a snapshot
salt.cloud.clouds.ec2.delete_volume(name=None, kwargs=None, instance_id=None, call=None) Delete a volume
salt.cloud.clouds.ec2.delvol_on_destroy(name, kwargs=None, call=None) Delete all/specified EBS volumes upon instance termination
salt-cloud -a delvol_on_destroy mymachine
salt.cloud.clouds.ec2.describe_snapshots(kwargs=None, call=None) Describe a snapshot (or snapshots)
snapshot_id One or more snapshot IDs. Multiple IDs must be separated by ",".
owner  Return the snapshots owned by the specified owner. Valid values include: self, amazon, <AWS Account ID>. Multiple values must be separated by ",".
restorable_by One or more AWS accounts IDs that can create volumes from the snapshot.  Multiple aws account IDs must be separated by ",".
TODO: Add all of the filters.
salt.cloud.clouds.ec2.describe_volumes(kwargs=None, call=None) Describe a volume (or volumes)
volume_id One or more volume IDs. Multiple IDs must be separated by ",".
salt.cloud.clouds.ec2.destroy(name, call=None) Destroy a node. Will check termination protection and warn if enabled.
salt.cloud.clouds.ec2.detach_volume(name=None, kwargs=None, instance_id=None, call=None) Detach a volume from an instance
salt.cloud.clouds.ec2.disable_detailed_monitoring(name, call=None) Enable/disable detailed monitoring on a node
salt.cloud.clouds.ec2.disable_term_protect(name, call=None) Disable termination protection on a node
salt-cloud -a disable_term_protect mymachine
salt.cloud.clouds.ec2.enable_detailed_monitoring(name, call=None) Enable/disable detailed monitoring on a node
salt.cloud.clouds.ec2.enable_term_protect(name, call=None) Enable termination protection on a node
salt-cloud -a enable_term_protect mymachine
salt.cloud.clouds.ec2.get_availability_zone(vm_) Return the availability zone to use
salt.cloud.clouds.ec2.get_configured_provider() Return the first configured instance.
salt.cloud.clouds.ec2.get_console_output(name=None, location=None, instance_id=None, call=None, kwargs=None) Show the console output from the instance.
By default, returns decoded data, not the Base64-encoded data that is actually returned from the EC2 API.
salt.cloud.clouds.ec2.get_dependencies() Warn if dependencies aren't met.
salt.cloud.clouds.ec2.get_imageid(vm_) Returns the ImageId to use
salt.cloud.clouds.ec2.get_location(vm_=None)
Return the EC2 region to use, in this order:
salt.cloud.clouds.ec2.get_password_data(name=None, kwargs=None, instance_id=None, call=None) Return password data for a Windows instance.
By default only the encrypted password data will be returned. However, if a key_file is passed in, then a decrypted password will also be returned.
Note that the key_file references the private key that was used to generate the keypair associated with this instance. This private key will _not_ be transmitted to Amazon; it is only used internally inside of Salt Cloud to decrypt data _after_ it has been received from Amazon.
salt-cloud -a get_password_data mymachine salt-cloud -a get_password_data mymachine key_file=/root/ec2key.pem
Note: PKCS1_v1_5 was added in PyCrypto 2.5
salt.cloud.clouds.ec2.get_placementgroup(vm_) Returns the PlacementGroup to use
salt.cloud.clouds.ec2.get_provider(vm_=None) Extract the provider name from vm
salt.cloud.clouds.ec2.get_spot_config(vm_) Returns the spot instance configuration for the provided vm
salt.cloud.clouds.ec2.get_ssh_gateway_config(vm_) Return the ssh_gateway configuration.
salt.cloud.clouds.ec2.get_subnetid(vm_) Returns the SubnetId to use
salt.cloud.clouds.ec2.get_tags(name=None, instance_id=None, call=None, location=None, kwargs=None, resource_id=None) Retrieve tags for a resource. Normally a VM name or instance_id is passed in, but a resource_id may be passed instead. If both are passed in, the instance_id will be used.
salt-cloud -a get_tags mymachine salt-cloud -a get_tags resource_id=vol-3267ab32
salt.cloud.clouds.ec2.get_tenancy(vm_) Returns the Tenancy to use.
Can be "dedicated" or "default". Cannot be present for spot instances.
salt.cloud.clouds.ec2.iam_profile(vm_) Return the IAM profile.
The IAM instance profile to associate with the instances.  This is either the Amazon Resource Name (ARN) of the instance profile or the name of the role.
Type: String
Required: No
Example: arn:aws:iam::111111111111:instance-profile/s3access
Example: s3access
salt.cloud.clouds.ec2.import_keypair(kwargs=None, call=None) Import an SSH public key.
salt.cloud.clouds.ec2.keepvol_on_destroy(name, kwargs=None, call=None) Do not delete all/specified EBS volumes upon instance termination
salt-cloud -a keepvol_on_destroy mymachine
salt.cloud.clouds.ec2.keyname(vm_) Return the keyname
salt.cloud.clouds.ec2.list_availability_zones(vm_=None) List all availability zones in the current region
salt.cloud.clouds.ec2.list_nodes(call=None) Return a list of the VMs that are on the provider
salt.cloud.clouds.ec2.list_nodes_full(location=None, call=None) Return a list of the VMs that are on the provider
salt.cloud.clouds.ec2.list_nodes_min(location=None, call=None) Return a list of the VMs that are on the provider. Only a list of VM names, and their state, is returned. This is the minimum amount of information needed to check for existing VMs.
salt.cloud.clouds.ec2.list_nodes_select(call=None) Return a list of the VMs that are on the provider, with select fields
salt.cloud.clouds.ec2.optimize_providers(providers) Return an optimized list of providers.
We want to reduce the duplication of querying the same region.
If a provider is using the same credentials for the same region the same data will be returned for each provider, thus causing un-wanted duplicate data and API calls to EC2.
salt.cloud.clouds.ec2.query(params=None, setname=None, requesturl=None, location=None, return_url=False, return_root=False)
salt.cloud.clouds.ec2.query_instance(vm_=None, call=None) Query an instance upon creation from the EC2 API
salt.cloud.clouds.ec2.queue_instances(instances) Queue a set of instances to be provisioned later. Expects a list.
Currently this only queries node data, and then places it in the cloud cache (if configured). If the salt-cloud-reactor is being used, these instances will be automatically provisioned using that.
For more information about the salt-cloud-reactor, see:
https://github.com/saltstack-formulas/salt-cloud-reactor
salt.cloud.clouds.ec2.reboot(name, call=None) Reboot a node.
salt-cloud -a reboot mymachine
salt.cloud.clouds.ec2.register_image(kwargs=None, call=None) Create an ami from a snapshot
salt-cloud -f register_image my-ec2-config ami_name=my_ami description="my description" root_device_name=/dev/xvda snapshot_id=snap-xxxxxxxx
salt.cloud.clouds.ec2.rename(name, kwargs, call=None) Properly rename a node. Pass in the new name as "new name".
salt.cloud.clouds.ec2.request_instance(vm_=None, call=None) Put together all of the information necessary to request an instance on EC2, and then fire off the request the instance.
Returns data about the instance
salt.cloud.clouds.ec2.script(vm_) Return the script deployment object
salt.cloud.clouds.ec2.securitygroup(vm_) Return the security group
salt.cloud.clouds.ec2.securitygroupid(vm_) Returns the SecurityGroupId
salt.cloud.clouds.ec2.set_tags(name=None, tags=None, call=None, location=None, instance_id=None, resource_id=None, kwargs=None) Set tags for a resource. Normally a VM name or instance_id is passed in, but a resource_id may be passed instead. If both are passed in, the instance_id will be used.
salt-cloud -a set_tags mymachine tag1=somestuff tag2='Other stuff' salt-cloud -a set_tags resource_id=vol-3267ab32 tag=somestuff
salt.cloud.clouds.ec2.show_delvol_on_destroy(name, kwargs=None, call=None) Do not delete all/specified EBS volumes upon instance termination
salt-cloud -a show_delvol_on_destroy mymachine
salt.cloud.clouds.ec2.show_detailed_monitoring(name=None, instance_id=None, call=None, quiet=False) Show the details from EC2 regarding cloudwatch detailed monitoring.
salt.cloud.clouds.ec2.show_image(kwargs, call=None) Show the details from EC2 concerning an AMI
salt.cloud.clouds.ec2.show_instance(name=None, instance_id=None, call=None, kwargs=None) Show the details from EC2 concerning an AMI.
Can be called as an action (which requires a name):
...or as a function (which requires either a name or instance_id):
salt-cloud -f show_instance my-ec2 name=myinstance salt-cloud -f show_instance my-ec2 instance_id=i-d34db33f
salt.cloud.clouds.ec2.show_keypair(kwargs=None, call=None) Show the details of an SSH keypair
salt.cloud.clouds.ec2.show_pricing(kwargs=None, call=None) Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources.
salt-cloud -f show_pricing my-ec2-config profile=my-profile
If pricing sources have not been cached, they will be downloaded. Once they have been cached, they will not be updated automatically. To manually update all prices, use the following command:
salt-cloud -f update_pricing <provider>
salt.cloud.clouds.ec2.show_term_protect(name=None, instance_id=None, call=None, quiet=False) Show the details from EC2 concerning an instance's termination protection state
salt.cloud.clouds.ec2.show_volume(kwargs=None, call=None) Wrapper around describe_volumes.  Here just to keep functionality. Might be depreciated later.
salt.cloud.clouds.ec2.sign(key, msg)
salt.cloud.clouds.ec2.ssh_interface(vm_) Return the ssh_interface type to connect to. Either 'public_ips' (default) or 'private_ips'.
salt.cloud.clouds.ec2.ssm_create_association(name=None, kwargs=None, instance_id=None, call=None) Associates the specified SSM document with the specified instance
http://docs.aws.amazon.com/ssm/latest/APIReference/API_CreateAssociation.html
salt-cloud -a ssm_create_association ec2-instance-name ssm_document=ssm-document-name
salt.cloud.clouds.ec2.ssm_describe_association(name=None, kwargs=None, instance_id=None, call=None) Describes the associations for the specified SSM document or instance.
http://docs.aws.amazon.com/ssm/latest/APIReference/API_DescribeAssociation.html
salt-cloud -a ssm_describe_association ec2-instance-name ssm_document=ssm-document-name
salt.cloud.clouds.ec2.start(name, call=None) Start a node
salt.cloud.clouds.ec2.stop(name, call=None) Stop a node
salt.cloud.clouds.ec2.update_pricing(kwargs=None, call=None) Download most recent pricing information from AWS and convert to a local JSON file.
salt-cloud -f update_pricing my-ec2-config salt-cloud -f update_pricing my-ec2-config type=linux
salt.cloud.clouds.ec2.volume_create(**kwargs) Wrapper around create_volume.  Here just to ensure the compatibility with the cloud module.
salt.cloud.clouds.ec2.volume_list(**kwargs) Wrapper around describe_volumes.  Here just to ensure the compatibility with the cloud module.
salt.cloud.clouds.ec2.wait_for_instance(vm_=None, data=None, ip_address=None, display_ssh_output=True, call=None) Wait for an instance upon creation from the EC2 API, to become available
salt.cloud.clouds.gce Copyright 2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.  You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License.
Google Compute Engine Module The Google Compute Engine module. This module interfaces with Google Compute Engine (GCE). To authenticate to GCE, you will need to create a Service Account.  To set up Service Account Authentication, follow the gce_setup instructions.
Example Provider Configuration my-gce-config: # The Google Cloud Platform Project ID project: "my-project-id" # The Service Account client ID service_account_email_address: 1234567890@developer.gserviceaccount.com # The location of the private key (PEM format) service_account_private_key: /home/erjohnso/PRIVKEY.pem driver: gce # Specify whether to use public or private IP for deploy script. # Valid options are: #     private_ips - The salt-master is also hosted with GCE #     public_ips - The salt-master is hosted outside of GCE ssh_interface: public_ips
maintainer Eric Johnson <erjohnso@google.com>
maintainer Russell Tolle <russ.tolle@gmail.com>
depends libcloud >= 1.0.0
salt.cloud.clouds.gce.attach_disk(name=None, kwargs=None, call=None) Attach an existing disk to an existing instance.
salt-cloud -a attach_disk myinstance disk_name=mydisk mode=READ_WRITE
salt.cloud.clouds.gce.attach_lb(kwargs=None, call=None) Add an existing node/member to an existing load-balancer configuration.
salt-cloud -f attach_lb gce name=lb member=myinstance
salt.cloud.clouds.gce.avail_images(conn=None) Return a dict of all available VM images on the cloud provider with relevant data.
Note that for GCE, there are custom images within the project, but the generic images are in other projects.  This returns a dict of images in the project plus images in well-known public projects that provide supported images, as listed on this page: https://cloud.google.com/compute/docs/operating-systems/
If image names overlap, the image in the current project is used.
salt.cloud.clouds.gce.avail_locations(conn=None, call=None) Return a dict of all available VM locations on the cloud provider with relevant data
salt.cloud.clouds.gce.avail_sizes(conn=None) Return a dict of available instances sizes (a.k.a machine types) and convert them to something more serializable.
salt.cloud.clouds.gce.create(vm_=None, call=None) Create a single GCE instance from a data dict.
salt.cloud.clouds.gce.create_address(kwargs=None, call=None) Create a static address in a region.
salt-cloud -f create_address gce name=my-ip region=us-central1 address=IP
salt.cloud.clouds.gce.create_attach_volumes(name, kwargs, call=None) New in version 2017.7.0.
Create and attach multiple volumes to a node. The 'volumes' and 'node' arguments are required, where 'node' is a libcloud node, and 'volumes' is a list of maps, where each map contains:
size   The size of the new disk in GB. Required.
type   The disk type, either pd-standard or pd-ssd. Optional, defaults to pd-standard.
image  An image to use for this new disk. Optional.
snapshot A snapshot to use for this new disk. Optional.
auto_delete An option(bool) to keep or remove the disk upon instance deletion.  Optional, defaults to False.
Volumes are attached in the order in which they are given, thus on a new node the first volume will be /dev/sdb, the second /dev/sdc, and so on.
salt.cloud.clouds.gce.create_disk(kwargs=None, call=None) Create a new persistent disk. Must specify disk_name and location, and optionally can specify 'disk_type' as pd-standard or pd-ssd, which defaults to pd-standard. Can also specify an image or snapshot but if neither of those are specified, a size (in GB) is required.
salt-cloud -f create_disk gce disk_name=pd size=300 location=us-central1-b
salt.cloud.clouds.gce.create_fwrule(kwargs=None, call=None) Create a GCE firewall rule. The 'default' network is used if not specified.
salt-cloud -f create_fwrule gce name=allow-http allow=tcp:80
salt.cloud.clouds.gce.create_hc(kwargs=None, call=None) Create an HTTP health check configuration.
salt-cloud -f create_hc gce name=hc path=/healthy port=80
salt.cloud.clouds.gce.create_lb(kwargs=None, call=None) Create a load-balancer configuration.
salt-cloud -f create_lb gce name=lb region=us-central1 ports=80
salt.cloud.clouds.gce.create_network(kwargs=None, call=None) Changed in version 2017.7.0.
Create a GCE network. Must specify name and cidr.
salt-cloud -f create_network gce name=mynet cidr=10.10.10.0/24 mode=legacy description=optional salt-cloud -f create_network gce name=mynet description=optional
salt.cloud.clouds.gce.create_snapshot(kwargs=None, call=None) Create a new disk snapshot. Must specify name and  disk_name.
salt-cloud -f create_snapshot gce name=snap1 disk_name=pd
salt.cloud.clouds.gce.create_subnetwork(kwargs=None, call=None) New in version 2017.7.0.
Create a GCE Subnetwork. Must specify name, cidr, network, and region.
salt-cloud -f create_subnetwork gce name=mysubnet network=mynet1 region=us-west1 cidr=10.0.0.0/24 description=optional
salt.cloud.clouds.gce.delete_address(kwargs=None, call=None) Permanently delete a static address.
salt-cloud -f delete_address gce name=my-ip
salt.cloud.clouds.gce.delete_disk(kwargs=None, call=None) Permanently delete a persistent disk.
salt-cloud -f delete_disk gce disk_name=pd
salt.cloud.clouds.gce.delete_fwrule(kwargs=None, call=None) Permanently delete a firewall rule.
salt-cloud -f delete_fwrule gce name=allow-http
salt.cloud.clouds.gce.delete_hc(kwargs=None, call=None) Permanently delete a health check.
salt-cloud -f delete_hc gce name=hc
salt.cloud.clouds.gce.delete_lb(kwargs=None, call=None) Permanently delete a load-balancer.
salt-cloud -f delete_lb gce name=lb
salt.cloud.clouds.gce.delete_network(kwargs=None, call=None) Permanently delete a network.
salt.cloud.clouds.gce.delete_snapshot(kwargs=None, call=None) Permanently delete a disk snapshot.
salt-cloud -f delete_snapshot gce name=disk-snap-1
salt.cloud.clouds.gce.delete_subnetwork(kwargs=None, call=None) New in version 2017.7.0.
Delete a GCE Subnetwork. Must specify name and region.
salt-cloud -f delete_subnetwork gce name=mysubnet network=mynet1 region=us-west1
salt.cloud.clouds.gce.destroy(vm_name, call=None) Call 'destroy' on the instance.  Can be called with "-a destroy" or -d
salt-cloud -a destroy myinstance1 myinstance2 ... salt-cloud -d myinstance1 myinstance2 ...
salt.cloud.clouds.gce.detach_disk(name=None, kwargs=None, call=None) Detach a disk from an instance.
salt-cloud -a detach_disk myinstance disk_name=mydisk
salt.cloud.clouds.gce.detach_lb(kwargs=None, call=None) Remove an existing node/member from an existing load-balancer configuration.
salt-cloud -f detach_lb gce name=lb member=myinstance
salt.cloud.clouds.gce.get_configured_provider() Return the first configured instance.
salt.cloud.clouds.gce.get_conn() Return a conn object for the passed VM data
salt.cloud.clouds.gce.get_dependencies() Warn if dependencies aren't met.
salt.cloud.clouds.gce.get_lb_conn(gce_driver=None) Return a load-balancer conn object
salt.cloud.clouds.gce.list_nodes(conn=None, call=None) Return a list of the VMs that are on the provider
salt.cloud.clouds.gce.list_nodes_full(conn=None, call=None) Return a list of the VMs that are on the provider, with all fields
salt.cloud.clouds.gce.list_nodes_select(conn=None, call=None) Return a list of the VMs that are on the provider, with select fields
salt.cloud.clouds.gce.reboot(vm_name, call=None) Call GCE 'reset' on the instance.
salt.cloud.clouds.gce.request_instance(vm_) Request a single GCE instance from a data dict.
salt.cloud.clouds.gce.script(vm_) Return the script deployment object
salt.cloud.clouds.gce.show_address(kwargs=None, call=None) Show the details of an existing static address.
salt-cloud -f show_address gce name=mysnapshot region=us-central1
salt.cloud.clouds.gce.show_disk(name=None, kwargs=None, call=None) Show the details of an existing disk.
salt-cloud -a show_disk myinstance disk_name=mydisk salt-cloud -f show_disk gce disk_name=mydisk
salt.cloud.clouds.gce.show_fwrule(kwargs=None, call=None) Show the details of an existing firewall rule.
salt-cloud -f show_fwrule gce name=allow-http
salt.cloud.clouds.gce.show_hc(kwargs=None, call=None) Show the details of an existing health check.
salt-cloud -f show_hc gce name=hc
salt.cloud.clouds.gce.show_instance(vm_name, call=None) Show the details of the existing instance.
salt.cloud.clouds.gce.show_lb(kwargs=None, call=None) Show the details of an existing load-balancer.
salt-cloud -f show_lb gce name=lb
salt.cloud.clouds.gce.show_network(kwargs=None, call=None) Show the details of an existing network.
salt.cloud.clouds.gce.show_pricing(kwargs=None, call=None) Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources.
salt-cloud -f show_pricing my-gce-config profile=my-profile
salt.cloud.clouds.gce.show_snapshot(kwargs=None, call=None) Show the details of an existing snapshot.
salt-cloud -f show_snapshot gce name=mysnapshot
salt.cloud.clouds.gce.show_subnetwork(kwargs=None, call=None) New in version 2017.7.0.
Show details of an existing GCE Subnetwork. Must specify name and region.
salt-cloud -f show_subnetwork gce name=mysubnet region=us-west1
salt.cloud.clouds.gce.start(vm_name, call=None) Call GCE 'start on the instance.
salt.cloud.clouds.gce.stop(vm_name, call=None) Call GCE 'stop' on the instance.
salt-cloud -a stop myinstance
salt.cloud.clouds.gce.update_pricing(kwargs=None, call=None) Download most recent pricing information from GCE and save locally
salt-cloud -f update_pricing my-gce-config
salt.cloud.clouds.gogrid GoGrid Cloud Module The GoGrid cloud module. This module interfaces with the gogrid public cloud service. To use Salt Cloud with GoGrid log into the GoGrid web interface and create an api key. Do this by clicking on "My Account" and then going to the API Keys tab.
Set up the cloud configuration at /etc/salt/cloud.providers or /etc/salt/cloud.providers.d/gogrid.conf:
my-gogrid-config: # The generated api key to use apikey: asdff7896asdh789 # The apikey's shared secret sharedsecret: saltybacon driver: gogrid
salt.cloud.clouds.gogrid.avail_images() Available images
salt.cloud.clouds.gogrid.avail_locations() Available locations
salt.cloud.clouds.gogrid.avail_sizes() Available sizes
salt.cloud.clouds.gogrid.create(vm_) Create a single VM from a data dict
salt.cloud.clouds.gogrid.destroy(name, call=None) Destroy a machine by name
salt-cloud -d vm_name
salt.cloud.clouds.gogrid.get_configured_provider() Return the first configured instance.
salt.cloud.clouds.gogrid.list_common_lookups(kwargs=None, call=None) List common lookups for a particular type of item
salt.cloud.clouds.gogrid.list_nodes(full=False, call=None) List of nodes, keeping only a brief listing
salt.cloud.clouds.gogrid.list_nodes_full(call=None) List nodes, with all available information
salt.cloud.clouds.gogrid.list_nodes_select(call=None) Return a list of the VMs that are on the provider, with select fields
salt.cloud.clouds.gogrid.list_passwords(kwargs=None, call=None) List all password on the account
salt.cloud.clouds.gogrid.list_public_ips(kwargs=None, call=None) List all available public IPs.
salt-cloud -f list_public_ips <provider>
To list unavailable (assigned) IPs, use:
salt-cloud -f list_public_ips <provider> state=assigned
salt.cloud.clouds.gogrid.reboot(name, call=None) Reboot a machine by name
salt-cloud -a reboot vm_name
salt.cloud.clouds.gogrid.show_instance(name, call=None) Start a machine by name
salt-cloud -a show_instance vm_name
salt.cloud.clouds.gogrid.start(name, call=None) Start a machine by name
salt-cloud -a start vm_name
salt.cloud.clouds.gogrid.stop(name, call=None) Stop a machine by name
salt.cloud.clouds.hetzner Hetzner Cloud Module The Hetzner cloud module is used to control access to the hetzner cloud. https://docs.hetzner.cloud/
depends hcloud >= 1.10
Use of this module requires the key parameter to be set.
my-hetzner-cloud-config: key: <your api key> driver: hetzner
salt.cloud.clouds.hetzner.avail_images(call=None)
salt.cloud.clouds.hetzner.avail_locations(call=None)
salt.cloud.clouds.hetzner.avail_sizes(call=None)
salt.cloud.clouds.hetzner.create(vm_) Create a single VM from a data dict
salt.cloud.clouds.hetzner.destroy(name, call=None) Destroy a node.
salt.cloud.clouds.hetzner.get_configured_provider() Return the first configured instance.
salt.cloud.clouds.hetzner.get_dependencies() Warn if dependencies aren't met.
salt.cloud.clouds.hetzner.list_nodes(call=None)
salt.cloud.clouds.hetzner.list_nodes_full(call=None)
salt.cloud.clouds.hetzner.list_ssh_keys(call=None)
salt.cloud.clouds.hetzner.reboot(name, call=None, wait=True) Reboot a node.
salt.cloud.clouds.hetzner.resize(name, kwargs, call=None) Resize a node.
salt-cloud -a resize mymachine size=...
salt.cloud.clouds.hetzner.show_instance(name, call=None)
salt.cloud.clouds.hetzner.start(name, call=None, wait=True) Start a node.
salt-cloud -a start mymachine
salt.cloud.clouds.hetzner.stop(name, call=None, wait=True) Stop a node.
salt-cloud -a stop mymachine
salt.cloud.clouds.hetzner.wait_until(name, state, timeout=300) Wait until a specific state has been reached on  a node
salt.cloud.clouds.joyent Joyent Cloud Module The Joyent Cloud module is used to interact with the Joyent cloud system.
Set up the cloud configuration at /etc/salt/cloud.providers or /etc/salt/cloud.providers.d/joyent.conf:
my-joyent-config: driver: joyent # The Joyent login user user: fred # The Joyent user's password password: saltybacon # The location of the ssh private key that can log into the new VM private_key: /root/mykey.pem # The name of the private key keyname: mykey
When creating your profiles for the joyent cloud, add the location attribute to the profile, this will automatically get picked up when performing tasks associated with that vm. An example profile might look like:
joyent_512: provider: my-joyent-config size: g4-highcpu-512M image: centos-6 location: us-east-1
This driver can also be used with the Joyent SmartDataCenter project. More details can be found at:
depends PyCrypto
salt.cloud.clouds.joyent.avail_images(call=None) Get list of available images
salt-cloud --list-images
Can use a custom URL for images. Default is:
image_url: images.joyent.com/images
salt.cloud.clouds.joyent.avail_locations(call=None) List all available locations
salt.cloud.clouds.joyent.avail_sizes(call=None) get list of available packages
salt-cloud --list-sizes
salt.cloud.clouds.joyent.create(vm_) Create a single VM from a data dict
salt-cloud -p profile_name vm_name
salt.cloud.clouds.joyent.create_node(**kwargs) convenience function to make the rest api call for node creation.
salt.cloud.clouds.joyent.delete_key(kwargs=None, call=None) List the keys available
salt-cloud -f delete_key joyent keyname=mykey
salt.cloud.clouds.joyent.destroy(name, call=None) destroy a machine by name
• name -- name given to the machine
• call -- call value in this case is 'action'
Returns array of booleans , true if successfully stopped and true if successfully removed
salt.cloud.clouds.joyent.get_configured_provider() Return the first configured instance.
salt.cloud.clouds.joyent.get_image(vm_) Return the image object to use
salt.cloud.clouds.joyent.get_location(vm_=None)
Return the joyent data center to use, in this order:
salt.cloud.clouds.joyent.get_location_path(location='us-east-1', api_host_suffix='.api.joyentcloud.com') create url from location variable :param location: joyent data center location :return: url
salt.cloud.clouds.joyent.get_node(name) gets the node from the full node list by name :param name: name of the vm :return: node object
salt.cloud.clouds.joyent.get_size(vm_) Return the VM's size object
salt.cloud.clouds.joyent.has_method(obj, method_name) Find if the provided object has a specific method
salt.cloud.clouds.joyent.import_key(kwargs=None, call=None) List the keys available
salt-cloud -f import_key joyent keyname=mykey keyfile=/tmp/mykey.pub
salt.cloud.clouds.joyent.joyent_node_state(id_) Convert joyent returned state to state common to other data center return values for consistency
Parameters id -- joyent state value
Returns state value
salt.cloud.clouds.joyent.key_list(items=None) convert list to dictionary using the key as the identifier :param items: array to iterate over :return: dictionary
salt.cloud.clouds.joyent.list_keys(kwargs=None, call=None) List the keys available
salt.cloud.clouds.joyent.list_nodes(full=False, call=None) list of nodes, keeping only a brief listing
salt.cloud.clouds.joyent.list_nodes_full(call=None) list of nodes, maintaining all content provided from joyent listings
salt.cloud.clouds.joyent.list_nodes_select(call=None) Return a list of the VMs that are on the provider, with select fields
salt.cloud.clouds.joyent.query(action=None, command=None, args=None, method='GET', location=None, data=None) Make a web call to Joyent
salt.cloud.clouds.joyent.query_instance(vm_=None, call=None) Query an instance upon creation from the Joyent API
salt.cloud.clouds.joyent.reboot(name, call=None) reboot a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful
salt.cloud.clouds.joyent.reformat_node(item=None, full=False) Reformat the returned data from joyent, determine public/private IPs and strip out fields if necessary to provide either full or brief content.
• item -- node dictionary
• full -- full or brief output
Returns dict
salt.cloud.clouds.joyent.show_instance(name, call=None) get details about a machine :param name: name given to the machine :param call: call value in this case is 'action' :return: machine information
salt.cloud.clouds.joyent.show_key(kwargs=None, call=None) List the keys available
salt.cloud.clouds.joyent.ssh_interface(vm_) Return the ssh_interface type to connect to. Either 'public_ips' (default) or 'private_ips'.
salt.cloud.clouds.joyent.start(name, call=None) start a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful
salt.cloud.clouds.joyent.stop(name, call=None) stop a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful
salt.cloud.clouds.joyent.take_action(name=None, call=None, command=None, data=None, method='GET', location='us-east-1') take action call used by start,stop, reboot :param name: name given to the machine :param call: call value in this case is 'action' :command: api path :data: any data to be passed to the api, must be in json format :method: GET,POST,or DELETE :location: data center to execute the command on :return: true if successful
salt.cloud.clouds.libvirt Libvirt Cloud Module Example provider:
# A provider maps to a libvirt instance my-libvirt-config: driver: libvirt # url: "qemu+ssh://user@remotekvm/system?socket=/var/run/libvirt/libvirt-sock" url: qemu:///system
Example profile:
base-itest: # points back at provider configuration e.g. the libvirt daemon to talk to provider: my-libvirt-config base_domain: base-image # ip_source = [ ip-learning | qemu-agent ] ip_source: ip-learning # clone_strategy = [ quick | full ] clone_strategy: quick ssh_username: vagrant # has_ssh_agent: True password: vagrant # if /tmp is mounted noexec do workaround deploy_command: sh /tmp/.saltcloud/deploy.sh # -F makes the bootstrap script overwrite existing config # which make reprovisioning a box work script_args: -F grains: sushi: more tasty # point at the another master at another port minion: master: 192.168.16.1 master_port: 5506
Tested on: - Fedora 26 (libvirt 3.2.1, qemu 2.9.1) - Fedora 25 (libvirt 1.3.3.2, qemu 2.6.1) - Fedora 23 (libvirt 1.2.18, qemu 2.4.1) - Centos 7 (libvirt 1.2.17, qemu 1.5.3)
salt.cloud.clouds.libvirt.create(vm_) Provision a single machine
salt.cloud.clouds.libvirt.create_volume_with_backing_store_xml(volume)
salt.cloud.clouds.libvirt.create_volume_xml(volume)
salt.cloud.clouds.libvirt.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.
The tag for this event is salt/cloud/<vm name>/destroying.  Once the virtual machine has been destroyed, another event is fired. The tag for that event is salt/cloud/<vm name>/destroyed.
Dependencies: list_nodes
@param name: @type name: str @param call: @type call: @return: True if all went well, otherwise an error message @rtype: bool|str
salt.cloud.clouds.libvirt.destroy_domain(conn, domain)
salt.cloud.clouds.libvirt.do_cleanup(cleanup) Clean up clone domain leftovers as much as possible.
Extra robust clean up in order to deal with some small changes in libvirt behavior over time. Passed in volumes and domains are deleted, any errors are ignored. Used when cloning/provisioning a domain fails.
Parameters cleanup -- list containing dictonaries with two keys: 'what' and 'item'.  If 'what' is domain the 'item' is a libvirt domain object.  If 'what' is volume then the item is a libvirt volume object.
Returns none
New in version 2017.7.3.
salt.cloud.clouds.libvirt.find_pool_and_volume(conn, path)
salt.cloud.clouds.libvirt.generate_new_name(orig_name)
salt.cloud.clouds.libvirt.get_configured_provider() Return the first configured instance.
salt.cloud.clouds.libvirt.get_domain_ip(domain, idx, ip_source, skip_loopback=True)
salt.cloud.clouds.libvirt.get_domain_ips(domain, ip_source)
salt.cloud.clouds.libvirt.get_domain_volumes(conn, domain)
salt.cloud.clouds.libvirt.libvirt_error_handler(ctx, error) Redirect stderr prints from libvirt to salt logging.
salt.cloud.clouds.libvirt.list_nodes(call=None) Return a list of the VMs
id (str) image (str) size (str) state (str) private_ips (list) public_ips (list)
salt.cloud.clouds.libvirt.list_nodes_full(call=None) Because this module is not specific to any cloud providers, there will be no nodes to list.
salt.cloud.clouds.libvirt.list_nodes_select(call=None) Return a list of the VMs that are on the provider, with select fields
salt.cloud.clouds.libvirt.to_ip_addr_type(addr_type)
salt.cloud.clouds.linode The Linode Cloud Module The Linode cloud module is used to interact with the Linode Cloud.
You can target a specific version of the Linode API with the api_version parameter. The default is v3.
Provider The following provider parameters are supported:
• apikey: (required) The key to use to authenticate with the Linode API.
• password: (required) The default password to set on new VMs. Must be 8 characters with at least one lowercase, uppercase, and numeric.
• api_version: (optional) The version of the Linode API to interact with. Defaults to v3.
• poll_interval: (optional) The rate of time in milliseconds to poll the Linode API for changes. Defaults to 500.
• ratelimit_sleep: (optional) The time in seconds to wait before retrying after a ratelimit has been enforced. Defaults to 0.
NOTE: APIv3 usage is deprecated and will be removed in a future release in favor of APIv4. To move to APIv4 now, set the api_version parameter in your provider configuration to v4. See the full migration guide here https://docs.saltproject.io/en/latest/topics/cloud/linode.html#migrating-to-apiv4.
Set up the provider configuration at /etc/salt/cloud.providers or /etc/salt/cloud.providers.d/linode.conf:
Profile The following profile parameters are supported:
• size: (required) The size of the VM. This should be a Linode instance type ID (i.e. g6-standard-2). For APIv3, this would be a plan ID (i.e. Linode 2GB). Run salt-cloud -f avail_sizes my-linode-provider for options.
• location: (required) The location of the VM. This should be a Linode region (e.g. us-east). For APIv3, this would be a datacenter location (i.e. Newark, NJ, USA). Run salt-cloud -f avail_locations my-linode-provider for options.
• image: (required) The image to deploy the boot disk from. This should be an image ID (e.g. linode/ubuntu16.04); official images start with linode/. For APIv3, this would be an image label (i.e. Ubuntu 16.04). Run salt-cloud -f avail_images my-linode-provider for more options.
• password: (*required) The default password for the VM. Must be provided at the profile or provider level.
• assign_private_ip: (optional) Whether or not to assign a private key to the VM. Defaults to False.
• ssh_interface: (optional) The interface with which to connect over SSH. Valid options are private_ips or public_ips. Defaults to public_ips.
• ssh_pubkey: (optional) The public key to authorize for SSH with the VM.
• swap: (optional) The amount of disk space to allocate for the swap partition. Defaults to 256.
• clonefrom: (optional) The name of the Linode to clone from.
• disk_size: (deprecated, optional) The amount of disk space to allocate for the OS disk. This has no effect with APIv4; the size of the boot disk will be the remainder of disk space after the swap parition is allocated.
Set up a profile configuration in /etc/salt/cloud.profiles.d/:
my-linode-profile: # a minimal configuration provider: my-linode-provider size: g6-standard-1 image: linode/alpine3.12 location: us-east
my-linode-profile-advanced: # an advanced configuration provider: my-linode-provider size: g6-standard-3 image: linode/alpine3.10 location: eu-west password: bogus123X assign_private_ip: true ssh_interface: private_ips ssh_pubkey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQAB... swap_size: 512
my-linode-profile-v3: # a legacy configuration provider: my-linode-provider-v3 size: Nanode 1GB image: Alpine 3.12 location: Fremont, CA, USA
Migrating to APIv4 In order to target APIv4, ensure your provider configuration has api_version set to v4.
You will also need to generate a new token for your account. See https://www.linode.com/docs/platform/api/getting-started-with-the-linode-api/#create-an-api-token
There are a few changes to note: - There has been a general move from label references to ID references. The profile configuration parameters location, size, and image have moved from being label based references to IDs. See the profile section for more information. In addition to these inputs being changed, avail_sizes, avail_locations, and avail_images now output options sorted by ID instead of label.  - The disk_size profile configuration parameter has been deprecated and will not be taken into account when creating new VMs while targeting APIv4.
maintainer Charles Kenney <ckenney@linode.com>
maintainer Phillip Campbell <pcampbell@linode.com>
class salt.cloud.clouds.linode.LinodeAPI
abstract avail_images() avail_images implementation
abstract avail_locations() avail_locations implementation
abstract avail_sizes() avail_sizes implementation
abstract boot(name=None, kwargs=None) boot implementation
abstract clone(kwargs=None) clone implementation
abstract create(vm_) create implementation
abstract create_config(kwargs=None) create_config implementation
abstract destroy(name) destroy implementation
abstract get_config_id(kwargs=None) get_config_id implementation
get_linode(kwargs=None)
get_plan_id(kwargs=None) get_plan_id implementation
abstract list_nodes() list_nodes implementation
abstract list_nodes_full() list_nodes_full implementation
abstract list_nodes_min() list_nodes_min implementation
list_nodes_select(call)
abstract reboot(name) reboot implementation
abstract show_instance(name) show_instance implementation
abstract show_pricing(kwargs=None) show_pricing implementation
abstract start(name) start implementation
abstract stop(name) stop implementation
class salt.cloud.clouds.linode.LinodeAPIv3
avail_images() avail_images implementation
avail_locations() avail_locations implementation
avail_sizes() avail_sizes implementation
boot(name=None, kwargs=None) boot implementation
clone(kwargs=None) clone implementation
create(vm_) create implementation
create_config(kwargs=None) create_config implementation
destroy(name) destroy implementation
get_config_id(kwargs=None) get_config_id implementation
list_nodes() list_nodes implementation
list_nodes_full() list_nodes_full implementation
list_nodes_min() list_nodes_min implementation
reboot(name) reboot implementation
show_instance(name) show_instance implementation
show_pricing(kwargs=None) show_pricing implementation
start(name) start implementation
stop(name) stop implementation
class salt.cloud.clouds.linode.LinodeAPIv4
salt.cloud.clouds.linode.avail_images(call=None) Return available Linode images.
salt-cloud --list-images my-linode-config salt-cloud -f avail_images my-linode-config
salt.cloud.clouds.linode.avail_locations(call=None) Return available Linode datacenter locations.
salt-cloud --list-locations my-linode-config salt-cloud -f avail_locations my-linode-config
salt.cloud.clouds.linode.avail_sizes(call=None) Return available Linode sizes.
salt-cloud --list-sizes my-linode-config salt-cloud -f avail_sizes my-linode-config
salt.cloud.clouds.linode.boot(name=None, kwargs=None, call=None) Boot a Linode.
name   The name of the Linode to boot. Can be used instead of linode_id.
linode_id The ID of the Linode to boot. If provided, will be used as an alternative to name and reduces the number of API calls to Linode by one. Will be preferred over name.
config_id The ID of the Config to boot. Required.
check_running Defaults to True. If set to False, overrides the call to check if the VM is running before calling the linode.boot API call. Change check_running to True is useful during the boot call in the create function, since the new VM will not be running yet.
salt-cloud -a boot my-instance config_id=10
...or as a function (which requires either a name or linode_id):
salt-cloud -f boot my-linode-config name=my-instance config_id=10 salt-cloud -f boot my-linode-config linode_id=1225876 config_id=10
salt.cloud.clouds.linode.clone(kwargs=None, call=None) Clone a Linode.
linode_id The ID of the Linode to clone. Required.
location The location of the new Linode. Required.
size   The size of the new Linode (must be greater than or equal to the clone source). Required.
datacenter_id The ID of the Datacenter where the Linode will be placed. Required for APIv3 usage.  Deprecated. Use location instead.
plan_id The ID of the plan (size) of the Linode. Required. Required for APIv3 usage.  Deprecated. Use size instead.
salt-cloud -f clone my-linode-config linode_id=1234567 datacenter_id=2 plan_id=5
salt.cloud.clouds.linode.create(vm_) Create a single Linode VM.
salt.cloud.clouds.linode.create_config(kwargs=None, call=None) Creates a Linode Configuration Profile.
name   The name of the VM to create the config for.
linode_id The ID of the Linode to create the configuration for.
root_disk_id The Root Disk ID to be used for this config.
swap_disk_id The Swap Disk ID to be used for this config.
data_disk_id The Data Disk ID to be used for this config.
kernel_id The ID of the kernel to use for this configuration profile.
salt.cloud.clouds.linode.destroy(name, call=None) Destroys a Linode by name.
name   The name of VM to be be destroyed.
salt.cloud.clouds.linode.get_config_id(kwargs=None, call=None) Returns a config_id for a given linode.
name   The name of the Linode for which to get the config_id. Can be used instead of linode_id.
linode_id The ID of the Linode for which to get the config_id. Can be used instead of name.
salt-cloud -f get_config_id my-linode-config name=my-linode salt-cloud -f get_config_id my-linode-config linode_id=1234567
salt.cloud.clouds.linode.get_configured_provider() Return the first configured instance.
salt.cloud.clouds.linode.get_linode(kwargs=None, call=None) Returns data for a single named Linode.
name   The name of the Linode for which to get data. Can be used instead linode_id. Note this will induce an additional API call compared to using linode_id.
linode_id The ID of the Linode for which to get data. Can be used instead of name.
salt-cloud -f get_linode my-linode-config name=my-instance salt-cloud -f get_linode my-linode-config linode_id=1234567
salt.cloud.clouds.linode.get_plan_id(kwargs=None, call=None) Returns the Linode Plan ID.
label  The label, or name, of the plan to get the ID from.
salt-cloud -f get_plan_id linode label="Nanode 1GB" salt-cloud -f get_plan_id linode label="Linode 2GB"
salt.cloud.clouds.linode.list_nodes(call=None) Returns a list of linodes, keeping only a brief listing.
salt-cloud -Q salt-cloud --query salt-cloud -f list_nodes my-linode-config
NOTE: The image label only displays information about the VM's distribution vendor, such as "Debian" or "RHEL" and does not display the actual image name. This is due to a limitation of the Linode API.
salt.cloud.clouds.linode.list_nodes_full(call=None) List linodes, with all available information.
salt-cloud -F salt-cloud --full-query salt-cloud -f list_nodes_full my-linode-config
salt.cloud.clouds.linode.list_nodes_min(call=None) Return a list of the VMs that are on the provider. Only a list of VM names and their state is returned. This is the minimum amount of information needed to check for existing VMs.
salt-cloud -f list_nodes_min my-linode-config salt-cloud --function list_nodes_min my-linode-config
salt.cloud.clouds.linode.list_nodes_select(call=None) Return a list of the VMs that are on the provider, with select fields.
salt.cloud.clouds.linode.reboot(name, call=None) Reboot a linode.
name   The name of the VM to reboot.
salt.cloud.clouds.linode.show_instance(name, call=None) Displays details about a particular Linode VM. Either a name or a linode_id must be provided.
name   The name of the VM for which to display details.
salt.cloud.clouds.linode.show_pricing(kwargs=None, call=None) Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources.
salt-cloud -f show_pricing my-linode-config profile=my-linode-profile
salt.cloud.clouds.linode.start(name, call=None) Start a VM in Linode.
name   The name of the VM to start.
salt.cloud.clouds.linode.stop(name, call=None) Stop a VM in Linode.
name   The name of the VM to stop.
salt.cloud.clouds.lxc Install Salt on an LXC Container New in version 2014.7.0.
Please read core config documentation.
salt.cloud.clouds.lxc.avail_images()
salt.cloud.clouds.lxc.create(vm_, call=None) Create an lxc Container.  This function is idempotent and will try to either provision or finish the provision of an lxc container.
NOTE: Most of the initialization code has been moved and merged with the lxc runner and lxc.init functions
salt.cloud.clouds.lxc.destroy(vm_, call=None) Destroy a lxc container
salt.cloud.clouds.lxc.get_configured_provider(vm_=None) Return the contextual provider of None if no configured one can be found.
salt.cloud.clouds.lxc.get_provider(name)
salt.cloud.clouds.lxc.list_nodes(conn=None, call=None)
salt.cloud.clouds.lxc.list_nodes_full(conn=None, call=None)
salt.cloud.clouds.lxc.list_nodes_select(call=None) Return a list of the VMs that are on the provider, with select fields
salt.cloud.clouds.lxc.show_instance(name, call=None) Show the details from the provider concerning an instance
salt.cloud.clouds.msazure Azure Cloud Module The Azure cloud module is used to control access to Microsoft Azure
• Microsoft Azure SDK for Python >= 1.0.2
• python-requests, for Python < 2.7.9
• apikey
• certificate_path
• backend
A Management Certificate (.pem and .crt files) must be created and the .pem file placed on the same machine that salt-cloud is run from. Information on creating the pem file to use, and uploading the associated cer file can be found at:
http://www.windowsazure.com/en-us/develop/python/how-to-guides/service-management/
For users with Python < 2.7.9, backend must currently be set to requests.
my-azure-config: driver: azure subscription_id: 3287abc8-f98a-c678-3bde-326766fd3617 certificate_path: /etc/salt/azure.pem management_host: management.core.windows.net
salt.cloud.clouds.msazure.add_input_endpoint(kwargs=None, conn=None, call=None) New in version 2015.8.0.
Add an input endpoint to the deployment. Please note that there may be a delay before the changes show up.
salt.cloud.clouds.msazure.add_management_certificate(kwargs=None, conn=None, call=None) New in version 2015.8.0.
Add a new management certificate
salt.cloud.clouds.msazure.add_service_certificate(kwargs=None, conn=None, call=None) New in version 2015.8.0.
Add a new service certificate
salt-cloud -f add_service_certificate my-azure name=my_service_certificate \ data='...CERT_DATA...' certificate_format=sha1 password=verybadpass
salt.cloud.clouds.msazure.avail_images(conn=None, call=None) List available images for Azure
salt.cloud.clouds.msazure.avail_locations(conn=None, call=None) List available locations for Azure
salt.cloud.clouds.msazure.avail_sizes(call=None) Return a list of sizes from Azure
salt.cloud.clouds.msazure.cleanup_unattached_disks(kwargs=None, conn=None, call=None) New in version 2015.8.0.
Cleans up all disks associated with the account, which are not attached.  * CAUTION * This is a destructive function with no undo button, and no "Are you sure?" confirmation!