Connection module for Apache Libcloud Compute management for a full list of supported clouds, see http://libcloud.readthedocs.io/en/latest/compute/supported_providers.html
Clouds include Amazon EC2, Azure, Google GCE, VMware, OpenStack Nova
New in version 2018.3.0.
This module uses a configuration profile for one or multiple cloud providers
libcloud_compute:
profile_test1:
driver: google
key: service-account@googlecloud.net
secret: /path/to.key.json
profile_test2:
driver: arm
key: 12345
secret: mysecret
apache-libcloud
Attaches volume to node.
node_id (str
) -- Node ID to target
volume_id (str
) -- Volume ID from which to attach
profile (str
) -- The profile key
device (str
) -- Where the device is exposed, e.g. '/dev/sdb'
libcloud_kwargs (dict
) -- Extra arguments for the driver's attach_volume method
CLI Example:
salt myminion libcloud_compute.detach_volume vol1 profile1
Copies an image from a source region to the current region.
source_region (str
) -- Region to copy the node from.
image_id (str
) -- Image to copy.
name (str
) -- name for new image.
profile (str
) -- The profile key
description -- description for new image.
libcloud_kwargs (dict
) -- Extra arguments for the driver's copy_image method
CLI Example:
salt myminion libcloud_compute.copy_image us-east1 image1 'new image' profile1
Create an image from a node
node_id (str
) -- Node to run the task on.
name (str
) -- name for new image.
profile (str
) -- The profile key
description (description
) -- description for new image.
libcloud_kwargs (dict
) -- Extra arguments for the driver's create_image method
CLI Example:
salt myminion libcloud_compute.create_image server1 my_image profile1
salt myminion libcloud_compute.create_image server1 my_image profile1 description='test image'
Create a single key pair by name
name (str
) -- Name of the key pair to create.
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's create_key_pair method
CLI Example:
salt myminion libcloud_compute.create_key_pair pair1 profile1
Create a storage volume
size (int
) -- Size of volume in gigabytes (required)
name (str
) -- Name of the volume to be created
location_id (str
) -- Which data center to create a volume in. If
empty, undefined behavior will be selected.
(optional)
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's list_volumes method
CLI Example:
salt myminion libcloud_compute.create_volume 1000 vol1 profile1
Create a storage volume snapshot
volume_id (str
) -- Volume ID from which to create the new
snapshot.
profile (str
) -- The profile key
name (str
) -- Name of the snapshot to be created (optional)
libcloud_kwargs (dict
) -- Extra arguments for the driver's create_volume_snapshot method
CLI Example:
salt myminion libcloud_compute.create_volume_snapshot vol1 profile1
Delete an image of a node
image_id (str
) -- Image to delete
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's delete_image method
CLI Example:
salt myminion libcloud_compute.delete_image image1 profile1
Delete a key pair
name (str
) -- Key pair name.
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's import_key_pair_from_xxx method
CLI Example:
salt myminion libcloud_compute.delete_key_pair pair1 profile1
Destroy a node in the cloud
node_id (str
) -- Unique ID of the node to destroy
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's destroy_node method
CLI Example:
salt myminion libcloud_compute.destry_node as-2346 profile1
Destroy a volume.
volume_id (str
) -- Volume ID from which to destroy
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's destroy_volume method
CLI Example:
salt myminion libcloud_compute.destroy_volume vol1 profile1
Destroy a volume snapshot.
volume_id (str
) -- Volume ID from which the snapshot belongs
snapshot_id (str
) -- Volume Snapshot ID from which to destroy
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's destroy_volume_snapshot method
CLI Example:
salt myminion libcloud_compute.destroy_volume_snapshot snap1 profile1
Detaches a volume from a node.
volume_id (str
) -- Volume ID from which to detach
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's detach_volume method
CLI Example:
salt myminion libcloud_compute.detach_volume vol1 profile1
Call an extended method on the driver
method (str
) -- Driver's method name
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's method
CLI Example:
salt myminion libcloud_compute.extra ex_get_permissions google container_name=my_container object_name=me.jpg --out=yaml
Get an image of a node
image_id (str
) -- Image to fetch
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's delete_image method
CLI Example:
salt myminion libcloud_compute.get_image image1 profile1
Get a single key pair by name
name (str
) -- Name of the key pair to retrieve.
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's get_key_pair method
CLI Example:
salt myminion libcloud_compute.get_key_pair pair1 profile1
Import a new public key from string or a file path
name (str
) -- Key pair name.
key (str
or path str
) -- Public key material, the string or a path to a file
profile (str
) -- The profile key
key_type (str
) -- The key pair type, either FILE or STRING. Will detect if not provided
and assume that if the string is a path to an existing path it is a FILE, else STRING.
libcloud_kwargs (dict
) -- Extra arguments for the driver's import_key_pair_from_xxx method
CLI Example:
salt myminion libcloud_compute.import_key_pair pair1 key_value_data123 profile1
salt myminion libcloud_compute.import_key_pair pair1 /path/to/key profile1
Return a list of images for this cloud
profile (str
) -- The profile key
location_id (str
) -- The location key, from list_locations
libcloud_kwargs (dict
) -- Extra arguments for the driver's list_images method
CLI Example:
salt myminion libcloud_compute.list_images profile1
List all the available key pair objects.
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's list_key_pairs method
CLI Example:
salt myminion libcloud_compute.list_key_pairs profile1
Return a list of locations for this cloud
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's list_locations method
CLI Example:
salt myminion libcloud_compute.list_locations profile1
Return a list of nodes
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's list_nodes method
CLI Example:
salt myminion libcloud_compute.list_nodes profile1
Return a list of node sizes
profile (str
) -- The profile key
location_id (str
) -- The location key, from list_locations
libcloud_kwargs (dict
) -- Extra arguments for the driver's list_sizes method
CLI Example:
salt myminion libcloud_compute.list_sizes profile1
salt myminion libcloud_compute.list_sizes profile1 us-east1
Return a list of storage volumes snapshots for this cloud
volume_id (str
) -- The volume identifier
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's list_volume_snapshots method
CLI Example:
salt myminion libcloud_compute.list_volume_snapshots vol1 profile1
Return a list of storage volumes for this cloud
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's list_volumes method
CLI Example:
salt myminion libcloud_compute.list_volumes profile1
Reboot a node in the cloud
node_id (str
) -- Unique ID of the node to reboot
profile (str
) -- The profile key
libcloud_kwargs (dict
) -- Extra arguments for the driver's reboot_node method
CLI Example:
salt myminion libcloud_compute.reboot_node as-2346 profile1