Service Catalog to deploy VM's

Build a Service Catalog to deploy Virtual Machines

In this second part of the lab we want to use an Ansible Playbook to deploy a Virtual Machine in VMware vCenter. The necessary Playbook should already be in your repository.

  1. Click on Catalog Items in the accordion on the left

    navigate to service catalog items

  2. Click on Configuration -> Add a New Catalog Item

  3. Select Ansible Playbook as “Catalog Item Type”

    add catalog item ansible Playbook

Do not select Ansible Tower! We do not use Ansible Tower in this lab, but the embedded Ansible role of CloudForms.

  1. Fill out the form to define the Service Catalog Item:

    The name of the Service Catalog Item:

    Name: Provision Virtual Machine

    More description details about the Service Catalog Item

    Description: Order this catalog item provision a Virtual Machine on VMware vCenter

    Check this box to make the Service Catalog Item visible in the Service Catalog. This remains unselected for Service Catalog Items which are still in draft mode or should only be used as a part of a Service Catalog Bundle:

    Display in Catalog: Yes (check the box)

    The Service Catalog in which this Service Catalog Item should be listed:

    Catalog: Ansible

    The Git repository from which we want to run our Playbook:

    Repository: Github

    The name of the actual Playbook:

    Playbook: create_vm_from_template.yml

    Credentials used to run the Playbook:

    Machine Credentials: CFME Default Credentials

    If you want to run your Playbook against a Cloud Provider, you have to select which one:

    Cloud Type: VMware

    The credentials used to log into the Cloud Provider:

    Cloud Credentials: vCenter

    In the box Variables & Default Values we can enter the variables the Playbook requires. Those variables are defined in the Ansible Playbook. By specifying them here, CloudForms can populated those variables when somebody order the Service Catalog Item.

    If you want to learn more about variables in Ansible Playbooks, have a look at the Ansible Documentation.

    Variable: vcenter_hostname

    Default: vcenter.example.com

    Click on the little plus icon (+) to save the variable. Repeat the process for the second variable:

    Variable: esxi_host

    Default: 192.168.0.51

    Click on the little plus icon (+) to save the variable. Repeat the process for the second variable:

    Variable: datacenter

    Default: DC01

    Click on the little plus icon (+) to save the variable. Repeat the process for the second variable:

    Variable: template

    Default: rhel6tmpl

    Click on the little plus icon (+) to save the variable. Repeat the process for the second variable:

    Variable: vmname

    Default: changeme

    Click on the little plus icon (+) to save the variable.

    Dialog: create new

    Dialog name: provision-vm-vcenter

    create user service dialog

  2. Click on Add to save the Service Catalog Item. It can take a few moments for the changes to be saved.

    catalog item was created