Book Image

Salt Cookbook

By : Anirban Saha
Book Image

Salt Cookbook

By: Anirban Saha

Overview of this book

Table of Contents (18 chapters)
Salt Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Launching, querying, and destroying instances


Once all our configurations are done, it is time to actually use them and launch the instances. In this recipe, you will learn how to launch, query, and destroy instances.

How to do it...

  1. Create a new file /etc/salt/cloud.map.app, and edit it to have the following entries:

    cloudopen_ec2_prod_app_us-west-2a:
      - cookbookapp01
    
    cloudopen_ec2_prod_app_us-west-2b:
      - cookbookapp02
  2. Execute the following command to launch an instance without using the map file:

    [root@salt-master ~]# salt-cloud -p cookbook_ec2_prod_db cookbookdb08
    [INFO    ] salt-cloud starting
    [INFO    ] Creating Cloud VM cookbookdb08 in us-west-2
    [INFO    ] Attempting to look up root device name for image id ami-721b7b42 on VM cookbookdb08
    [INFO    ] Found root device name: /dev/sda1
    [INFO    ] Created node cookbookdb08
    [INFO    ] Salt node data. Private_ip: 172.31.16.184
    Warning: Permanently added '172.31.16.184' (RSA) to the list of known hosts.
    [INFO    ] Rendering deploy script:...