Red Hat Training

A Red Hat training course is available for Red Hat OpenStack Platform

Chapter 11. Catalogs and Services

In Section 9.1, “Provisioning an OpenStack Instance from an Image”, you provisioned instance manually by entering values in provisioning dialogs such as name, size, image, CPUs, etc. Catalogs are used to create groups of instances for provisioning. CloudForms enables users to provision instances via a single Order button.

Creating a service catalog involves:

  1. Creating a Service Dialog. This is a UI interface element that allows users to interact with the service (for example, a drop-down list).
  2. Creating a Catalog Item for each instance that will be part of the service.
  3. Creating a method for the Service Dialog. This method defines what each option means to each individual cloud instances for the service. This method is called from a service provisioning instance in the Automate model.
Note

For more information about catalogs and services, see Catalogs and Services from the Provisioning Virtual Machines and Hosts guide.

11.1. Creating a Service Dialog

When provisioning a service, input will be needed from the requester. Service Dialogs are used to take input from the user. This input is connected to a method in the Automate model that defines how user input is translated into the provision request. Before creating a Service Dialog, be sure to plan what items you need the user to input.

  1. Navigate to AutomateCustomization.
  2. Click the Service Dialogs accordion.
  3. Click 1847 (Configuration), and then 1862 (Add a new Dialog).
  4. In Dialog Information, enter a Label and Description. Check the boxes for the buttons you want available at the bottom of the dialog form. The description will appear as hover text.

    As you enter the Label of the dialog, it should appear in the Dialog pane on the left.

    1. Click 1862 (Add), then 1862 (Add a New Tab to this Dialog).
    2. Enter a Label and Description for this tab.

      As you enter the Label of the tab, it should appear in the Dialog pane on the left under the dialog you are creating.

    3. Click 1862 (Add), then 1862 (Add a New Box to this Tab).
    4. Enter a Label and Description for this box.

      As you enter the Label of the box, it should appear in the Dialog pane on the left under the tab you are creating.

  5. Add an element to this box. Elements are controls that accept input.

    1. Click 1862 (Add), then 1862 (Add a New Element to this Box).
    2. Enter a Label, Name, and Description for this element.

      Important

      Name must use only alphanumeric characters and underscores without spaces. It is also used to retrieve the value of this element in the method used with the dialog and must start with dialog_service_type

    3. Select a Type for an element type. All Type options have a Required and Default Value field. Check Required or set Required to true if the element is required to proceed. You can also specify a default value. The rest of the options presented are based on which type of element you select.

      Element TypesAdditional Info

      Check Box

      Check Default Value if you want this check box checked by default.

      Date Control

      Use Date Control to create a field where users can select a date. If you want users to be able to select a date and time, use the Date/Time Control option.

      Date/Time Control

      Use Date/Time Control to create a field where users can select a date and time. Only one Date Control or Date/Time Control element can be present in a dialog.

      Drop Down Dynamic List

      Use Drop Down Dynamic List if you want the list options to be created using automate methods. Use Entry Point (NS/Cls/Inst) to select an automate instance. Check Show Refresh Button to allow users to refresh the list options manually.

      Radio Button

      This element type serves the same purpose as Drop Down List but displays options using radio buttons.

      Tag Control

      Select a Category of tags you want assigned to the virtual machines associated with this service dialog. Check Single Select if only one tag can be selected.

      Text Area Box

      Provides text area for users to enter some text. You can also leave a message to users by typing in the Default Value field or leave it as blank.

      Text Box

      This element type serves the same purpose as Text Area Box with the option to check Protected so the text is shown as asterisks (*), instead of plain text.

  6. Continue adding the dialog items you need. You can switch between dialogs, tabs, boxes, and elements by selecting their respective labels from the Dialog pane on the left.
  7. Click Add. Your dialog should appear in the Service Dialogs accordion.

11.2. Creating a Catalog

A catalog is a way to organize or categorize catalog items and bundles. Before you can associate a catalog item into a catalog, create an empty catalog first:

  1. Navigate to ServicesCatalogs.
  2. Click the Catalogs accordion.
  3. Click 1847 (Configuration), and then 1862 (Add a New Catalog).
  4. Enter a Name and Description, leaving everything else blank.
  5. Click Add.

11.2.1. Creating a Catalog Item

  1. Navigate to ServicesCatalogs.
  2. Click the Catalog Items accordion.
  3. Click 1847 (Configuration), and then 1862 (Add a New Catalog Item).
  4. Select OpenStack from the Catalog Item Type drop-down.
  5. In the Basic Info subtab:

    1. Type a Name/Description.
    2. Check Display in Catalog to edit Catalog, Dialog, and Entry Point(NS/Cls/Inst) options.

      1. Provisioning Entry Point (Domain/NS/Cls/Inst) requires you to select an Automate instance to run upon provisioning. Navigate to ManageIQ/Service/Provisioning/State‐ Machines/ServiceProvision_Template/CatalogItemInitialization and click Apply.
      2. Retirement Entry Point (Domain/NS/Cls/Inst) requires you to select an Automate instance to run upon retirement. Navigate to ManageIQ/Service/Provisioning/State‐ Machines/ServiceProvision_Template/CatalogItemTermination and click Apply.

        Note

        The entry point must be a State Machine since the Provisioning Entry Point list is filtered to only show State Machine class instances. No other entry points will be available from the Provisioning Entry Point field.

        You can only choose from the catalogs and dialogs you have already created. If you haven’t done so, leave the values blank and edit later.

  6. In the Details subtab, write a Long Description for the catalog item.
  7. In the Request Info subtab, select provisioning options that apply to the provider chosen.
  8. Click Add.

11.2.2. Ordering a Catalog Item

  1. Navigate to ServicesCatalogs.
  2. Click the Service Catalogs accordion, and select the service to provision.
  3. Click Order.