O'Reilly logo

Salt Cookbook by Anirban Saha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required