salt.cloud.clouds.linode

Linode Cloud Module using Linode's REST API

The Linode cloud module is used to control access to the Linode VPS system.

Use of this module only requires the apikey parameter. However, the default root password for new instances also needs to be set. The password needs to be 8 characters and contain lowercase, uppercase, and numbers.

Set up the cloud configuration at /etc/salt/cloud.providers or /etc/salt/cloud.providers.d/linode.conf:

my-linode-provider:
  apikey: f4ZsmwtB1c7f85Jdu43RgXVDFlNjuJaeIYV8QMftTqKScEB2vSosFSr...
  password: F00barbaz
  driver: linode
  ssh_key_file: /tmp/salt-cloud_pubkey
  ssh_pubkey: ssh-rsa AAAAB3NzaC1yc2EA...

linode-profile:
  provider: my-linode-provider
  size: Linode 1024
  image: CentOS 7
  location: London, England, UK
  private_ip: true

To clone, add a profile with a clonefrom key, and a script_args: -C. clonefrom should be the name of the VM (linode) that is the source for the clone. script_args: -C passes a -C to the bootstrap script, which only configures the minion and doesn't try to install a new copy of salt-minion. This way the minion gets new keys and the keys get pre-seeded on the master, and the /etc/salt/minion file has the right 'id:' declaration.

Cloning requires a post 2015-02-01 salt-bootstrap.

salt.cloud.clouds.linode.avail_images()

Return available Linode images.

salt.cloud.clouds.linode.avail_locations()

Return available Linode datacenter locations.

salt.cloud.clouds.linode.avail_sizes()

Return available Linode sizes.

salt.cloud.clouds.linode.boot(linode_id, config_id)

Boot a Linode.

linode_id
The ID of the Linode to boot. Required.
config_id
The ID of the Config to boot. Required.
salt.cloud.clouds.linode.clone(linode_id, datacenter_id, plan_id)

Clone a Linode.

linode_id
The ID of the Linode to clone. Required.
datacenter_id
The ID of the Datacenter where the Linode will be placed. Required.
plan_id
The ID of the plan (size) of the Linode. Required.
salt.cloud.clouds.linode.create(vm_)

Create a single Linode VM.

salt.cloud.clouds.linode.create_config(vm_, linode_id, root_disk_id, swap_disk_id, kernel_id=None)

Creates a Linode Configuration Profile.

vm_
The VM profile 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.
kernel_id
The ID of the kernel to use for this configuration profile.
salt.cloud.clouds.linode.create_disk_from_distro(vm_, linode_id, swap_size=None)

Creates the disk for the Linode from the distribution.

vm_
The VM profile to create the disk for.
linode_id
The ID of the Linode to create the distribution disk for. Required.
swap_size
The size of the disk, in MB.
salt.cloud.clouds.linode.create_private_ip(vm_, linode_id)

Creates a private IP for the specified Linode.

vm_
The VM profile to create the swap disk for.
linode_id
The ID of the Linode to create the IP address for.
salt.cloud.clouds.linode.create_swap_disk(vm_, linode_id, swap_size=None)

Creates the disk for the specified Linode.

vm_
The VM profile to create the swap disk for.
linode_id
The ID of the Linode to create the swap disk for.
swap_size
The size of the disk, in MB.
salt.cloud.clouds.linode.destroy(name, call=None)

Destroys a Linode by name.

name
The name of VM to be be destroyed.

CLI Example:

salt-cloud -d vm_name
salt.cloud.clouds.linode.get_configured_provider()

Return the first configured instance.

salt.cloud.clouds.linode.get_datacenter_id(location)

Returns the Linode Datacenter ID.

location
The location, or name, of the datacenter to get the ID from.
salt.cloud.clouds.linode.get_disk_size(vm_, swap)

Returns the size of of the root disk in MB.

vm_
The VM to get the disk size for.
salt.cloud.clouds.linode.get_distribution_id(vm_)

Returns the distribution ID for a VM

vm_
The VM to get the distribution ID for
salt.cloud.clouds.linode.get_ips(linode_id=None)

Returns public and private IP addresses.

linode_id
Limits the IP addresses returned to the specified Linode ID.
salt.cloud.clouds.linode.get_linode(linode_id)

Returns data for a single named Linode.

linode_id
The ID of the Linode to get data for.
salt.cloud.clouds.linode.get_linode_id_from_name(name)

Returns the Linode ID for a VM from the provided name.

name
The name of the Linode from which to get the Linode ID. Required.
salt.cloud.clouds.linode.get_password(vm_)

Return the password to use for a VM.

vm_
The configuration to obtain the password from.
salt.cloud.clouds.linode.get_plan_id(label)

Returns the Linode Plan ID.

label
The label, or name, of the plan to get the ID from.
salt.cloud.clouds.linode.get_private_ip(vm_)

Return True if a private ip address is requested

salt.cloud.clouds.linode.get_pub_key(vm_)

Return the SSH pubkey.

vm_
The configuration to obtain the public key from.
salt.cloud.clouds.linode.get_swap_size(vm_)

Returns the amoutn of swap space to be used in MB.

vm_
The VM profile to obtain the swap size from.
salt.cloud.clouds.linode.get_vm_size(vm_)

Returns the VM's size.

vm_
The VM to get the size for.
salt.cloud.clouds.linode.list_nodes(call=None)

Returns a list of linodes, keeping only a brief listing.

CLI Example:

salt-cloud -Q
salt-cloud --query

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()

List linodes, with all available information.

CLI Example:

salt-cloud -F
 salt-cloud --full-query

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.reboot(name=None, linode_id=None, call=None)

Reboot a linode. Either a name or a linode_id must be provided.

New in version 2015.8.0.

name
The name of the VM to reboot.
linode_id
The Linode ID of the VM to reboot. Can be provided instead of a name.

CLI Example:

salt-cloud -a reboot vm_name
salt-cloud -a reboot linode_id
salt.cloud.clouds.linode.show_instance(name=None, linode_id=None, call=None)

Displays details about a particular Linode VM. Either a name or a linode_id must be provided.

New in version 2015.8.0.

name
The name of the VM for which to display details.
linode_id
The Linode ID of the VM for which to display details. Can be provided instead of a name.

CLI Example:

salt-cloud -a show_instance vm_name
salt-cloud -a show_instance linode_id

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.show_pricing(kwargs=None, call=None)

Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources.

New in version 2015.8.0.

CLI Example:

salt-cloud -f show_pricing my-linode-config profile=my-linode-profile
salt.cloud.clouds.linode.start(name=None, linode_id=None, call=None)

Start a VM in Linode. Either a name or a linode_id must be provided.

name
The name of the VM to start.
linode_id
The Linode ID of the VM to start. Can be provided instead of name.

CLI Example:

salt-cloud -a stop vm_name
salt-cloud -a stop linode_id
salt.cloud.clouds.linode.stop(name=None, linode_id=None, call=None)

Stop a VM in Linode. Either a name or a linode_id must be provided.

name
The name of the VM to stop.
linode_id
The Linode ID of the VM to stop. Can be provided instead of name.

CLI Example:

salt-cloud -a stop vm_name
salt-cloud -a stop linode_id
salt.cloud.clouds.linode.update_linode(linode_id, update_args=None)

Updates a Linode's properties.

linode_id
The ID of the Linode to shutdown. Required.
update_args
The args to update the Linode with. Must be in dictionary form.