# Salt Cloud

Provision systems on cloud hosts / hypervisors and immediately bring them under management.

## Configuration

Salt Cloud provides a powerful interface to interact with cloud hosts. This interface is tightly integrated with Salt, and new virtual machines are automatically connected to your Salt master after creation.

Since Salt Cloud is designed to be an automated system, most configuration is done using the following YAML configuration files:

- `/etc/salt/cloud`: The main configuration file, contains global settings that apply to all cloud hosts. See Salt Cloud Configuration.

- `/etc/salt/cloud.providers.d/*.conf`: Contains settings that configure a specific cloud host, such as credentials, region settings, and so on. Since configuration varies significantly between each cloud host, a separate file should be created for each cloud host. In Salt Cloud, a provider is synonymous with a cloud host (Amazon EC2, Google Compute Engine, Rackspace, and so on). See Provider Specifics.

- `/etc/salt/cloud.profiles.d/*.conf`: Contains settings that define a specific VM type. A profile defines the systems specs and image, and any other settings that are specific to this VM type. Each specific VM type is called a profile, and multiple profiles can be defined in a profile file. Each profile references a parent provider that defines the cloud host in which the VM is created (the provider settings are in the provider configuration explained above). Based on your needs, you might define different profiles for web servers, database servers, and so on. See VM Profiles.

## Configuration Inheritance

Configuration settings are inherited in order from the cloud config => providers => profile.

For example, if you wanted to use the same image for all virtual machines for a specific provider, the image name could be placed in the provider file. This value is inherited by all profiles that use that provider, but is overridden if a image name is defined in the profile.

Most configuration settings can be defined in any file, the main difference being how that setting is inherited.

## QuickStart

The Salt Cloud Quickstart walks you through defining a provider, a VM profile, and shows you how to create virtual machines using Salt Cloud.

Note that if you installed Salt via Salt Bootstrap, it may not have automatically installed salt-cloud for you. Use your distribution's package manager to install the `salt-cloud` package from the same repo that you used to install Salt. These repos will automatically be setup by Salt Bootstrap.

Alternatively, the `-L` option can be passed to the Salt Bootstrap script when installing Salt. The `-L` option will install `salt-cloud` and the required `libcloud` package.

## Using Salt Cloud

- Command Line Reference
  - Synopsis
  - Description
  - Options
    - Execution Options
    - Query Options
    - Cloud Providers Listings
    - Cloud Credentials
    - Output Options
  - Examples
  - See also
- Basic
  - Creating a VM
  - Destroying a VM
- Profiles
  - Multiple Configuration Files
  - Larger Example
- Maps
  - Requiring Other Instances
  - Setting up New Salt Masters
  - Using Direct Map Data
- Actions
- Functions

## Core Configuration

- Installing salt cloud
  - Installing Salt Cloud for development
- Core Configuration
  - Thread Pool Size
  - Minion Configuration
  - Cloud Configuration Syntax
  - Pillar Configuration
  - Cloud Configurations
    - Scaleway
    - Rackspace
    - Amazon AWS
    - Linode
    - Joyent Cloud
    - GoGrid
    - OpenStack
    - DigitalOcean
    - Parallels
    - Proxmox
    - LXC
    - Saltify
    - Vagrant
  - Extending Profiles and Cloud Providers Configuration
    - Extending Profiles
    - Extending Providers

## Windows Configuration

- Windows Configuration
  - Dependencies
  - Requirements
  - Self Signed Certificates with WinRM
  - Firewall Settings
  - Configuration
  - Auto-Generated Passwords on EC2

## Cloud Provider Specifics

- Getting Started With Aliyun
  - Dependencies
  - Configuration
  - Profiles
    - Cloud Profiles
- Getting Started With CloudStack
  - Dependencies
  - Configuration
  - Profiles
    - Cloud Profiles
  - CloudStack specific settings
    - securitygroup
- Getting Started With DigitalOcean
  - Configuration
  - Profiles
    - Cloud Profiles
    - userdata_file
  - Miscellaneous Information
- Getting Started With Dimension Data
  - Dependencies
  - Configuration
  - Profiles
    - Cloud Profiles
- Getting Started With EC2
  - Dependencies
  - Configuration
  - Access Credentials
  - Windows Deploy Timeouts
  - Key Pairs
  - Security Groups
  - IAM Profile
  - Cloud Profiles
  - Required Settings
  - Optional Settings
    - Setting up a Master inside EC2
  - Modify EC2 Tags
  - Rename EC2 Instances
  - Rename on Destroy
  - Listing Images
  - EC2 Images
  - show_image
  - show_instance
  - ebs_optimized
  - del_root_vol_on_destroy
  - del_all_vols_on_destroy
  - EC2 Termination Protection
  - Alternate Endpoint
  - Volume Management
    - Creating Volumes
    - Attaching Volumes
    - Show a Volume
    - Detaching Volumes
    - Deleting Volumes
  - Managing Key Pairs
    - Creating a Key Pair
    - Importing a Key Pair
    - Show a Key Pair
    - Delete a Key Pair
  - Launching instances into a VPC
    - Simple launching into a VPC
    - Specifying interface properties
- Getting Started With GoGrid
  - Configuration
  - Profiles
    - Cloud Profiles
  - Assigning IPs
- Getting Started With Google Compute Engine
  - Dependencies
  - Google Compute Engine Setup
  - Provider Configuration
  - Profile Configuration
  - GCE Specific Settings
    - Initial Profile
    - image
    - size
    - location
    - network
    - subnetwork
    - labels
    - tags
    - metadata
    - use_persistent_disk
    - delete_boot_pd
    - ssh_interface
    - external_ip
    - ex_disk_type
    - ip_forwarding
    - Profile with scopes
  - SSH Remote Access
  - Single instance details
  - Destroy, persistent disks, and metadata
  - List various resources
  - Persistent Disk
    - Create
    - Delete
    - Attach
    - Detach
    - Show disk
    - Create snapshot
    - Delete snapshot
    - Show snapshot
  - Networking
    - Create network
    - Destroy network
    - Show network
    - Create subnetwork
    - Destroy subnetwork
    - Show subnetwork
    - Create address
    - Delete address
    - Show address
    - Create firewall
    - Delete firewall
    - Show firewall
  - Load Balancer
    - HTTP Health Check
    - Load-balancer
    - Attach and Detach LB
- Getting Started With HP Cloud
  - Set up a cloud provider configuration file
  - Compute Region
  - Authentication
  - Set up a cloud profile config file
  - Launch an instance
  - Manage the instance
  - SSH to the instance
  - Using a private IP
- Getting Started With Joyent
  - Dependencies
  - Configuration
  - Profiles
    - Cloud Profiles
  - SmartDataCenter
  - Miscellaneous Configuration
    - use_ssl
    - verify_ssl
- Getting Started With Libvirt
  - Host Dependencies
  - Salt-Cloud Dependencies
  - Provider Configuration
  - Cloud Profiles
  - Required Settings
  - SSH Key Authentication
  - Optional Settings
- Getting Started With Linode
  - Dependencies
  - Provider Configuration
    - Configuration Options
    - Example Configuration
  - Profile Configuration
    - Configuration Options
    - Example Configuration
  - Migrating to APIv4
    - Notable Changes
  - Query Utilities
    - Listing Sizes
    - Listing Images
    - Listing Locations
  - Cloning
- Getting Started With LXC
  - Limitations
  - Operation
  - Provider configuration
  - Profile configuration
  - Driver Support
- Getting Started With OneAndOne
  - Dependencies
  - Configuration
  - Authentication
  - Profiles
  - Functions
- Getting Started With OpenNebula
  - Dependencies
  - Configuration
  - Access Credentials
  - Key Pairs
  - Cloud Profiles
  - Change Disk Size
  - Required Settings
    - Required Settings for VM Deployment
  - Listing Images
  - Listing Locations
  - Listing Sizes
  - Additional OpenNebula API Functionality
  - Access via DNS entry instead of IP
- Getting Started With OpenStack
- Getting Started With Parallels
  - Access Credentials
  - Cloud Profiles
  - Required Settings
  - Optional Settings
- Getting Started With ProfitBricks
  - Dependencies
  - Configuration
  - Virtual Data Center
  - Authentication
  - Profiles
    - Profile Specifics:
- Getting Started With Proxmox
  - Dependencies
  - Access Credentials
  - Cloud Profiles
  - Required Settings
  - Optional Settings
  - QEMU
- Getting Started With Scaleway
  - Configuration
  - Profiles
    - Cloud Profiles
- Getting Started With Saltify
  - Dependencies
  - Configuration
  - Profiles
    - Destroy Options
    - Wake On LAN
    - Using Map Files
    - Bulk Deployments
  - Credential Verification
- Getting Started With SoftLayer
  - Dependencies
  - Configuration
  - Access Credentials
  - Profiles
    - Cloud Profiles
    - Using Multiple Disks
    - Dedicated Host
    - Bare metal Profiles
  - Actions
    - show_instance
  - Functions
    - list_vlans
    - list_custom_images
  - Optional Products for SoftLayer HW
    - Public Secondary IP Addresses
    - Primary IPv6 Addresses
    - Public Static IPv6 Addresses
    - OS-Specific Addon
    - Control Panel Software
    - Database Software
    - Anti-Virus & Spyware Protection
    - Insurance
    - Monitoring
    - Notification
    - Advanced Monitoring
    - Response
    - Intrusion Detection & Protection
    - Hardware & Software Firewalls
- Getting Started With Tencent Cloud
  - Dependencies
  - Provider Configuration
    - Configuration Parameters
  - Profile Configuration
    - Configuration Parameters
  - Actions
    - show_instance
    - show_disk
    - destroy
    - start
    - stop
    - reboot
  - Functions
    - list_securitygroups
    - list_availability_zones
    - list_custom_images
    - show_image
- Getting Started With Vagrant
  - Dependencies
  - Configuration
  - Profiles
  - Provisioning a Vagrant cloud host (example)
    - Create and use your new Salt minion
- Getting Started With Vexxhost
  - Cloud Provider Configuration
  - Authentication
  - Cloud Profile Configuration
  - Provision an instance
- Getting Started With Virtualbox
  - Dependencies
  - Configuration
  - Profiles
    - Provisioning
  - Actions
  - Functions
- Getting Started With VMware
  - Dependencies
  - Configuration
  - Profiles
  - Cloning a VM
  - Instant Cloning a VM
  - Cloning a Template
  - Cloning from a Snapshot
  - Creating a VM
  - Specifying disk backing mode
- Getting Started With Xen
  - Setup Dependencies
  - Provider Configuration
  - Profile Configuration
    - Listing Sizes
    - Listing Images
    - Listing Locations

## Miscellaneous Options

- Miscellaneous
  - Deploy Script Arguments
  - Selecting the File Transport
  - Sync After Install
  - Setting Up New Salt Masters
  - Setting Up a Salt Syndic with Salt Cloud
  - SSH Port
  - Delete SSH Keys
  - Keeping /tmp/ Files
  - Hide Output From Minion Install
  - Connection Timeout
    - wait_for_ip_timeout
    - wait_for_ip_interval
    - ssh_connect_timeout
    - wait_for_passwd_timeout
    - wait_for_passwd_maxtries
    - wait_for_fun_timeout
    - wait_for_spot_timeout
  - Salt Cloud Cache
    - update_cachedir
    - diff_cache_events
  - SSH Known Hosts
  - SSH Agent
  - File Map Upload
  - Running Pre-Flight Commands
  - Force Minion Config

## Troubleshooting Steps

- Troubleshooting
  - Virtual Machines Are Created, But Do Not Respond
  - Generic Troubleshooting Steps
    - Debug Mode
    - Salt Bootstrap
    - The Bootstrap Log
    - Keeping Temp Files
    - Unprivileged Primary Users
    - `/tmp/` is Mounted as `noexec`
    - Executing the Deploy Script Manually

## Extending Salt Cloud

- Adding Cloud Providers
  - All Driver Modules
    - The __virtual__() Function
    - The get_configured_provider() Function
  - Libcloud Based Modules
    - The create() Function
    - The libcloudfuncs Functions
  - Non-Libcloud Based Modules
    - The `create()` Function
    - The get_size() Function
    - The get_image() Function
    - The avail_locations() Function
    - The avail_images() Function
    - The avail_sizes() Function
    - The script() Function
    - The destroy() Function
    - The list_nodes() Function
    - The list_nodes_full() Function
    - The list_nodes_select() Function
    - The show_instance() Function
  - Actions and Functions
    - Actions
    - Functions
- Adding OS Support
  - Other Generic Deploy Scripts
  - Custom Deploy Scripts
  - Post-Deploy Commands
  - Skipping the Deploy Script
  - Updating Salt Bootstrap
  - Keeping /tmp/ Files
  - Deploy Script Arguments

## Using Salt Cloud from Salt

- Using Salt Cloud from Salt
  - Minion Keys
  - Execution Module
    - list_images
    - list_sizes
    - list_locations
    - query
    - full_query
    - select_query
    - profile
    - create
    - destroy
    - action
  - State Module
    - cloud.present
    - cloud.profile
    - cloud.absent
  - Runner Module
  - CloudClient
  - Reactor

## Feature Comparison

- Features
  - Legacy Drivers
  - Note for Developers
  - Standard Features
  - Actions
  - Functions

## Tutorials

- QuickStart
  - Define a Provider
  - List Cloud Provider Options
  - Create VM Profiles
  - Create VMs
  - Destroy VMs
  - Query VMs
  - Cloud Map
- Using Salt Cloud with the Event Reactor
  - Event Structure
  - Available Events
    - salt/cloud/<minion_id>/creating
    - salt/cloud/<minion_id>/requesting
    - salt/cloud/<minion_id>/querying
    - salt/cloud/<minion_id>/waiting_for_ssh
    - salt/cloud/<minion_id>/deploying
    - salt/cloud/<minion_id>/created
  - Filtering Events
  - Configuring the Event Reactor
  - Reactor SLS Files
  - Example: Reactor-Based Highstate