Versions: Euwe / Fine / Latest /
Table of Contents

1. ManageIQ Lifecycle

This guide discusses lifecycle activities such as provisioning and retirement that are part of the ManageIQ Automate component. ManageIQ Automate enables real-time, bidirectional process integration and adaptive automation for management events and administrative or operational activities.

  • Operations Management with service level resource enforcement.

  • Resource Management including datastore cleanup, snapshot aging and enforcement, and virtual machine or instance aging and retirement.

  • Configuration and Change Management including enforced closed loop change management.

  • Lifecycle Management such as provisioning, customization, reconfiguration, approval, CMDB updates, and retirement.

Provisioning requires the Automation Engine server role enabled. Check your server role settings in the settings menu, Configuration ▸ Server ▸ Server Control.

1.1. Provisioning

When a virtual machine or cloud instance is provisioned, it goes through multiple phases. First, the request must be made. The request includes ownership information, tags, virtual hardware requirements, the operating system, and any customization of the request. Second, the request must go through an approval phase, either automatic or manual. Finally, the request is executed. This part of provisioning consists of pre-processing and post-processing. Pre-processing acquires IP addresses for the user, creates CMDB instances, and creates the virtual machine or instance based on information in the request. Post-processing activates the CMDB instance and emails the user. The steps for provisioning may be modified at any time using ManageIQ. 2314

2. Provisioning Requests

The following options are available when making provisioning requests:

  • Set an owner (User can do this using LDAP lookup)

  • Assign a purpose (tag)

  • Select a template or image from which to create a new virtual machine or instance respectively

  • Choose placement

  • Set hardware requirements

  • Specify the vLan

  • Customize the guest operating system

  • Schedule the provisioning 2315

2.1. Requirements for Provisioning Virtual Machines and Instances

ManageIQ supports the provisioning of VMware ESX hosts/hypervisors. To provision a virtual machine from VMware providers, you must have an appliance with the Automation Engine role enabled.

If you are using a Windows template, the following configuration is required:

  • To customize settings that are inside the operating system, Sysprep must be copied to the appropriate directory on your vCenter computer. Usually this location is: C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter\sysprep. Copy the Sysprep tools to the relevant operating system subdirectory. If you are running a standard Win2008 operating system, this step is unnecessary as Sysprep is included as standard.

  • The Windows template must have the latest version of VMware tools for its ESX Server. Check the VMware Site for more information. If you are creating a new password for the Administrator account, the Administrators password must be blank on the template. This is a limitation of Microsoft Sysprep.

See the VMware documentation for a complete list of customization requirements.

2.2. Requirements for Provisioning Virtual Machines from Red Hat Virtualization Manager

Item Requirements

Red Hat Virtualization Manager version 3.0 or higher

Red Hat Virtualization Manager properly installed with API in default location https://server:8443/api

Red Hat Virtualization Manager History Database

Red Hat Virtualization Manager Data Warehouse (DWH) properly installed with access to the PostgreSQL database on the Red Hat Virtualization Manager server. Port 5432 open in iptables.

md5 authentication allowed to ManageIQ appliances in pg_hba.conf.

PostgreSQL set to listen for connections on *:5432 in postgresql.conf.

Credentials provided during database setup to be used in ManageIQ UI.

Storage Supported for ManageIQ Virtual Machine Analysis

NFS - ManageIQ server must be able to mount NFS storage domain.

iSCSI / FCP - Cluster must use full Red Hat Enterprise Linux (not Red Hat Virtualization Hypervisor) Hosts.

DirectLUN Hook installed on each host and registered to Red Hat Virtualization Managers.

Must have ManageIQ appliance in each Cluster with this storage type.

ManageIQ appliance virtual machine container must have DirectLUN attribute set.

Local storage - Not yet supported (Red Hat does not recommend due to single point of failure).

2.3. PXE Provisioning

PXE is a boot method that allows you to load files from across a network link. ManageIQ uses it for files required for provisioning virtual machines. PXE can be used for provisioning for either Red Hat Virtualization Manager or VMware.

Procedure Overview

  1. Connect to the PXE Server.

  2. Create a System Image Type.

  3. Associate each PXE image with an image type.

  4. Create a customization template.

Requirements for PXE Provisioning

  • DHCP server configured with required PXE implementation

  • PXE implementation for Linux virtual machine provisioning

  • NFS or SAMBA read and write access to create and modify files on the PXE server

  • ManageIQ Server uses NFS mount to read and write the response files

  • HTTP read access to the NFS share location as virtual machines use this URL to access PXE images and Kickstart or Cloud-Init configuration files

  • Operating system installation media available to be streamed from PXE server

  • Images configured for desired operating systems

  • Kickstart or Cloud-Init templates to configure operating systems with desired packages

Additional Requirements for Provisioning Linux Virtual Machines

  • Linux distribution kernel and ramdisk available over HTTP

  • Linux sources available over HTTP

  • Sample PXE menu item that boots this kernel

Additional Requirements for Provisioning Windows Virtual Machines

  • WinPE ISO built with rhev-agent-tools (for RHEV-M environments) and configured to mount shares for Windows source files and Sysprep files and configured to run customization script

  • Windows based WIM file with operating system installed and configured with Sysprep

  • Sample Sysprep unattend file to be used with the operating system

  • Sample PXE menu item that downloads WinPE ISO, mount in memdisk and boot into WinPE environment

2.3.1. Connecting to a PXE Server

The following procedure connects to a PXE server and adds its details to ManageIQ.

  1. Navigate to Compute ▸ Infrastructure ▸ PXE.

  2. Click 1847(Configuration), then 1862(Add a New PXE Server).

  3. In Basic Information, type a Name that will be meaningful in your environment. 2316

  4. For Depot Type, select either Network File System (NFS) or Samba. The fields to enter in the dialog depend on the Depot Type.

    • For NFS, type in the URI, Access URL, PXE Directory, Windows Images Directory, and Customization Directory. When you provision, ManageIQ writes a text file to the PXE Directory. The file is named after the MAC address of the NIC that is assigned to the virtual machine. It contains where to get the kernel and initrd image. This file is removed after a successful provision. The Windows Images Directory is where the files are located on your NFS for the provisioning of Windows operating systems. The Customization Directory is where your Kickstart and Sysprep files are located.

    • If using a Depot Type of Samba, you will not need Access URL, but you will need a User ID, and Password, in addition to the items required for NFS.

  5. For PXE Image Menus, type the Filename for the PXE Boot menu.

  6. Click Add.

  7. Select the new PXE server from the tree on the left, and click 1847(Configuration), then 2003(Refresh) to see your existing images.

Next, create PXE Image types to associate with the customization templates and to specify if the image type is for a virtual machine, a host, or both.

2.3.2. Creating System Image Types for PXE

The following procedure creates a system image type for PXE servers.

  1. Navigate to Compute ▸ Infrastructure ▸ PXE.

  2. Click the System Image Types accordion. 2318

  3. Click 1847(Configuration), then 1848(Add a new System Image Type).

  4. In Basic Information, type in a Name and select a Type. 2317

    • Use Host if you want this image type to only apply to hosts.

    • Use Vm if you want this image type to only apply to virtual machines.

    • Use Any if this image type can be used for either hosts or virtual machines.

  5. Click Add.

After creating the System Image Types, assign the types to each image on your PXE servers. To do this, you will select each image on the PXE server and identify its type.

2.3.3. Setting the PXE Image Type for a PXE Image

The following procedure sets the image type for a chosen PXE image.

  1. Navigate to Compute ▸ Infrastructure ▸ PXE.

  2. Click the PXE Servers accordion and select the image that you want to set a type for.

  3. Click 1847(Configuration), then 1851(Edit this PXE Image).

  4. From the Basic Information area, select the correct type. If this PXE image will be used as the Windows Boot Environment, check Windows Boot Environment. At the time of this writing, only one PXE Image can be identified as the Windows Boot Environment. Therefore, checking one as the Windows Boot Environment, will remove that from any other PXE image with that check. 2319 Click Save. 2320

2.4. ISO Provisioning

ManageIQ also allows ISO provisioning from Red Hat Virtualization Manager datastores. To use this feature, you will need to do the following before creating a provision request.

  1. Add the ISO Datastore. The Red Hat Virtualization Manager system must have already been discovered or added into the VMDB. For more information, see Adding a Red Hat Enterprise Virtualization Manager Provider in Managing Providers.

  2. Refresh the ISO Datastore.

  3. Create a System Image Type.

  4. Set the ISO Image Type.

  5. Create a customization template.

2.4.1. Adding an ISO Datastore

The following procedure adds an ISO Datastore from your Red Hat Virtualization environment.

  1. Navigate to Compute ▸ Infrastructure ▸ PXE.

  2. Click the ISO Datastores accordion.

  3. Click 1847(Configuration), 1862(Add a new ISO Datastore).

  4. Select the Cloud or Infrastructure provider hosting the ISO Datastore.

  5. Click Add.

The ISO datastore is added to ManageIQ.

2.4.2. Refreshing an ISO Datastore

The following procedure refreshes the chosen ISO datastore and updates ManageIQ with available ISOs.

  1. Navigate to Compute ▸ Infrastructure ▸ PXE.

  2. Click the ISO Datastores accordion, and select an ISO datastore.

  3. Click 1847(Configuration), then click 2003(Refresh Relationships).

2.4.3. Creating System Image Types for ISO

The following procedure creates a system image type for ISO Servers.

  1. Navigate to Compute ▸ Infrastructure ▸ PXE.

  2. Click the System Image Types accordion.

  3. Click 1847(Configuration), then 1862(Add a new System Image Type).

  4. In Basic Information, type in a Name and select a Type. 2317

    • Use Host if you want this image type to only apply to hosts.

    • Use Vm if you want this image type to only apply to virtual machines.

    • Use Any if this image type can be used for either hosts or virtual machines.

  5. Click Add. 2322

After creating the system image types, assign the types to each image on your ISO servers. To do this, you will select each image on the ISO server and identify its type.

2.4.4. Setting the Image Type for an ISO Image

The following procedure sets the image type for an ISO image.

  1. Navigate to Compute ▸ Infrastructure ▸ PXE.

  2. Click the ISO Datastores accordion, and select the image that you want to set a type for.

  3. Click 1847(Configuration), then 1851(Edit this ISO Image).

  4. From the Basic Information area, select the correct Type. 2323

  5. Click Save.

2.5. Customization Templates for Virtual Machine and Instance Provisioning

Add a customization template to provide Kickstart, Cloud-Init, or Sysprep files for the initial loading of the operating system.

Cloud-Init Requirements
  • When creating a template using Red Hat Virtualization, install the cloud-init package on the source virtual machine. This enables Cloud-Init to source configuration scripts when a virtual machine built on that template boots.

  • See Using Cloud-Init to Automate the Configuration of Virtual Machines in the Red Hat Virtualization Administration Guide for more information on using Cloud-Init in a Red Hat Virtualization environment.

  • See the Cloud-Init Documentation web site for example scripts.

Kickstart Requirements for ISO Provisioning
  • The Kickstart file must be named ks.cfg.

  • Set the new virtual machine to power down after provisioning is complete.

  • ManageIQ must use the virtual machine payload feature of Red Hat Virtualization to create a floppy disk containing the data from the selected customization template.

  • Customize the installer to include the data written to the floppy disk payload.

Example 1. RHEL ISO with the following modifications:
  • isolinux.cfg – add ks=cdrom to the append line

  • ks.cfg – which must minimally include:

### Pre Install Scripts
%pre

# Mount the floppy drive
modprobe floppy
mkdir /tmp/floppy
mount /dev/floppy /tmp/floppy
%end

# Include ks.cfg file from the floppy (written by CFME based on selected customization template)
%include /tmp/floppy/ks.cfg

2.6. Customization Script Additions for Virtual Machine and Instance Provisioning

Customization Type Reason to Include Script entries

Kickstart

Takes the values from the Customize tab in Provisioning Dialog and substitutes them into the script.

Configure Networking based on values from provisioning dialog <% if evm[:addr_mode].first == 'static' %> <% network_string = "network --onboot yes --device=eth0 --bootproto=static --noipv6" %> <% ["ip", :ip_addr, "netmask", :subnet_mask, "gateway", :gateway, "hostname", :hostname, "nameserver", :dns_servers].each_slice(2) do |ks_key, evm_key| %> <% network_string << " --{ks_key} #{evm[evm_key]}" unless evm[evm_key].blank? %> <% end %> <%= network_string %> <% else %> network --device=eth0 --bootproto=dhcp <% end %>

Kickstart

Encrypts the root password from the Customize tab in the Provisioning Dialog.

rootpw --iscrypted <%= MiqPassword.md5crypt(evm[:root_password]) %>

Kickstart

Sends status of the provision back to ManageIQ Server for display in the ManageIQ Console.

Sysprep

Encrypts the root password from the Customize tab in the Provisioning Dialog. The value for the AdministratorPassword line must be inserted to use the password from the Provision Dialog and encrypt it.

<UserAccounts> <AdministratorPassword> <Value><%= MiqPassword.sysprep_crypt(evm[:root_password]) %></Value> <PlainText>false</PlainText> </AdministratorPassword> </UserAccounts>

2.7. Adding a Customization Template

  1. Navigate to Compute ▸ Infrastructure ▸ PXE.

  2. Click the Customization Templates accordion.

  3. Click 1847(Configuration), 1862(Add a new Customization Template).

  4. In Basic Information, type in a Name and Description. 2324

  5. Select the Image Type. This list should include the PXE image types you created.

  6. In Type, select Kickstart or CloudInit for Linux based systems, and Sysprep for Windows based system.

  7. In the Script area, either paste the script from another source or type the script directly into the ManageIQ interface.

  8. Click Add.

The default dialogs show all possible parameters for provisioning. To limit the options shown, see Customizing Provisioning Dialogs.

2.8. Provisioning Virtual Machines

There are three types of provisioning requests available in ManageIQ:

  1. Provision a new virtual machine from a template

  2. Clone a virtual machine

  3. Publish a virtual machine to a template

2.8.1. Provisioning a Virtual Machine from a Template

You can provision virtual machines through various methods. One method is to provision a virtual machine directly from a template stored on a provider.

To provision a virtual machine, you must have the "Automation Engine" role enabled.

To provision a virtual machine from a template:

  1. Navigate to Compute ▸ Infrastructure ▸ Virtual Machines.

  2. Click 2007(Lifecycle), and then 1862(Provision VMs).

  3. Select a template from the list.

  4. Click Continue.

  5. On the Request tab, enter information about this provisioning request.

    2326

    In Request Information, type in at least a First Name and Last Name and an email address. This email is used to send the requester status emails during the provisioning process for items such as auto-approval, quota, provision complete, retirement, request pending approval, and request denied. The other information is optional. If the ManageIQ server is configured to use LDAP, you can use the Look Up button to populate the other fields based on the email address.

    Parameters with a * next to the label are required to submit the provisioning request. To change the required parameters, see Customizing Provisioning Dialogs.

  6. Click the Purpose tab to select the appropriate tags for the provisioned virtual machines.

  7. Click the Catalog tab to select the template to provision from. This tab is context sensitive based on provider.

  8. For templates on VMware providers: 2328

    1. For Provision Type, select VMware or PXE.

      1. If VMware is selected, select Linked Clone to create a linked clone to the virtual machine instead of a full clone. Since a snapshot is required to create a linked clone, this box is only enabled if a snapshot is present. Select the snapshot you want to use for the linked clone.

      2. If PXE is selected, select a PXE Server and Image to use for provisioning.

    2. Under Count, select the number of virtual machines to create in this request.

    3. Use Naming to specify a virtual machine name and virtual machine description. When provisioning multiple virtual machines, a number will be appended to the virtual machine name.

  9. For templates on Red Hat providers:

    1. Select the Name of a template to use.

    2. For Provision Type, select either ISO, PXE, or Native Clone. You must select Native Clone in order to use a Cloud-Init template.

      1. If Native Clone is selected, select Linked Clone to create a linked clone to the virtual machine instead of a full clone. This is equivalent to Thin Template Provisioning in Red Hat Virtualization. Since a snapshot is required to create a linked clone, this box is only enabled if a snapshot is present. Select the snapshot to use for the linked clone.

      2. If ISO is selected, select an ISO Image to use for provisioning.

      3. If PXE is selected, select a PXE Server and Image to use for provisioning.

    3. Under Count, select the number of virtual machines you want to create in this request.

    4. Use Naming to specify a VM Name and VM Description. When provisioning multiple virtual machines, a number will be appended to the VM Name.

  10. Click the Environment tab to decide where you want the new virtual machines to reside.

    1. If provisioning from a template on VMware, you can either let ManageIQ decide for you by checking Choose Automatically, or select a specific cluster, resource pool, folder, host, and datastore. VMware virtual machines can also be provisioned to a clustered datastore by selecting it under Datastore. Additionally, you can assign a storage profile to a VMware virtual machine under Datastore to configure the virtual machine to operate using a storage profile from that datastore.

      Note, read-only datastores are excluded when provisioning a virtual machine.

    2. If provisioning from a template on Red Hat, you can either let ManageIQ decide for you by checking Choose Automatically, or select a datacenter, cluster, host and datastore.

  11. Click the Hardware tab to set hardware options. provision vms

    1. In Hardware, set the number of sockets, cores per socket, memory in MB, and disk format: thin, pre-allocated/thick or same as the provisioning template (default).

    2. For VMware provisioning, set the VM Limits of CPU and memory the virtual machine can use.

    3. For VMware provisioning, set the VM Reservation amount of CPU and memory.

  12. Click Network to set the vLan adapter. Additional networking settings that are internal to the operating system appear on the Customize tab. 2335

    1. In Network Adapter Information, select the vLan.

      A VMware virtual machine can be provisioned to a DVPortgroup by selecting it from the vLan list. Prior to provisioning a virtual machine, the DVPortgroup must be created on a vSphere Distributed Switch (VDS) in VMware vCenter in order for ManageIQ to list the DVPortgroup under vLan.

  13. Click Customize to customize the operating system of the new virtual machine. These options vary based on the operating system of the template. 2336

  14. For Windows provisioning:

    1. To use a custom specification from the provider, click Specification. To select an appropriate template, choose from the list in the custom specification area. The values that are honored by ManageIQ display.

      Any values in the specification that do not show in the ManageIQ console’s request dialogs are not used by ManageIQ. For example, for Windows operating systems, if you have any run once values in the specification, they are not used in creating the new virtual machines. Currently, for a Windows operating system, ManageIQ honors the unattended GUI, identification, workgroup information, user data, windows options, and server license. If more than one network card is specified, only the first is used.

      2337

      To modify the specification, select Override Specification Values.

    2. Select Sysprep Answer File, to upload a Sysprep file or use one that exists for a custom specification on the Provider where the template resides. To upload a file, click Browse to find the file, and then upload. To use an answer file in Customization Specification, click on the item. The answer file will automatically upload for viewing. You cannot make modifications to it.

  15. For Linux provisioning:

    1. Under Credentials, enter a Root Password for the root user to access the instance.

    2. Enter a IP Address Information for the instance. Leave as DHCP for automatic IP assignment from the provider.

    3. Enter any DNS information for the instance if necessary.

    4. Select Customize Template for additional instance configuration. Select from the Kickstart or Cloud-Init customization templates stored on your appliance.

  16. Click the Schedule tab to select when provisioning begins.

    1. In Schedule Info, select when to start provisioning. If you select Schedule, you will be prompted to enter a date and time. Select Stateless if you do not want the files deleted after the provision completes. A stateless provision does not write to the disk so it requires the PXE files on the next boot.

    2. In Lifespan, select to power on the virtual machines after they are created, and to set a retirement date. If you select a retirement period, you will be prompted for when you want a retirement warning.