With remarkable development enhancements taking place in RHV, specifically for robust OVS integration, there are changes that CloudForms needs to take in account for customized VM instances provisioning. This is the case for setting the target networks in the provisioning process of services items.

In previous versions of RHV v4.2, the CloudForms provisioning statemachine used the vlan name as the input for the method set_vlan(vlan), but from version RHV v4.2 it started to use vNIC profiles ID instead. At first glance it should not change anything but single parameter that would be retrieved from the VMDB. However at the time that this blog is being written the vNIC profile ID is not yet stored in the CloudForms database.

The way to overcome this limitation is by making a direct connection to RHV and retrieve vNIC profile information. And thereafter make it available to the methods in the startemachine provisioning.

As a background knowledge it worth to mention that a Virtual Network Interface Card (vNIC) profile is a collection of settings that can be applied to individual virtual network interface cards in the Manager. It offers an added layer of administrative flexibility that defines how to use (consume) these profiles, and how it can be granted to specific users. The idea behind vNIC profiles is to enable the administrators to control the quality of service that different users receive from a given network.

There is a great number possibilities for rich customization while integrating RH CloudForms and RHV. This repo contains a datastore domain called "Automate". Within this domain there are several Namespaces that allow to configure the below use cases with a minimal effort.


Requirements

  • To have installed and configured a CFME appliance
  • To have a Red Hat Virtualization instance integrated in CloudForms
  • To have at least one VM template deployed in RHV

Integrating Procedure

Login to your CFME appliance and navigate to: Automation > Automate > Import/Export

Edit the fields as follows:

Leave the rest of the fields unchanged and click Submit!

integratingDomain_0

It shall appear the bellow window, just click submit and it will be all settled.

integratingDomain_1

Navigate to: Automation > Automate > Explorer, the Automate domain should appear as below:

integratingDomain_2


Service Catalog Dialog

Objective: to create a Service Catalog Item that will prompt existing VLANs in RHV and set the desire one for the provisioning request.

Steps:

1- Create the Service Dialog. Navigate to: Automation > Automate > Customization > Service Dialogs

It should at least have four fields with the below configuration

Field 1 : RHV Provider
Type: Dropdown

Data:
Field Information

  • Label: RHV Provider
  • Name: rhv_ems
  • Dynamic: Yes

Options

  • Entry Point: ServiceDialog/Class/rhv_providers_listing
  • Show Refresh Button: Yes
  • Load values on init: Yes
  • Required: Yes
  • Value type: String
  • Multiselect: No
  • Fields to refresh: Datacenter

No change is needed in the Advance or Overridable Options section
serviceDialog_field_1_0

serviceDialog_field_1_1

Field 2 : Datacenter
Type: Dropdown

Data:
Field Information

  • Label: Datacenter
  • Name: rhv_ems_datacenter
  • Dynamic: Yes

Options

  • Entry Point: ServiceDialog/Class/datacenters_listing
  • Show Refresh Button: Yes
  • Load values on init: No
  • Required: Yes
  • Value type: String
  • Multiselect: No
  • Fields to refresh: Nothing Selected

No change is needed in the Advance or Overridable Options sections

Field 4 : Network
Type: Dropdown

Data:
Field Information

  • Label: Network
  • Name: rhv_vnic_profile
  • Dynamic: Yes

Options

  • Entry Point: ServiceDialog/Class/vnic_profile_listing
  • Show Refresh Button: Yes
  • Load values on init: No
  • Required: Yes
  • Value type: String
  • Multiselect: No
  • Fields to refresh: Nothing Selected

No change is needed at the Advance or Overridable Options

2- Create the Service Catalog Item. Navigate to: Services > Catalogs > Catalogs

First create a new Catalog, by clicking in the configuration button, then follow and complete the form.

  • Name: RHV
    catalogCreation-1

  • Once the Catalog is available, proceed to create the Service Catalog Item, Navigate to: Services > Catalogs > Catalogs Items
    catalogItemCreation-1

It should have the following configuration:

Adding a new Service Catalog Item
Catalog Item Type: Red Hat Virtualization

=>

Basic Info:

  • Name / Description: RHV VM Provisioning / RHV VM Provisioning (Tick Display in Catalog)
  • Catalog: My Company/RHV
  • Dialog: rhv_vm_provision_dialog

Details:
No configuration needed

Request Info:

  • First select a VM Template
  • Set all the Required fields (The network will be overwritten with the information from the Service Dialog)
  • VM Name: changeme

The Service Catalog Item should look like...

serviceCatalogItem

It is done!

For more detailed information about playbooks and methods please visit here