OpenStack Murano Application Catalog Overview
What is OpenStack Murano
Murano Key Concepts
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.
Packages
A Murano package consists of the following 3 parts:
- A template for creating application resources
- An application logo
- Application metadata (e.g. ownership, author, categories, tags)
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
Step 1 – Prepare the application template
The template will start with a version that corresponds to an OpenStack release. Since Platform9 is currently on Liberty, the following version should be used.
[code lang=”yaml”]heat_template_version: 2015-10-15[/code]Next comes the application description.
[code lang=”yaml”]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.[/code]
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 (e.g. images), a custom constraint can be added. For more details on the template specification, check out the OpenStack documentation.
[code lang=”yaml”]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[/code]
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.
[code lang=”yaml”]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[/code]
Putting it all together gives us the following template:
[code lang=”yaml”]heat_template_version: 2015-10-15description: >
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[/code]
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 on the “Create New Application” button from the Applications view.
Ensure that the “Components” and “Text” buttons are selected. Enter (or paste) the template contents into the text area. Optionally, upload a logo. Then click on “Upload Application”.
Optionally, edit the metadata and click “Update Application”.
Option 2 – Template Upload
Click on the “Create New Application” button from the Applications view.
Ensure that the “Components” and “File” buttons are selected. Upload the template and, optionally, the logo. Then, click on “Upload Application”.
Optionally, edit the metadata and click “Update Application”.
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.
[bash]murano package-create –template ApacheHttpServer.yaml –logo ApacheHttpServer.png[/bash]
Click on the “Create New Application” button from the Applications view.
Ensure that the “Zip” button is selected. Upload the Zip file. Then, click on “Upload Application”.
Optionally, edit the metadata and click “Update Application”.
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.
[bash]murano package-create –template ApacheHttpServer.yaml –logo ApacheHttpServer.png[/bash]
Then, upload the Zip package
[bash]murano package-import ApacheHttpServer.zip[/bash]
Deploying An Application From 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.
After clicking on “1 Click Deploy”, fill out the form and click “Add to Environment”.
This will create an Environment with the same name as the application. The environment should soon be in the “ready” state as shown below.
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”.
Specify a name and click “Create Environment”.
Now we are ready to add applications to the environment. Click “Add New Application” as shown below.
Select the application to add, and click “Next”.
After filling out the form, click “Add to Environment”.
The environment should soon be in the “ready” state as shown below.
Individual apps can also be removed by clicking on the trash icon on the application as shown below.
Option 3 – CLI
To install the Murano CLI, see the support article on Installing the OpenStack Clients.
First, create an environment.
[bash]murano environment-create SampleEnvironment[/bash]Output:
Now, create a session for the environment using the environment id from above.
[bash]murano environment-session-create d23446e94bf54440b48a97f432982351[/bash]Output:
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.
[json][{
“op”: “add”,
“path”: “/-“,
“value”: {
“?”: {
“id”: “===id1===”,
“type”: “”
},
“name”: “”,
“templateParameters”: {
“flavor”: “”,
“image”: “”,
“key_name”: “”,
“network”: “”
}
}
}
][/json]
List the packages in order to find the package FQN, which is a unique identifier for a package.
[bash]murano package-list[/bash]Output:
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.
[json][{
“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”
}
}
}
][/json]
Assuming the JSON patch file is named apache.json, use the environment and session ids from above to modify the environment.
[bash]murano environment-apps-edit –session-id b5714fd874d94679b227f44623938172 d23446e94bf54440b48a97f432982351 apache.json[/bash]To apply the changes, the environment needs to be deployed.
[bash]murano environment-deploy –session-id b5714fd874d94679b227f44623938172 d23446e94bf54440b48a97f432982351[/bash]The environment should soon be in the “ready state”.
[bash]murano environment-show d23446e94bf54440b48a97f432982351[/bash]Output:
To verify the stack state, use the generatedHeatStackName property from above.
[bash]heat stack-show ApacheApp[/bash]Editing An Existing Application
This feature is coming soon. Meanwhile, an existing package can be downloaded, modified, and re-uploaded.