Service Catalogs

Build a Service Catalog with CloudForms

This lab will guide you through the process of creating a service catalog in CloudForms.

What’s the value of having a service catalog?

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.

Service Basics

But first some basics. Four items are required to make a service available to users from the CloudForms self service portal:

  1. A Provisioning Dialog which presents the basic configuration options for a virtual machine or instance.
  2. A Service Dialog where you allow users to configure virtual machine or instance options.
  3. A Service Catalog which is used to group Services Catalog Items together.
  4. 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.

Virtual Machine Provisioning example

The first example will guide you through the process of offering a Service Catalog Item to provision a simple virtual machine. This will include:

  • Design a Service Dialog: a form which will ask the user for the necessary input data
  • Create a Service Catalog: this will allow to organize services in a structured way
  • Publish a Service Catalog Item: puts everything together and build the item which users can order

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.

Build a VM Provisioning Service Dialog

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:

  1. Navigate to Automation -> Automate -> Customization

    navigate to Automation, Automate, Customization

  2. Navigate to Service Dialogs in the accordion on the left.

    navigate to service dialogs

  3. Click on Configuration -> Add a new Dialog

  4. 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”)

![create a service dialog](/img/rhte-fy18-service-catalog-create-service-dialog.png)
  1. 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

    add a new tab to the dialog

  2. 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

    add a new box to the tab

  3. 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:

    The Label is the name of the element as it will be shown in the UI:

    Label: VM Name

    The name will be used for the internal variable of the provisioning workflow:

    Name: option_0_vm_name

    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:

    Description: Specify the name of the new virtual machine

    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.

    add a new element to ask for the VM name

    The remaining options can be ignored for now.

  4. 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!

![add entries to the drop down list](/img/rhte-fy18-service-catalog-memory-dropdownlist.png)
  1. 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.

Build a VM Provisioning Service Catalog

The following steps will create a Service Catalog.

  1. The next step is to create a Service Catalog. First we have to navigate to Services -> Catalogs.

    navigate to services, catalog

  2. Click on Catalogs in the accordion on the left

    service catalogs

  3. Click on Configuration and Add a New Catalog

  4. Fill out name and description:

    Name: Virtual Machines

    Description: Deploy Virtual Machines from the Catalog

    add a new catalog

  5. Click Add to save the Service Catalog

Build a Virtual Machine Service Catalog Item

To tie everything together, the last step is to define a service catalog item.

  1. Navigate to Services -> Catalogs

    navigate to services, catalog

  2. 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

    navigate to catalog items

  3. 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.

  4. Chose the Catalog Item Type. For this example we want to use the Red Hat Virtualization Provider, so click on RHEV

    select catalog item type

It can take a few seconds for the next screen to load.

  1. The next dialog will ask for the details of the new Service Catalog Item:

    The name of the Service Catalog Item shown in the UI:

    Name: Simple VM

    A more descriptive text about the Service Catalog Item:

    Description: A simple Linux Virtual Machine

    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:

    Display in Catalog: check this box

    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.

    adding a new catalog item

    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.

  2. 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>.
    
  3. 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.

  4. 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.

    The datacenter of our Red Hat Virtualization Provider:

    Datacenter: Default

    The cluster in the Red Hat Virtualization Datacenter:

    Cluster: Default

    The host which will perform the actual tasks and where the VM will initially run on:

    Host: rhelkvm

    The storage domain to store the VM

    Datastore: vmstore00

  5. Click on the next sub tab Hardware

    For the purpose of the lab, the provided defaults are fine.

  6. Click on the next sub tab Network

    The lab environment is very simple, there is only one VLAN available:

    VLAN: rhevm

  7. 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

  8. 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.

  9. Finally click on Add to save the Catalog Item

    catalog item saved

Order the Simple Virtual Machine Service Catalog Item

For sure you want to test the Service Catalog Item you just created!

  1. Navigate to Services -> Catalogs and then click on Service Catalogs in the accordion on the left.

    navigate to services, catalog

  2. You should see the Service Catalog Item we just created:

    all services

  3. Click on the Item to see more details.

    service item details

    Note that the Link for Red Hat Enterprise Linux in fact opens the Red Hat Homepage.

  4. Click on Order

  5. 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.

    example-oder-simple-vm

  6. You will be redirected to the request queue where you can see CloudForms working on your request.

    simple vm ordered

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).

Verify the order

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:

  1. Open the Red Hat Virtualization Web UI in a new browser window or tab.

    URL: https://rhevm-<GUID>.rhpds.opentlc.com
    

    rhv portal page

  2. Click on Administrator Portal

    rhv admin portal

  3. Log in with these credentials:

    ***user:*** admin
    
    ***Password:*** r3dh4t1!
    

    Make sure the profile is set to “internal”.

  4. Click on the tab Virtual Machines to see all existing virtual machines

    vm overview

  5. After a few moments you’re virtual machine should automatically show up in the list.

    lab VM showing up

    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.

    lab VM complete

  6. This concludes this first part of the lab

HEAT Provisioning example

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.

Prepare the HEAT Template

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.

  1. Go to the template on the Github project page.

    https://github.com/cbolz/partner-conference-2017-labs/blob/master/cloudforms-service-catalog-lab/HEAT/WordPress_Native.yaml

  2. 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

  3. Download the HEAT Template or open it in a separate browser window so you can copy and paste it into the CloudForms Web UI

Import the HEAT Template

The following procedure will import a HEAT template, create a service dialog and tie everything together in a service catalog item.

  1. Navigate to Services -> Catalogs

    navigate to services catalogs

  2. Click on Orchestration Templates in the accordion on the left

    orchestration templates

    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.

  3. Create a new Orchestration template by clicking on Configuration -> Create new Orchestration Template

  4. 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.

    wordpress template

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] }
  1. Click Add to save the orchestration template

    orchestration template saves

Create a Service Dialog from a HEAT 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.

  1. Navigate to the orchestration template you just created

  2. Click on Configuration -> Create Service Dialog from Orchestration Template

    create service dialog from wordpress heat template

  3. Enter a name for the new Service Dialog

    Service Dialog Name: Wordpress HEAT Template

    create service dialog from orchestration template

  4. Click on Save to create the Service Dialog

    service dialog from orchestration template created

Verify the Service Dialog

The Service Dialog was automatically created. We want to verify it was created properly and has all the expected fields.

  1. Navigate to Automation -> Automate -> Customization

    navigate to Automation, Automate, Customization

  2. Navigate to Service Dialogs in the accordion on the left.

    navigate to service dialogs

  3. Click on the new Service Dialog “Wordpress HEAT Template”

  4. A preview will show how the Service Dialog will look like, when it’s used in a Service Catalog Item.

    service dialog preview

  5. 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.

  6. Click on Configuration -> Edit this Dialog. Navigate to the element called “Image”

    edit the image name

  7. Change the value of the field “Default Value”

    Default Value: rhel7.2

    change the image name

  8. Commit the changes by clicking on Save

    after saving the changes

Build a HEAT Service Catalog

The following steps will create a service catalog.

  1. The next step is to create a service catalog. First we have to navigate to Services -> Catalogs.

    navigate to services, catalog

  2. On this screen click on Catalogs on the left

    service catalogs

  3. Click on Configuration and Add a New Catalog

  4. Fill out name and description:

    Name: HEAT Templates

    Description: Deploy HEAT Templates from the Catalog

    add a new catalog

  5. Click Add to save the Service Catalog

Build a HEAT Service Catalog Item

To put everything together we create a Service Catalog Item similar to before.

  1. Navigate to Services -> Catalogs

    navigate to services, catalog

  2. 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

    navigate to catalog items

  3. In the Configuration Menu, click on Add a New Catalog Item

  4. Chose the Catalog Item Type. For this example we want to use HEAT on OpenStack which is an Orchestration provider, so click on Orchestration

    select catalog item type

  5. 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.

    service catalog item details

    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.

  6. OPTIONAL: 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.

  7. Finally click on Add to save the Service Catalog Item

    catalog item saved

Order the HEAT Wordpress Catalog Item

For sure you want to test the Catalog Item you just created!

  1. Navigate to Services -> Catalogs and then click on Service Catalogs in the accordion on the left.

    navigate to services, catalog

  2. You should see the Service Catalog Item we just created:

    all services

  3. Click on the Service Catalog Item to see more details.

    service item details

  4. Click on Order

  5. 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.

    order HEAT template

    Click on Submit to start the deployment.

  6. 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).

![after ordering heat service catalog item](/img/rhte-fy18-service-catalog-after-ordering-heat.png)

Verify provisioning in OpenStack

Let’s log into OpenStack to see what’s happening there.

  1. Log into OpenStack:

    https://osp-<GUID>.https://osp-.rhpds.opentlc.com

Make sure you use the HTTPS URL!

***username:*** admin

***Password:*** r3dh4t1!

![dashboard after login](/img/rhte-fy18-service-catalog-osp-after-login.png)
  1. Navigate to Project in the menu bar on the top

    navigate to project

  2. Navigate to Orchestration -> Stacks

    navigate to orchestration stacks

  3. 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.

    stack completed

  4. Click on the stack to get the details

    stack details

This concludes this section of the lab.