In this lab, we will create a Cloudify Manager, upload a blueprint to it, create a deployment and install it.
There are two methods for creating a Cloudify Manager:
- Via a provided image (recommended)
- Via bootstrapping
Both approaches will be covered in this lab. You may choose to practice either, or both.
The Cloudify Manager prerequisites page describes a few networking- and security-related prerequisites. You will have to ensure that you have the following:
- A security group that allows access to the manager via the ports specified in the Prerequisites page:
- Ports 80, 443 and 22, with the source being any address / CIDR / security group that you'd like to access Cloudify Manager from.
- Ports 5671, 5672, 53229, and 53333 from any VM that:
- Is going to be created by Cloudify; and
- Is going to have the Cloudify Agent installed on it.
- A security group that allows access to agents, as specified in the Agent prerequisites description.
- A network to connect the Cloudify Manager to.
- A keypair to use for SSH'ing into the Cloudify Manager VM.
TIP: For maximum flexibility, consider setting the security groups up as follows:
- Create a security group for Cloudify management (for example's sake, we will refer to it as
cloudify-management
). - Create a security group for Cloudify agents (
cloudify-agents
). - Edit
cloudify-management
's rules, allowing:- Ports 80, 443 and 22 from anywhere (in production systems, you will most likely want to restrict this by CIDR or a security group).
- Ports 5671, 5672, 53229, and 53333 from the security group
cloudify-agents
.
- Edit
cloudify-agents
's rules, allowing:- Ports 22 and 5985 from the security group
cloudify-management
.
- Ports 22 and 5985 from the security group
The advantage in this security groups setup is that no CIDR masks are involved in security group rules for the purpose of enabling agent <-> manager communication.
The official Cloudify Manager image is located at: http://repository.cloudifysource.org/cloudify/4.2.0/ga-release/cloudify-manager-4.2ga.qcow2
You can use Horizon to import the QCOW2 image into OpenStack:
- Go to Compute -> Images.
- Click Create Image.
- Provide the image's URL, as well as minimum RAM of 4GB and minimum disk space of 20GB.
- Click Create Image. The QCOW2 file will be downloaded and imported into OpenStack.
From Horizon:
- Click Launch Instance.
- In the Instance Name field, provide a name for the VM that is going to be created.
- In the Source screen, select the Cloudify Manager image.
- From the Flavor screen, select a flavour that can accommodate the Cloudify Manager VM.
- From the Networks screen, select the network you'd like the Cloudify Manager to be a part of.
- From the Security Groups screen, add a security group that satisfies the prerequisites (see above).
- From the Key Pair screen, select a keypair to associate with the new VM.
- Launch the VM.
Back at the Instances view, associate a floating IP to the new VM (unless the VM is on a network that is routable from within the machine you're accessing the manager from).
Open a browser window to http://<manager-ip-address>
. You will see the Cloudify Manager UI.
NOTE: You may need to associate a floating IP to the new VM first (depending on your network setup).
Create a virtual machine for installing the Cloudify Manager on.
- Make sure that you connect the VM to the
cloudify-management
security group.
Use the instructions provided in the Manager Bootstrapping lab to perform the bootstrap.
Once bootstrapping is complete, upload the OpenStack plugin package:
cd ~
curl -J -O https://github.com/cloudify-cosmo/cloudify-openstack-plugin/releases/download/2.2.0/cloudify_openstack_plugin-2.2.0-py27-none-linux_x86_64-centos-Core.wgn
cfy plugins upload ~/cloudify_openstack_plugin-2.2.0-py27-none-linux_x86_64-centos-Core.wgn
We will orchestrate Cloudify's "Hello World" application. The blueprints already exist on your CLI VM, under
~/hello-world
.
Switch to a CLI profile that is configured to communicate with your manager.
-
If you are using a Cloudify Manager that has been bootstrapped using the instructions of "Part 2" above, then the profile already exists and is the currently "active" one.
-
If you are using a Cloudify Manager that has been created from an image, or a Cloudify Manager for which there's no CLI profile configured yet:
cfy profiles use -t <manager's-ip-address> -u <manager-username> -p <manager-password> -t default_tenant
Create a new YAML file, ~/hw-inputs.yaml
, to contain inputs for the Hello World application.
Looking at ~/hello-world/openstack-blueprint.yaml
, construct your inputs YAML file to contain values that
are relevant to your environment.
NOTE: as the blueprint is designed to use an existing keypair, you'll have to provide the private key file to the manager.
That is the purpose of the private_key_path
input. Before continuing, you must ensure that the private key is available
at the manager side, in the location you specified in private_key_path
.
cfy install ~/hello-world/openstack-blueprint.yaml -b helloworld -d helloworld -i ~/hw-inputs.yaml
Get the floating IP address of the NodeJS node which was created on OpenStack, by retrieving the deployment's outputs:
cfy deployments outputs nc
Then browse to it (port 8080).
cfy executions start -d nc uninstall
cfy deployments delete nc
cfy blueprints delete nc