Using OpenStack Dashboard with OpenStack Orchestration

Heat is the OpenStack Orchestration engine that enables users to quickly spin up whole environments using templates. Heat templates, known as Heat Orchestration Templates (HOT), are Yet Another Markup Language (YAML) based files. The files describe the resources being used, the type and the size of the instances, the network an instance will be attached to, among other pieces of information required to run that environment.

In the previous chapter, we showed you how to use the Heat command line client. In this section, we will show how to use an existing Heat template file in OpenStack Dashboard to spin up two web servers running Apache, connected to a third instance running HA Proxy.

Getting ready

Load a web browser, point it to our OpenStack Dashboard address at http://192.168.100.200/ and log in as an admin user, such as the admin user created in the Adding users to Keystone recipe of Chapter 1, Keystone – OpenStack Identity Service, with the password openstack.

How to do it...

First, we will launch stack within our OpenStack Dashboard.

Launching stacks

To launch a Heat stack for a logged in user, carry out the following steps:

  1. To view available Heat stacks within our OpenStack Dashboard, select the Stacks tab under the Orchestration menu:
    Launching stacks
  2. After clicking on the Stacks tab, you will see all running stacks in your environment. In our case, our list is empty:
    Launching stacks
  3. Click on the Launch Stack button to create a new stack. You will see the following window:
    Launching stacks
  4. There are several ways to specify what template source to use in a stack: File, Direct Input, or URL. Choose which option is the most convenient for you. For our example, you can either use the URL directly or upload a file. The template file can be downloaded from https://raw.githubusercontent.com/OpenStackCookbook/OpenStackCookbook/master/cookbook.yaml. We will upload files from our system.
  5. Just like we downloaded the cookbook.yaml file, we can also download the Environment Source file. In this case, we do not have to use the environment source, but it makes it convenient. The environment file stores the values we would have to enter into the browser manually, but instead loads the values for us on the Launch Stack screen, as shown in step 8. In our example, we are using the environment file that can be downloaded from https://raw.githubusercontent.com/OpenStackCookbook/OpenStackCookbook/master/cookbook-env.yaml. Update the public_net_id, private_net_id, and private_subnet_id fields to match your environment.

    Note

    If you are not sure where to find network information, please refer to the Using OpenStack Dashboard to manage Neutron networks recipe in this chapter.

  6. After selecting the Template Source and Environment Source files, click on Next:
    Launching stacks
  7. Our sample environment file contains the following code:
    parameters:
      key_name: demokey
      image: trusty-image
      flavor: m1.tiny
      public_net_id: 5e5d24bd-9d1f-4ed1-84b5-0b7e2a9a233b
      private_net_id: 25153759-994f-4835-9b13-bf0ec77fb336
      private_subnet_id: 4cf2c09c-b3d5-40ed-9127-ec40e5e38343
  8. Clicking on Next will give you a Launch Stack window with all the inputs:
    Launching stacks
  9. Note that most of the inputs in our template are now populated. If you did not specify the environment source file in the previous step, you will need to enter the key_name, image, flavor, public_net_id, private_net_id, and private_subnet_id fields.

    Tip

    These fields are specific to each template used. Your templates may have different fields.

  10. Enter the stack name and user password for your user. If you are logged in as admin or demo, the password is openstack.
  11. Click on the Launch button to start stack creation. If all inputs were correct, you should see your stack being created:
    Launching stacks
  12. After the stack creation finishes and if there were no errors during creation, you will see your stack's status updated to Complete:
    Launching stacks

Viewing stack details

After launching a stack, there is a lot of information associated with it, including inputs, outputs, and, in the case of errors, information about why stack creation failed.

  1. To view the details of the stack, click on the stack name from the Stacks list. The first available view is Topology:
    Viewing stack details

    Explore the topology by clicking on the nodes. If the graph does not fully fit or you would like a different perspective, you can drag the graph around the window.

  2. The next tab under Stack Detail will provide all of the information that was used in creating the stack:
    Viewing stack details

    Stack information available in the Overview tab is as follows:

    • Info
    • Status
    • Outputs
    • Stack parameters
    • Launch parameters
  3. The Resources tab will show all the HEAT resources that were created during stack launch:
    Viewing stack details

    If there were any errors during stack launch, check this page to see which component's creation failed.

  4. The Events tab shows all the events that occurred when the stack was created. This page can also be very helpful in troubleshooting Heat templates:
    Viewing stack details
  5. While your Heat stack is running, you can also see how many instances it created under the Compute tab's Instance option. The following is what our instances look like on the Instances page:
    Viewing stack details

Note

Note that the test1 instance was not part of the stack creation. All the other VMs were created during the stack launch.

Deleting stacks

Stack deletion is simple; however, it will delete all resources that were created during stack launch. Follow these steps:

  1. To delete a stack, first view the available stacks on the Stacks page:
    Deleting stacks
  2. Click on the appropriate Delete Stack button to delete a stack. You will be asked to confirm the deletion:
    Deleting stacks
  3. After confirming deletion, all resources associated with the stack will be deleted.

How it works...

We have used the OpenStack Dashboard to launch, view, and delete Orchestration stacks. We first needed to download a sample HA Proxy Heat Orchestration Template from GitHub. Since we were using an environment file, we also had to modify the appropriate inputs. Your own templates may have different inputs.

After launching our HA Proxy stack, we explored its topology, resources, and events. Resources created during stack launch will also be reflected in the rest of your environment. If you are launching new instances, all of them will also be available on the Instance page. Delete and modify resources created during the stack launch only through Orchestration section in the OpenStack dashboard or on the command line. Deleting stacks through the dashboard will delete all associated resources.

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

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