Hello World Walkthrough on OpenStack

Hello World Walkthrough on OpenStack

You are here:
< Back

About this tutorial

This tutorial will walk you through deploying your first blueprint, a python webserver that says “Hello World” with a Cloudify logo, on OpenStack.

Install Cloudify Manager and Upload Plugins

1. Spin up a Cloudify Manager on your local machine. This requires Docker to be installed as well. Copy and paste the below into your terminal and wait for that to finish:

sudo docker run --name cfy_manager_local -d --restart unless-stopped -v /sys/fs/cgroup:/sys/fs/cgroup:ro --tmpfs /run --tmpfs /run/lock --security-opt seccomp:unconfined --cap-add SYS_ADMIN -p 80:80 -p 8000:8000 cloudifyplatform/community:18.10.4

2. SSH into the Docker machine with

docker exec -it cfy_manager_local /bin/bash

3. Install the plugins bundle (this installs 11 plugins, not all of which are necessary for this example). Copy and paste the below into your terminal:

cfy plugins bundle-upload

Create secrets

Secrets are a more secure way to pass inputs such as passwords and keys for your deployments. You can create secrets using the terminal or from Cloudify Console (the UI) – both options are presented below.

Option 1: Using the Terminal

*Replace “[value]” with the actual value for the secret.

cfy secrets create keystone_username --secret-string [value]
cfy secrets create keystone_password --secret-string [value]
cfy secrets create keystone_tenant_name --secret-string [value]
cfy secrets create keystone_url --secret-string [value]

Option 2: Using Cloudify Console (UI)

1. Open your browser to and login with username admin and password admin

2. Click on “System Resources” from the side menu

3. Click the “Create” button in the Secret Store Management widget

4. Add the key and value for each secret individually (key names: keystone_username, keystone_password, keystone_tenant_name, keystone_url), then click “Create”

Deploying the application

Now let’s deploy our application. We will offer both a terminal as well as UI option.

Option 1: Using the Terminal

The below command will deploy the Hello World application on your cloud of choice.

*Replace information inside [] with actual values, without the []

cfy install https://github.com/cloudify-cosmo/cloudify-hello-world-example/archive/master.zip -n openstack.yaml -b hello-world-openstack \
    -i region=[YOUR REGION] \
    -i external_network_name=[YOUR NETWORK NAME] \
    -i image=[YOUR IMAGE ID] \
    -i flavor=[YOUR FLAVOR ID]

Next, run

cfy deployment outputs [DEPLOYMENT ID]

The Deployment ID will be “hello-world-openstack” or similar and the output will look like this:

cfy deployment outputs hello-world-openstack
Retrieving outputs for deployment hello-world-openstack...
 - "application_endpoint":
     Description: The external endpoint of the application.
     Value: http://IP_ADDRESS_OF_APP:80

Find the “Value” and enter that IP address into your browser and if you see the below image, you did it!

To tear down the deployment, simply run the command below and the application, as well as blueprint, will be deleted.

cfy uninstall [DEPLOYMENT ID]

Option 2: Using Cloudify Console (UI)

1. In the Cloudify UI, navigate to Local Blueprints select Upload.

2. Right-click and copy this link. Paste the URL where it says Blueprint package. Provide a name, such as hello-world-openstack, in the field labeled Blueprint name. Select the openstack.yaml blueprint from the Blueprint YAML file dropdown and click Upload.

3. After the new blueprint has been created, click the button and enter your Deployment name such as hello-world-openstack and any other required inputs. Then click, the Deploy button.

4. Navigate to the Deployments page, find your new deployment, select Install from the menu and then Execute.

5. You can click on the deployment name to see the logs. Once the operation is complete, you will see the following in the logs:

6. Above the logs you will find the Deployment Outputs widget with the IP address of your application. Paste that address into your browser and if you see the below image, you did it!

7. To tear down the deployment, go back to the Deployments page, click on the and choose Uninstall from the menu, then click Execute. When the uninstall workflow is complete, you can also remove the deployment by choosing Delete option from that same menu and clicking Execute.

Last Updated On October 19, 2018