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 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:
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”)
![create a service dialog](/img/pconf17-create-service-dialog.png)
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:
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:
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:
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:
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:
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
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:
Description: 2 GB
Description: 4 GB
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/pconf17-memory-dropdownlist.png)
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:
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.
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”
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.
The datacenter of our Red Hat Virtualization Provider:
The cluster in the Red Hat Virtualization Datacenter:
The host which will perform the actual tasks and where the VM will initially run on:
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:
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.
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