Launching your stack with Heat

To launch a Heat stack we need three things: a name for the stack, the template (HOT) that describes the deployment, and finally, the environment file that fills in the blanks of the input parameters.

Getting ready

Ensure that you are logged on to a correctly configured OpenStack client and can access the OpenStack environment. Refer to Chapter 2, The OpenStack Client, for details of setting up your environment to use OpenStack.

Tip

If you get the openstack: 'stack' is not an openstack command, refer to openstack --help.

Ensure that the python-heatclient package is installed:

sudo -H pip install python-heatclient

Also ensure that you have downloaded the example cookbook.yaml Heat template and have created the environment file, as described in the previous recipe.

How to do it...

In this section, we will download a HOT file called cookbook.yaml, which will describe our instance and the network to attach it to:

  1. We will launch the stack with the following commands:
    openstack stack create myStack
        --template cookbook.yaml
        --environment cookbook-env.yaml
    

    Tip

    Tip: You can use the -t flags instead of --template, and -e instead of --environment.

    This will produce an output like the following:

    How to do it...
  2. To view a list of stacks, execute the following command:
    openstack stack list
    

    This will bring back a list of stacks currently running:

    How to do it...

Note Stack Status. A successful launch is when it is marked as CREATE_COMPLETE.

How it works...

Launching a stack is simple. We will specify the HOT file with the --template parameter, and then we will specify the inputs that get described in the template in a file that we specify with the --environment parameter.

The syntax is as follows:

openstack stack create nameOfStack
    --template template.yaml
    --environment template-env.yaml

Note

Note that the name of the stack must be unique in your project.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.63.191