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

Get Salt Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.