This lab will guide you through the process of creating a service catalog in CloudForms.
One of the features a Cloud Management Platform provides, is a self service user interface. Here users can order, manage and retire services. Services are categorized in catalogs, where they can be organized and easily consumed.
By providing a service catalog, users can deploy the services they need quickly and simply. This will improve agility, reduce provisioning time and free up resources in internal IT.
But first some basics. Four items are required to make a service available to users from the CloudForms self service portal:
A Provisioning Dialog which presents the basic configuration options for a virtual machine or instance. A Service Dialog where you allow users to configure virtual machine or instance options. A Service Catalog which is used to group Services Catalog Items together. A Service Catalog Item (the actual Service) which combines a Service Dialog, a Provisioning Dialog and some additional meta data in the Service Catalog.
We can also use Role Based Access Control to make certain Service Catalog Items available to specific groups of users.
The first example will guide you through the process of offering a Service Catalog Item to provision a simple virtual machine. This will include:
The previous chapter mentions a fourth object, the Provisioning Dialog. We do not have to create one, since there are examples shipped with the product, which does everything we need.
The following chapters will guide you through the process step-by-step.
For this example we will create a Service Dialog which will ask the user for two parameters:
the name of the new virtual machine
how much memory should be allocated to the new virtual machine
Follow these steps to design the service dialog:
Navigate to Automation -> Automate -> Customization
Navigate to Service Dialogs in the accordion on the left.
Click on Configuration -> Add a new Dialog
Chose a label and description:
Label: Simple VM
Description: Simple VM provisioning dialog
Make sure Submit and Cancel are both checked
Do not try to save the changes right now! The dialog is not finished and you will receive and error message (“Validation failed: Dialog Simple VM must have at least one Tab”)
Click on the little plus icon in the menu on the top and select Add a new Tab to this Dialog
Tabs can be used to make complex Service Dialogs easier to navigate and fill out. They are often used to logically structure related questions (e.g. “General Configuration”, “Network Configuration”, “user Configuration”).
For this lab, we will keep it simple:
Label: Generic
Description: Generic Tab
Click on the little plus icon and Add a new Box to this Tab
Boxes are used to visually group related dialog elements. For example in the network configuration Service Dialog a box could be used to group all IPv4 related questions, and another box to group all IPv6 related questions.
For this lab we create a simple box:
Label: Generic
Description: Generic Box
Now we can add elements to this box. Click on Add a new Element to this Box
The first element will allow the user to specify a VM name:
Label: VM Name
The Label is the name of the element as it will be shown in the UI,
Name: option_0_vm_name
The name will be used for the internal variable of the provisioning workflow.
Description: Specify the name of the new virtual machine
The description is some text which will be shown if the mouse pointer is hovering over this element. It can be used to provide additional information to the user to fill out this field.
CloudForms allows us to design Service Dialogs comprised of many different types of Elements:
Check box: allows to user to check or uncheck the element, often used to ask for additional optional data
Date Control: allows the user to select a date from a calender widget. Often used for retirement or other date related options
Date/Time Control: same as Date Control, but also allows to specify a time, for example used to specify an automated shutdown or if a change should be scheduled for later
Drop Down List: allows the user to select one or multiple options from a list, for example to chose from a list of available networks, applications, cost centers and many more
Radio Button: Similar to the check box, but only one of the options can be selected, for example the base OS version (RHEL 6 or RHEL 7, but never more than one)
Tag Control: a special element which allows the user to chose from available tags. More about tagging later in this lab
Text Area Box: allows the user to enter relatively large amounts of text (multiple lines), could be used for example to provide description information
Text Box: allows the user for short amounts of text (one line), in this example we use this element to ask the user for a name of the virtual machine
We want the user to enter a text which then will be used to name the VM. This can be accomplished by selecting “Text Box” in the Type drop down list.
The remaining options can be ignored for now.
We want to add a second element where the user can chose the memory size of the new VM. Click once more on Add a new Element to this Box.
Label: Memory size
Name: option_0_vm_memory
Description: Select how much memory the virtual machine should have
Type: Drop Down List
A element of type “Drop Down List” allows the user to select one of the predefined values. To create the list of selectable values, scroll down to the table “Entries” and add the following lines:
Value: 2048
Description: 2 GB
Value: 4096
Description: 4 GB
Value: 8192
Description: 8 GB
To be able to add a line to the table, click on the little “Add this entry” icon on the left of each row!
We are finally done designing the dialog. Click on Add to save the dialog.
If you’re having trouble creating the Service Dialog, you can download it from Github and import it. Follow the instructions on how to import a service dialog ONLY if you were unable to create the dialog.
The following steps will create a Service Catalog.
The next step is to create a Service Catalog. First we have to navigate to Services -> Catalogs.
Click on Catalogs in the accordion on the left
Click on Configuration and Add a New Catalog
Fill out name and description:
Name: Virtual Machines
Description: Deploy Virtual Machines from the Catalog
Click Add to save the Service Catalog
To tie everything together, the last step is to define a service catalog item.
Navigate to Services -> Catalogs
Click on Catalog items in the accordion on the left.
You should already see two Service Catalogs:
Unassigned: Catalog items which are not published yet, will be listed here
Virtual Machines: the Service Catalog we just created in the previous step
In the Configuration Menu, click on Add a New Catalog Item
Catalog Bundles are used for multi tier applications and consist of many Catalog Items. Since we do not have any existing Catalog Items, we can not create a Bundle.
Chose the Catalog Item Type. For this example we want to use the Red Hat Virtualization Provider, so click on RHEV
It can take a few seconds for the next screen to load.
The next dialog will ask for the details of the new Service Catalog Item:
Name: Simple VM
The name of the Service Catalog Item shown in the UI.
Description: A simple Linux Virtual Machine
A more descriptive text about the Service Catalog Item.
Display in Catalog: check this box
Check the “Display in Catalog” box. If not selected, the Service Catalog Item will not be visible to users. This can be used for Items which are either still in draft mode, or should only be ordered as a part of a bundle.
Select the previously created Service Catalog:
Catalog: Virtual Machines
Select the previously created Service Dialog:
Dialog: Simple VM
All other fields on this tab can remain unchanged.
Entry Points are the hooks into CloudForms’ powerful Automation Framework. It allows administrators to define provisioning, reconfiguration and retirement workflows which are different from the out of the box behavior. For example we could add integration into an IP Address Management Tool, a ticketing system or a CMDB Service. For this lab, we want to stick with the out of the box experience and leave those fields unchanged.
Click on the Details tab. You can provide some more descriptive explanation about the service here. We can even use basic HTML formatting in this box.
<h1>Simple VM</h1>
<p>When ordering this item, the user will be provided some simple questions to specify the hostname and memory size of the requested virtual machine.</p>
<p>The VM will be deployed with <a href=http://www.redhat.com>Red Hat Enterprise Linux 7</a>.
The Request Info tab of the dialog allows us to provide all the settings we want to use when provisioning a virtual machine from this Service Catalog Item.
Select the template used for provisioning:
Selected VM: rhel73
For automatic naming chose “changeme”
Naming: changeme
If no name is specified, this will cause CloudForms to automatically assign a name based on “cfme” as a prefix. The name will be expanded with a unique ID starting with 001.
Click on the sub tab Environment
Although it sounds the most convenient option, we can not use “Choose Automatically”. This will require the definition of a provisioning scope, which we haven’t done yet. Instead we we set the appropriate values manually.
Datacenter: Default
The datacenter of our Red Hat Virtualization Provider.
Cluster: Default
The cluster in the Red Hat Virtualization Datacenter.
Host: rhelkvm
The host which will perform the actual tasks and where the VM will initially run on.
Datastore: vmstore00
The storage domain to store the VM.
Click on the next sub tab Hardware
For the purpose of the lab, the provided defaults are fine.
Click on the next sub tab Network
The lab environment is very simple, there is only one VLAN available:
VLAN: rhevm
Click on the next sub tab Customize
This allows to reconfigure certain settings inside the virtual machine. For this lab, we keep them all empty
Click on the last sub tab Schedule
This allows us to delay provisioning to a later time, for example during the night or off hours. We can also set a retirement date. After notifying the user and allowing him or her to extend the lifespan of the virtual machine, retirement will shutdown and, by default, delete the virtual machine.
For the purpose of the lab, we keep these settings unchanged.
Finally click on Add to save the Catalog Item
For sure you want to test the Service Catalog Item you just created!
Navigate to Services -> Catalogs and then click on Service Catalogs in the accordion on the left.
You should see the Service Catalog Item we just created:
Click on the Item to see more details.
Note that the Link for Red Hat Enterprise Linux in fact opens the Red Hat Homepage.
Click on Order
The Service Dialog we created earlier will be presented and ask for the name of the virtual machine and the memory size. As you can see, the name is a free text field, and the memory size is a drop down list.
Chose an example virtual machine name and the amount of memory you would like to be allocated.
You will be redirected to the request queue where you can see CloudForms working on your request.
Since we are using nested virtualization to run these labs, performance will be slow and it can take several minutes to complete the request (20-30 minutes).
In the requests queue you can click on Reload to see how CloudForms processes the order. If you click the button a few times, you should see the status is progressing.
We want to log into Red Hat Virtualization to see how the virtual machine is created:
Open the Red Hat Virtualization Web UI in a new browser window or tab.
URL: https://rhevm-<GUID>.rhpds.opentlc.com
Click on Administrator Portal
Log in with these credentials:
user: admin
Password: r3dh4t1!
Make sure the profile is set to “internal”.
Click on the tab Virtual Machines to see all existing virtual machines
After a few moments you’re virtual machine should automatically show up in the list.
Note that while the virtual machine is created, the memory size is still 1 GB. This value is specified in the template therefore copied when creating the virtual machine. Only after the virtual machine was successfully cloned, CloudForms corrects the memory size.
This concludes this first part of the lab
In the first part of the lab you have learned:
how to design a Service Dialog
how to create a Service Catalog
put everything together with a Service Catalog Item
order from the Service Catalog
In the second part of the lab, we want to use HEAT to create a new instance and to provision an application inside the instance. We are using the probably most popular example: Wordpress. The HEAT template we use, can be found in the OpenStack Git Repository.
In the previous lab, we had to create a Service Dialog manually. With HEAT, CloudFormations and Microsoft ARM Templates, CloudForms can automatically create a Service Dialog for us. We can still edit this automatically created Service Dialog, to adjust it to our needs.
Before we can import the template into CloudForms, we need to download it or have it open in a separate browser window.
Please used the forked version of the HEAT Template, which has an additional field “Network” defined. Without this field, running the HEAT Template will fail with an error indicating that mulitple networks are available and hence a network has to be specified.
Go to the template on the Github project page.
Make sure to open the file in “RAW” mode or use this link: https://raw.githubusercontent.com/cbolz/partner-conference-2017-labs/master/cloudforms-service-catalog-lab/HEAT/WordPress_Native.yaml
Download the HEAT Template or open it in a separate browser window so you can copy and paste it into the CloudForms Web UI
The following procedure will import a HEAT template, create a service dialog and tie everything together in a service catalog item.
Navigate to Services -> Catalogs
Click on Orchestration Templates in the accordion on the left
You should see one existing templates which is provided by CloudForms out of the box. It’s a special predefined template to provision virtual machines on Microsoft Azure.
Create a new Orchestration template by clicking on Configuration -> Create new Orchestration Template
Give the template a name and description:
Name: Wordpress HEAT Template
Description: This template can be used to deploy a Wordpress instance on OpenStack
Template Type: OpenStack Heat
Copy and paste the HEAT Template you downloaded before into the large text area below those fields. Make sure you copy the entire HEAT template by opening the RAW page of the file on Github.
The screenshot is truncated! Make sure you copy the entire HEAT Template! The first line should be:
heat_template_version: 2013-05-23
And the last line should be:
host: { get_attr: [wordpress_instance, first_address] }
Click Add to save the orchestration template
Earlier in this lab you learned how to manually create a Service Dialog. Now we will see that CloudForms can do this work for us, if we use an orchestration template.
Navigate to the orchestration template you just created
Click on Configuration -> Create Service Dialog from Orchestration Template
Enter a name for the new Service Dialog
Service Dialog Name: Wordpress HEAT Template
Click on Save to create the Service Dialog
The Service Dialog was automatically created. We want to verify it was created properly and has all the expected fields.
Navigate to Automation -> Automate -> Customization
Navigate to Service Dialogs in the accordion on the left.
Click on the new Service Dialog “Wordpress HEAT Template”
A preview will show how the Service Dialog will look like, when it’s used in a Service Catalog Item.
The preview shows us that the Service Dialog is using a default image called “fedora-20.x86_64”. We do not have such an image and want to change the Service Dialog accordingly.
Click on Configuration -> Edit this Dialog. Navigate to the element called “Image”
Change the value of the field “Default Value”
Default Value: rhel7.2
Commit the changes by clicking on Save
The following steps will create a service catalog.
The next step is to create a service catalog. First we have to navigate to Services -> Catalogs.
On this screen click on Catalogs on the left
Click on Configuration and Add a New Catalog
Fill out name and description:
Name: HEAT Templates
Description: Deploy HEAT Templates from the Catalog
Click Add to save the Service Catalog
To put everything together we create a Service Catalog Item similar to before.
Navigate to Services -> Catalogs
Click on Catalog items in the accordion on the left.
You should already see three Service Catalogs:
Unassigned: Catalog Items which are not published yet, will be listed here
Virtual Machines: the Service Catalog we created in the first part of the lab
HEAT Templates: the Service Catalog you just created
In the Configuration Menu, click on Add a New Catalog Item
Chose the Catalog Item Type. For this example we want to use HEAT on OpenStack which is an Orchestration provider, so click on Orchestration
The next dialog will ask for the details for the new Catalog Item
The name of the Catalog Item shown in the UI:
Name: Wordpress
A more descriptive text about the Catalog Item:
Description: Wordpress from HEAT
Check the “Display in Catalog” box. If not selected, the Catalog Item will not be visible to users. This can be used for Items which are either still in draft mode, or should only be ordered as a part of a bundle.
Display in Catalog: check this box
Select the previously created Service Catalog:
Catalog: HEAT Templates
Select the previously created Service Dialog:
Dialog: Wordpress HEAT Template
The template to execute:
Orchestration Template: Wordpress HEAT Template
Select on which provider the HEAT Template should be executed:
Provider: OpenStack
All other fields on this tab can remain unchanged.
Entry Points are the hooks into CloudForms’ powerful Automation Framework. It allows administrators to define provisioning, reconfiguration and retirement workflows which are different from the out of the box behavior. For example we could add integration into an IP Address Management Tool, a ticketing system or a CMDB Service. For this lab, we want to stick with the out of the box experience and leave those fields unchanged.
Click on the Details tab. You can provide some more descriptive explanation about the Service Catalog Item. We can even use basic HTML formatting in this box.
Finally click on Add to save the Service Catalog Item
For sure you want to test the Catalog Item you just created!
Navigate to Services -> Catalogs and then click on Service Catalogs in the accordion on the left.
You should see the Service Catalog Item we just created:
Click on the Service Catalog Item to see more details.
Click on Order
Fill out the form:
Select the tenant into which you want to deploy. There is only one tenant in OpenStack called “admin”
Tenant: Admin
Specify a stack name for your deployment:
Stack Name: wordpress001
For all other fields the provided default values can be accepted. Note that the image name is “rhel7.2” as you specified in your dialog.
Click on Submit to start the deployment.
You will be redirected to the request queue where you can see CloudForms working on your request.
Since we are using nested virtualization to run these labs, performs will be slow and it can take several minutes to complete the request (20-30 minutes).
Let’s log into OpenStack to see what’s happening there.
Log into OpenStack:
https://osp-<GUID>.https://osp-.rhpds.opentlc.com
Make sure you use the HTTPS URL!
username: admin
Password: r3dh4t1!
Navigate to Project in the menu bar on the top
Navigate to Orchestration -> Stacks
You should see your stack. It might already be completed or still in progress. If you can’t see it yet, wait a minute and reload the page.
Click on the stack to get the details
This concludes this section of the lab.