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 HOT (Heat Orchestration Templates) are YAML (Yet Another Markup Language) based files. The files describe the resources being used, and the type and size of the instances, and the network an instance will be attached to, among other pieces of information required to run that environment.

In Chapter 9, OpenStack Orchestration Using Heat and Ansible, 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.117/, and log in as a user in the default domain, such as the developer user, created in the Common OpenStack identity tasks recipe in Chapter 2, The OpenStack Client, with the cookbook4 password. The URL for our dashboard is same as the public load balancer IP as discussed in Chapter 1, Installing OpenStack with Ansible. If you need to find out at what URL your Horizon is, use public IP from the OpenStack catalog list as described in Chapter 3, Keystone – OpenStack Identity Service.

How to do it…

This recipe will walk you through the launching and deleting of orchestration stacks using the 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 from the Orchestration menu, as shown in the following screenshot:
    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, as shown here:
    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. A template file can be downloaded from here: https://raw.githubusercontent.com/OpenStackCookbook/OpenStackCookbook/master/cookbook.yaml. We will use the URL option and use the link directly in the template.
  5. Just like the template source file can be uploaded, we can also upload the Environment Source file. In this case, we do not have to use environment source, but it makes the process 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 an environment file that can be downloaded from here: 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.

    Tip

    If you are not sure where to find network information, refer to the Using OpenStack Dashboard to manage Neutron networks and routers recipe.

  6. After selecting the Template Source and Environment Source files, click on Next:
    Launching stacks
  7. Our sample environment file contains the following:
    parameters:
      key_name: web
      image: ubuntu-xenial
      flavor: small
      public_net_id: eacdcb30-9c41-4be5-8954-d8dfff793512
      private_net_id: 9db0448b-eb48-4cd0-ac01-676266c3463e
      private_subnet_id: 4485b7ba-d895-487a-83c7-a319e90549ba
  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 an 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.

    Note

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

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

    Launching stacks

Viewing stack details

After launching a stack, there is a lot of information associated with each, including inputs, outputs, and in case of errors, information of 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 is Overview, it 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. The Template tab will show the template that was used to create the stack.
  6. While your Heat stack is running, you can also see how many instances it created in the Instance option of the Compute tab. This is what our instances look like on the Instances page:

    Viewing stack details

Deleting stacks

Stack deletion is simple, however note that, when deleting, it will delete all resources that were created during stack launch.

  1. To delete a stack, first view available stacks on the Stacks page:
    Deleting stacks
  2. Select the stack to delete and click on the Delete Stacks 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 used the OpenStack Dashboard to launch, view, and delete Orchestration stacks. We first needed to download a sample HAProxy Heat Orchestration Template (HOT) from GitHub. Since we were using an environment file, we also had to modify appropriate inputs. Your own templates may have different inputs.

After launching our HAProxy 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 Instances page. Delete and modify resources created during the stack launch only through the Orchestration section in OpenStack dashboard or on 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
3.17.76.218