Saltstack module cloud 详解

cloud.create

Create an instance using Salt Cloud

CLI Example:

    salt minionname cloud.create my-ec2-config myinstance image=ami-1624987f size='t1.micro' ssh_username=ec2-user securitygroup=default delvol_on_destroy=True

cloud.volume_list

List block storage volumes

CLI Example:

    salt minionname cloud.volume_list my-nova

cloud.network_create

Create private network

CLI Example:

    salt minionname cloud.network_create my-nova names=['salt'] cidr='192.168.100.0/24'

cloud.network_list

List private networks

CLI Example:

    salt minionname cloud.network_list my-nova

cloud.volume_detach

Detach volume from a server

CLI Example:

    salt minionname cloud.volume_detach my-nova myblock server_name=myserver

cloud.volume_create

Create volume

CLI Example:

    salt minionname cloud.volume_create my-nova myblock size=100 voltype=SSD

cloud.query

List cloud provider data for all providers

CLI Examples:

    salt minionname cloud.query
    salt minionname cloud.query list_nodes_full
    salt minionname cloud.query list_nodes_select

cloud.get_instance

Return details on an instance.

Similar to the cloud action show_instance
but returns only the instance details.

CLI Example:

    salt minionname cloud.get_instance myinstance

SLS Example:

    {{ salt['cloud.get_instance']('myinstance')['mac_address'] }}

cloud.volume_attach

Attach volume to a server

CLI Example:

    salt minionname cloud.volume_attach my-nova myblock server_name=myserver device='/dev/xvdf'

cloud.virtual_interface_create

Attach private interfaces to a server

CLI Example:

    salt minionname cloud.virtual_interface_create my-nova names=['salt-master'] net_name='salt'

cloud.action

Execute a single action on the given provider/instance

CLI Example:

    salt minionname cloud.action start instance=myinstance
    salt minionname cloud.action stop instance=myinstance
    salt minionname cloud.action show_image provider=my-ec2-config image=ami-1624987f

cloud.map_run

Execute a salt cloud map file

Cloud Map data can be retrieved from several sources:

- a local file (provide the path to the file to the 'path' argument)
- a JSON-formatted map directly (provide the appropriately formatted to using the 'map_data' argument)
- the Salt Pillar (provide the map name of under 'pillar:cloud:maps' to the 'map_pillar' argument)

Note:
    Only one of these sources can be read at a time. The options are listed
    in their order of precedence.

CLI Examples:

    salt minionname cloud.map_run /path/to/cloud.map
    salt minionname cloud.map_run path=/path/to/cloud.map
    salt minionname cloud.map_run map_pillar='<map_pillar>'
      Changed in version 2018.3.1
    salt minionname cloud.map_run map_data='<actual map data>'

cloud.destroy

Destroy the named VM(s)

CLI Example:

    salt minionname cloud.destroy myinstance

cloud.select_query

List selected nodes

CLI Example:

    salt minionname cloud.select_query

cloud.list_images

List cloud provider images for the given providers

CLI Example:

    salt minionname cloud.list_images my-gce-config

cloud.full_query

List all available cloud provider data

CLI Example:

    salt minionname cloud.full_query

cloud.list_sizes

List cloud provider sizes for the given providers

CLI Example:

    salt minionname cloud.list_sizes my-gce-config

cloud.virtual_interface_list

List virtual interfaces on a server

CLI Example:

    salt minionname cloud.virtual_interface_list my-nova names=['salt-master']

cloud.profile

Spin up an instance using Salt Cloud

CLI Example:

    salt minionname cloud.profile my-gce-config myinstance

cloud.volume_delete

Delete volume

CLI Example:

    salt minionname cloud.volume_delete my-nova myblock

cloud.list_locations

List cloud provider locations for the given providers

CLI Example:

    salt minionname cloud.list_locations my-gce-config

cloud.has_instance

Return true if the instance is found on a provider

CLI Example:

    salt minionname cloud.has_instance myinstance
posted @ 2020-03-28 20:22  random_lee  阅读(126)  评论(0编辑  收藏  举报