CloudForms Now

Service Catalogs and the User Self-Service Portal

One of the most interesting features of CloudForms is the ability to define services that can include one or more virtual machines (VMs) or instances and can be deployed across hybrid environments. Services can be made available to users through a self-service portal that allows users to order predefined IT services without IT operations getting involved, thereby delivering on one of the major promises of cloud computing.

The intention of this post is to provide you with step-by-step instructions to get you started with a simple service catalog. After you have gone through the basic concepts, you should have the skills to dive deeper into more complex setups.

Getting started with Service Catalogs

Let’s set the stage for this post: You added your Amazon Web Services (AWS) account to CloudForms as a cloud provider. Your AWS account includes a Red Hat Enterprise Linux (RHEL) image ready to use. Now you want to give your users the ability to deploy RHEL instances on AWS but you want to limit or predefine most of the options they could choose when deploying these instances.

Service Basics

Four items are required to make a service available to users from the CloudForms self-service portal:

Provisioning Dialogs

To work with services in CloudForms it is important to understand the concept of Provisioning Dialogs. When you begin the process of provisioning a VM or instance via CloudForms, you are presented with a Provisioning Dialog where you set certain options for the VM or instance. The options presented are dependent on the provider you are using. For instance, a cloud provider might have “flavors” of instances, whereas an infrastructure provider might allow you to set the Memory size or number of CPUs on a VM.

Every provider in CloudForms comes with a sample provisioning dialog covering the options specific to that provider. To have a look at some sample Provisioning Dialogs, go to Automate > Customization > Provisioning Dialogs > VM Provision and select “Sample Provisioning Dialogs”. This is a textual representation of the dialog you will get when you provision a VM or instance.

For this post, we need to make sure instance provisioning to AWS is working, so go to Compute > Clouds > Instances and create a new AWS instance by choosing “Provision Instances” from the “Lifecycle” drop-down. Select the image you are going to use, click “Continue” and walk through the Provisioning Dialog.

Service Dialogs

A Service Dialog determines which options the users get to change. The choice of options that are presented to the user is up to you. You could just give them the option to set the service name, or you could have them change all of the Provisioning Dialog options. You have to create a Service Dialog to define the options users are allowed to see and set. To help with creating a Service Dialog, CloudForms includes a simple form designer.

Anatomy of a Service Dialog

A Service Dialog contains three components:

What are the Element Names?

Very good question. As mentioned the options and values we provide in the Service Dialog must match those used in the Provisioning Dialog. There are some rather generic names like “vm_name” or “service_name”, while others might be specific to the provider in question.

So how do you find the options and values you can pass in a Service Dialog? The easiest way is to look at the Provisioning Dialog. In this case, for our Amazon EC2 instance:

Creating a Service Dialog

Enough theory, let’s dive in and create our first simple Service Dialog. The Service Dialog should let users choose a service and instance name for an AWS instance.

From this starting point, you can now add content to the Dialog:

Following the same procedure add a second Element to the Box. The Name field should be “vm_name” and the Label and Description fields should be “Instance Name”. Similarly, Type should be “Text Box” with Value Type “String”.

That’s it! Now you can finally hit the “Add” button at the lower right corner.

Create a Catalog

Now that you have created your Service Dialog, we can add it to a Service Catalog by creating its associated Catalog Item.

First, we will create a Catalog:

Create a Catalog Item

Now we have the Catalog without any content, the Service Dialog, and the Provisioning Dialog. To allow users to order the service from the self-service catalog, we have to create a Catalog Item. Let’s create a Catalog Item to order a RHEL instance using our Service Dialog:

As you can see your new Catalog Item is listed with a generic icon. Let’s change this by uploading an icon in the “Custom Image” section. You can pick any image you like.

Recap or “What have we done so far”?

We created a Provisioning Dialog that defines the options that can be set on a VM or instance. We created a Service Dialog which allows us to expose certain options to be set by the user. For our example, only the instance name and service name are configurable. Then we created a Service Catalog and finally a Catalog Item. The Catalog Item joins the Service Dialog with all of the options in the Provisioning Dialog. Now, users should be able to order RHEL instance from the self-service catalog.

Let’s Order a RHEL Instance

To order your new service:

Once the “Request State” is shown as “finished”, your AWS instance is provisioned.

Conclusion

As you can see, creating a basic service catalog and to use the self-service portal in CloudForms is not rocket science. Of course, there is a lot more to learn, but there are also a lot of good resources to help you on your journey. For example, articles on this blog, the official documentation, and of course the excellent “Mastering CloudForms Automation” book written by  Peter McGowan that I cannot recommend highly enough.