OpenStack Murano Application Catalog Overview

Murano provides an application catalog service that enables end users to easily deploy applications. Internally, Murano uses the Heat orchestration service to manage the application resources.

Administrators can use Heat Orchestration Templates to create application packages and import them into Murano.

Murano Key Concepts

Murano packages, environments and applications are the key concepts of Murano. These key concepts have been explained below.

Packages

A Murano package consists of the following three parts.

Environments

A Murano environment is a container for applications. This can be used to logically separate sets of apps.

Applications

A Murano application is a deployed package. It will be part of a Murano environment and have an associated Heat stack.

Creating A New Murano Application

Follow the steps given below to create a new Murano application.

Step 1 - Prepare the application template

The template will start with a version that corresponds to an OpenStack release.

heat_template_version: 2015-10-15

Next comes the application description.

description: >
  The Apache HTTP Server Project is a collaborative software development
  effort aimed at creating a robust, commercial-grade, featureful, and
  freely-available source code implementation of an HTTP (Web) server.

The application may accept parameters that the user will specify when deploying. If a default is specified for a parameter, a placeholder will be shown to the end user when deploying the package from the UI.

Also, in order for the UI to show dropdowns for OpenStack resources (for example, images), a custom constraint can be added. For more details on the template specification, check out the OpenStack documentation

parameters:
  image:
    type: string
    description: A Linux image with the apt-get or yum commands available
    constraints:
      - custom_constraint: glance.image
  key_name:
    type: string
    description: SSH public key used by the server
    constraints:
      - custom_constraint: nova.keypair
  flavor:
    type: string
    description: flavor used by the server
    constraints:
      - custom_constraint: nova.flavor
  network:
    type: string
    description: Network used by the server
    constraints:
      - custom_constraint: nova.network

Now we will define the application resources. To keep the template short, the installation script will assume the apt-get command is available on the instance.

resources:
  apache_http_server:
    type: OS::Nova::Server
    properties:
      flavor: { get_param: flavor }
      image: { get_param: image }
      key_name: { get_param: key_name }
      networks:
        - network: { get_param: network }
      config_drive: true
      user_data_format: RAW
      user_data: |
        #!/bin/bash
        apt-get update
        apt-get -y install apache2

Putting it all together gives us the following template.

heat_template_version: 2015-10-15
description: >
  The Apache HTTP Server Project is a collaborative software development
  effort aimed at creating a robust, commercial-grade, featureful, and
  freely-available source code implementation of an HTTP (Web) server.
parameters:
  image:
    type: string
    description: A Linux image with the apt-get or yum commands available
    constraints:
      - custom_constraint: glance.image
  key_name:
    type: string
    description: SSH public key used by the server
    constraints:
      - custom_constraint: nova.keypair
  flavor:
    type: string
    description: flavor used by the server
    constraints:
      - custom_constraint: nova.flavor
  network:
    type: string
    description: Network used by the server
    constraints:
      - custom_constraint: nova.network
resources:
  apache_http_server:
    type: OS::Nova::Server
    properties:
      flavor: { get_param: flavor }
      image: { get_param: image }
      key_name: { get_param: key_name }
      networks:
        - network: { get_param: network }
      config_drive: true
      user_data_format: RAW
      user_data: |
        #!/bin/bash
        apt-get update
        apt-get -y install apache2

Step 2 - Create and import the application package

Platform9 provides various ways of importing the package. For this step, we will use the Apache HTTP Server Template and the associated Apache HTTP Server Logo

Option 1 - Direct Input

Click Create New Application from the Applications view. Create New App

Select the Components option, and the Text option. Enter (or paste) the template contents into the text area. Components and Text option

Optionally, upload a logo. Then, click Upload Application. Upload app

Optionally, edit the application metadata, and click Update Application. Update app

Option 2 - Template Upload

Click Create New Application from the Applications view. Create New App

Select the Components option, and the Text option. Upload the template. Components and Text option

Optionally, upload a logo. Then, click Upload Application. Components and Text option

Optionally, edit the metadata and click Update Application. Upload app

Option 3 - Zip Upload

To install the Murano CLI, see the support article on Installing the OpenStack Clients

First, create the Zip package using the Murano CLI. The –logo argument is optional.

murano package-create --template ApacheHttpServer.yaml --logo ApacheHttpServer.png

Click Create New Application from the Applications view. Create New App

Select the Zip option. Upload the Zip file. Then, click Upload Application. zip format

Optionally, edit the metadata and click Update Application. Update App

Option 4 - CLI

To install the Murano CLI, see the support article on Installing the OpenStack Clients

First, create the Zip package using the Murano CLI. The –logo argument is optional.

murano package-create --template ApacheHttpServer.yaml --logo ApacheHttpServer.png

Then, upload the Zip package.

murano package-import ApacheHttpServer.zip

Deploying An Application From Catalog

Follow the steps given below, to deploy an application from the Murano application catalog.

Option 1 - 1 Click Deploy

Since a Murano application needs to be in an environment, the 1 Click Deploy button can be used to create and environment and add an application to it. 1 Click Deploy

After clicking on 1 Click Deploy, fill out the form and click Add to Environment. Deploy

This will create an Environment with the same name as the application. The environment should soon be in the ready state as shown below.

Create Environment for app

Option 2 - Creating and Modifying an Environment

Standalone environments can also be created, and applications can be added or removed as needed.

To create one, click Create New Environment. Create new environment

Specify a name and click Create Environment. Name

Now we are ready to add applications to the environment. Click Add New Application as shown below. Add application

Select the application to add, and click Next. Select application

After filling out the form, click Add to Environment. Add to Environment

The environment should soon be in the ready state as shown below. Ready state

Individual apps can also be removed by clicking on the trash icon on the application as shown below. Remove app

Option 3 - CLI

To install the Murano CLI, see the support article on Installing the OpenStack Clients. First, create an environment.

murano environment-create SampleEnvironment

Output:

Output create environment

Now, create a session for the environment using the environment id from above.

murano environment-session-create d23446e94bf54440b48a97f432982351

Output:

Created new session:
+----------+----------------------------------+
| Property | Value                            |
+----------+----------------------------------+
| id       | b5714fd874d94679b227f44623938172 |
+----------+----------------------------------+

In order to add an app to the environment, a JSON patch file that describes changes to the environment will be used. The following template shows the JSON patch structure for adding the application.

[
    {
        "op": "add",
        "path": "/-",
        "value": {
            "?": {
                "id": "===id1===",
                "type": ""
            },
            "name": "",
            "templateParameters": {
                "flavor": "",
                "image": "",
                "key_name": "",
                "network": ""
            }
        }
    }
]

List the packages in order to find the package FQN, which is a unique identifier for a package.

murano package-list

Output:

Output package list

After locating the package to deploy, replace the Package FQN in the JSON patch template. Also, specify an application name and set the templateParameters, which were defined in the Heat template for the package.

[
    {
        "op": "add",
        "path": "/-",
        "value": {
            "?": {
                "id": "===id1===",
                "type": "io.murano.apps.generated.Apachehttpserver"
            },
            "name": "ApacheApp",
            "templateParameters": {
                "flavor": "1cpu.1gb.samedisk",
                "image": "ubuntu-14.04-cloudinit",
                "key_name": "default",
                "network": "Network-virbr0"
            }
        }
    }
  ]

Assuming the JSON patch file is named apache.json, use the environment and session ids from above to modify the environment.

murano environment-apps-edit --session-id b5714fd874d94679b227f44623938172 d23446e94bf54440b48a97f432982351 apache.json

To apply the changes, the environment needs to be deployed.

murano environment-deploy --session-id b5714fd874d94679b227f44623938172 d23446e94bf54440b48a97f432982351

The environment should soon be in the ready state.

murano environment-show d23446e94bf54440b48a97f432982351

Output:

+-----------+---------------------------------------------------------------+
| Property  | Value                                                         |
+-----------+---------------------------------------------------------------+
| created   | 2016-07-30T01:21:43                                           |
| id        | d23446e94bf54440b48a97f432982351                              |
| name      | SampleEnvironment                                             |
| services  | [                                                             |
|           |   {                                                           |
|           |     "name": "ApacheApp",                                      |
|           |     "templateOutputs": {                                      |
|           |       "name": "ApacheApp-apache_http_server-fjiguqv5jtp7",    |
|           |       "first_address": ""                                     |
|           |     },                                                        |
|           |     "generatedHeatStackName": "ApacheApp",                    |
|           |     "hotEnvironment": null,                                   |
|           |     "templateParameters": {                                   |
|           |       "key_name": "default",                                  |
|           |       "flavor": "1cpu.1gb.samedisk",                          |
|           |       "image": "ubuntu-14.04-cloudinit",                      |
|           |       "network": "Network-virbr0"                             |
|           |     },                                                        |
|           |     "?": {                                                    |
|           |       "classVersion": "0.0.0",                                |
|           |       "status": "ready",                                      |
|           |       "name": null,                                           |
|           |       "package": "io.murano.apps.generated.Apachehttpserver", |
|           |       "type": "io.murano.apps.generated.Apachehttpserver",    |
|           |       "_actions": {},                                         |
|           |       "id": "6846efac2eca40d899b43315630f13af"                |
|           |     }                                                         |
|           |   }                                                           |
|           | ]                                                             |
| status    | ready                                                         |
| tenant_id | ce8e33d0989d4ea884872ca9274c26be                              |
| updated   | 2016-07-30T01:35:13                                           |
| user_id   | 4ee0c800ed674f1ebec4371c575aa38c                              |
| version   | 1                                                             |
+-----------+---------------------------------------------------------------+

To verify the stack state, use the generatedHeatStackName property from above.

heat stack-show ApacheApp

August 01, 2016