Chapter 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
2.1. Requirements for Provisioning Virtual Machines and Instances
Red Hat CloudForms supports the provisioning of VMware ESX 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 4.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 Red Hat CloudForms appliances in
PostgreSQL set to listen for connections on Credentials provided during database setup to be used in Red Hat CloudForms UI. |
Storage Supported for Red Hat CloudForms Virtual Machine Analysis | NFS - Red Hat CloudForms 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 Red Hat CloudForms appliance in each Cluster with this storage type. Red Hat CloudForms 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. Red Hat CloudForms 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
- Connect to the PXE Server.
- Create a System Image Type.
- Associate each PXE image with an image type.
- 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
- Red Hat CloudForms 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 Red Hat CloudForms.
- Navigate to → → .
-
Click
(Configuration), then
(Add a New PXE Server).
-
In Basic Information, type a Name that will be meaningful in your environment.
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, Red Hat CloudForms 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.
- For PXE Image Menus, type the Filename for the PXE Boot menu.
- Click Add.
-
Select the new PXE server from the tree on the left, and click
(Configuration), then
(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.
- Navigate to → → .
-
Click the System Image Types accordion.
-
Click
(Configuration), then
(Add a new System Image Type).
In Basic Information, type in a Name and select a Type.
- Use Vm if you want this image type to only apply to virtual machines.
- 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.
- Navigate to → → .
- Click the PXE Servers accordion and select the image that you want to set a type for.
-
Click
(Configuration), then
(Edit this PXE Image).
-
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.
Click Save.
2.4. ISO Provisioning
Red Hat CloudForms 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.
- 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.
- Refresh the ISO Datastore.
- Create a System Image Type.
- Set the ISO Image Type.
- Create a customization template.
2.4.1. Adding an ISO Datastore
The following procedure adds an ISO Datastore from your Red Hat Virtualization environment.
- Navigate to → → .
- Click the ISO Datastores accordion.
-
Click
(Configuration),
(Add a new ISO Datastore).
- Select the Cloud or Infrastructure provider hosting the ISO Datastore.
- Click Add.
The ISO datastore is added to Red Hat CloudForms.
2.4.2. Refreshing an ISO Datastore
The following procedure refreshes the chosen ISO datastore and updates Red Hat CloudForms with available ISOs.
- Navigate to → → .
- Click the ISO Datastores accordion, and select an ISO datastore.
-
Click
(Configuration), then click
(Refresh Relationships).
2.4.3. Creating System Image Types for ISO
The following procedure creates a system image type for ISO Servers.
- Navigate to → → .
- Click the System Image Types accordion.
-
Click
(Configuration), then
(Add a new System Image Type).
In Basic Information, type in a Name and select a Type.
- Use Vm if you want this image type to only apply to virtual machines.
-
Click Add.
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.
- Navigate to → → .
- Click the ISO Datastores accordion, and select the image that you want to set a type for.
-
Click
(Configuration), then
(Edit this ISO Image).
-
From the Basic Information area, select the correct Type.
- 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.
- CloudForms 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 2.1. RHEL ISO with the following modifications:
- RHEL 7.5 and above
-
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/fd0 /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 <%= ManageIQ::Password.md5crypt(evm[:root_password]) %> |
Kickstart | Sends status of the provision back to Red Hat CloudForms Server for display in the Red Hat CloudForms 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><%= ManageIQ::Password.sysprep_crypt(evm[:root_password]) %></Value> <PlainText>false</PlainText> </AdministratorPassword> </UserAccounts> |
2.7. Adding a Customization Template
- Navigate to → → .
- Click the Customization Templates accordion.
-
Click
(Configuration),
(Add a new Customization Template).
-
In Basic Information, type in a Name and Description.
- Select the Image Type. This list should include the PXE image types you created.
- In Type, select Kickstart or CloudInit for Linux based systems, and Sysprep for Windows based system.
- In the Script area, either paste the script from another source or type the script directly into the Red Hat CloudForms interface.
- Click Add.
The default dialogs show all possible parameters for provisioning. To limit the options shown, see Section 2.9.3, “Customizing Provisioning Dialogs”.
2.8. Provisioning Virtual Machines
There are four types of provisioning requests available in Red Hat CloudForms:
- Provision a new virtual machine from a template
- Clone a virtual machine
- Publish a virtual machine to a template
- Provision a virtual machine using cloud-init via REST API.
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.
- During virtual machine provisioning, the Customize tab is hidden if the template has an unknown operating system (OS) type. To make the Customize tab visible in the user interface, you will need to set the OS type from the provider or perform SmartState analysis on the template to detect the OS type.
To provision a virtual machine from a template:
- Navigate to → → .
-
Click
(Lifecycle), and then
(Provision VMs).
- Select a template from the list.
- Click Continue.
On the Request tab, enter the request information.
In Request Information, enter your name and email address. The requester will receive status emails about the provisioning request such as auto-approval, quota, provision complete, retirement, request pending approval, and request denied.
NoteParameters with a * next to the label are required to submit the provisioning request. To change the required parameters, see Section 2.9.3, “Customizing Provisioning Dialogs”.
- Click the Purpose tab to select the appropriate tags for the provisioned virtual machines.
- Click the Catalog tab to select the template to provision from. This tab is context sensitive based on provider.
For templates on VMware providers:
For Provision Type, select VMware or PXE.
- 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.
- If PXE is selected, select a PXE Server and Image to use for provisioning.
- Under Count, select the number of virtual machines to create in this request.
- 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.
For templates on Red Hat providers:
- Select the Name of a template to use.
For Provision Type, select either ISO, PXE, or Native Clone. You must select Native Clone in order to use a Cloud-Init template.
- 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.
- If ISO is selected, select an ISO Image to use for provisioning.
- If PXE is selected, select a PXE Server and Image to use for provisioning.
- Under Count, select the number of virtual machines you want to create in this request.
- Use Naming to specify a VM Name and VM Description. When provisioning multiple virtual machines, a number will be appended to the VM Name.
Click the Environment tab to decide where you want the new virtual machines to reside.
If provisioning from a template on VMware, you can either let Red Hat CloudForms 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.
- If provisioning from a template on Red Hat, you can either let Red Hat CloudForms decide for you by checking Choose Automatically, or select a datacenter, cluster, host and datastore.
Click the Hardware tab to set hardware options.
- 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).
- For VMware provisioning, set the VM Limits of CPU and memory the virtual machine can use.
- For VMware provisioning, set the VM Reservation amount of CPU and memory.
Click Network to set the vLan adapter. Additional networking settings that are internal to the operating system appear on the Customize tab.
In Network Adapter Information, select the vLan.
NoteA 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 Red Hat CloudForms to list the DVPortgroup under vLan.
-
Click Customize to customize the operating system of the new virtual machine. These options vary based on the operating system of the template.
For Windows provisioning:
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 Red Hat CloudForms display.
NoteAny values in the specification that do not show in the Red Hat CloudForms console’s request dialogs are not used by Red Hat CloudForms. 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, Red Hat CloudForms 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.
To modify the specification, select Override Specification Values.
- 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.
For Linux provisioning:
- Under Credentials, enter a Root Password for the root user to access the instance.
- Enter a IP Address Information for the instance. Leave as DHCP for automatic IP assignment from the provider.
- Enter any DNS information for the instance if necessary.
- Select Customize Template for additional instance configuration. Select from the Kickstart or Cloud-Init customization templates stored on your appliance.
Click the Schedule tab to select when provisioning begins.
- 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.
-
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.
- Click Submit.
The provisioning request is sent for approval. For the provisioning to begin, a user with the administrator, approver, or super administrator account role must approve the request. The administrator and super administrator roles can also edit, delete, and deny the requests. You will be able to see all provisioning requests where you are either the requester or the approver.
After submission, the appliance assigns each provision request a Request ID. If an error occurs during the approval or provisioning process, use this ID to locate the request in the appliance logs. The Request ID consists of the region associated with the request followed by the request number. As regions define a range of one trillion database IDs, this number can be several digits long.
Request ID Format
Request 99 in region 123 results in Request ID 123000000000099.
2.8.2. Provisioning a Virtual Machine using Cloud-Init via REST API
Cloud-init is a tool for automating the initial setup of virtual machines. In CloudForms, you can use cloud-init via REST API to provision a virtual machine that was created based on a template.
To use cloud-init, the template from which the virtual machine is provisioned must have cloud-init package installed, and have the Use Cloud-Init/Sysprep option selected.
For a virtual machine provision request via REST API, ensure the following two fields in the request’s body are set correctly, otherwise cloud-init may not work.
- VLAN
- sysprep_enabled
VLAN
The value of VLAN in the API request can be one of the following options:
VLAN value | Note | vNIC profile |
---|---|---|
<empty> | Must be written within the <..> | No vNIC profile |
<Template> | Must be written within the <..> | Use the template’s default vNIC profile |
profile_name (network_name) | Must include a space between profile_name (network_name), otherwise it will fail. For example, ovirtmgmt (ovirtmgmt) | Set the specified vNIC profile. |
vNIC profile ID |
Set the specified vNIC profile, such as |
sysprep_enabled
The value of sysprep_enabled in the API request must be in the following format.
Sysprep_enabled is written in the order: [value] - [it’s meaning] - [how it appears in the CloudForms user interface virtual machine provision dialog’s Customize tab]
For Windows template:
- "fields" - Sysprep Specification
- In the CloudForms user interface, when you navigate to the virtual machine provision dialog (Customize tab’s Customize drop-down list is called Sysprep Specification. → → ), this option located under the
- "file" - Sysprep answer file
- In the CloudForms user interface, when you navigate to the virtual machine provision dialog (Customize tab’s Customize drop-down list is called Sysprep answer file. → → ), this option located under the
For Linux template:
- “fields” - Customized template and any Customized parameters will be used
- In the CloudForms user interface, when you navigate to the virtual machine provision dialog (Customize tab’s Customize drop-down list is called Specification. → → ), this option located under the
For cloud-init to work (that is, to have the provisioned virtual machine marked with Use cloud-init and the customized template as well as customized parameters, if any, will be used) "sysprep_enabled" must be set to “fields”. If you do not set it correctly, the customized template will be ignored and the provisioned virtual machine will not be marked with Use cloud-init; although, the template from which the virtual machine is provisioned has it marked.
For both Windows and Linux template:
- “disabled” - Do not customize
- In the CloudForms user interface, when you navigate to the virtual machine provision dialog (Customize tab’s Customize drop-down list is called <None>. The customized template will be ignored, and the provisioned virtual machine will not be marked with Use cloud-init, even though the template from which the virtual machine was provisioned, has it marked. The default value is disabled. → → ), this option located under the
For an example of virtual machine provisioning request using cloud-init via REST API, see Provisioning a Virtual Machine Using Cloud-init in the Red Hat CloudForms REST API guide.
2.8.3. Cloning a Virtual Machine
Virtual machines can be cloned in other providers as well.
- Navigate to → → , and select the virtual machine you want to clone.
-
Click
(Lifecycle), and then
(Clone selected item).
- Enter the requested information in the dialogs. Be sure to check the Catalog tab.
- Schedule the request on the Schedule tab.
- Click Submit.
2.8.4. Publishing a Virtual Machine to a Template (VMware Virtual Machines Only)
- Navigate to → → , and select the virtual machine you want to publish as a template.
-
Click
(Lifecycle), and then
(Publish selected VM to a Template).
- Enter the requested information in the dialogs. Be sure to check the Catalog tab.
- Schedule the request on the Schedule tab.
- Click Submit.
2.8.5. Renaming a Provisioned Virtual Machine (VMware Virtual Machines Only)
Red Hat CloudForms allows you to rename a VMware virtual machine without having to reprovision it.
To rename a VMware virtual machine:
- Navigate to → → , and select the VMware virtual machine you want to rename.
-
Click
(Configuration),
(Rename selected item).
- In the Basic Information screen, provide a new name.
- Click Save.
The renamed virtual machine will appear in the inventory view.
2.9. Provisioning Instances
Cloud instances follow the same process (Request, Approval, Deployment) as a standard virtual machine from virtualization infrastructure. First, a user makes a request for instances and specifies the image, volume or volume snapshot, tags, availability zone and hardware profile flavor. Second, the request goes through the approval phase. Finally, Red Hat CloudForms executes the request.
2.9.1. Provisioning an EC2 Instance from an Image
- Navigate to → → .
-
Click
(Lifecycle), then click
(Provision Instances).
- Select an image from the list presented.
- Click Continue.
On the Request tab, enter information about this provisioning request. In Request Information, type in at least a first 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 Red Hat CloudForms Server is configured to use LDAP, you can use the Look Up button to populate the other fields based on the email address.
NoteParameters with a * next to the label are required to submit the provisioning request. To change the required parameters, see Section 2.9.3, “Customizing Provisioning Dialogs”.
- Click the Purpose tab to select the appropriate tags for the provisioned instance.
Click the Catalog tab for basic instance options.
- To change the image to use as a basis for the instance, select it from the list of images.
- Select the Number of VMs to provision.
- Type a VM Name and VM Description.
- Click the Environment tab to select the instance’s Availability Zone, Virtual Private Cloud, Cloud Subnet, Security Groups, and Elastic IP Address. If no specific availability zone is required, select the Choose Automatically checkbox.
Click the Properties tab to set provider options such as hardware flavor and security settings.
- Select a flavor from the Instance Type list.
- Select a Guest Access Key Pair for access to the instance.
- Select the CloudWatch monitoring level. Leave as Basic for the default EC2 monitoring.
Click the Customize tab to set additional instance options.
- Under Credentials, enter a Root Password for the root user access to the instance.
- Enter a IP Address Information for the instance. Leave as DHCP for automatic IP assignment from the provider.
- Enter any DNS information for the instance if necessary.
- Select a Customize Template for additional instance configuration. Select from the Cloud-Init scripts stored on your appliance.
Click the Schedule tab to set the provisioning and retirement date and time.
- In Schedule Info, choose whether the provisioning begins upon approval, or at a specific time. If you select Schedule, you will be prompted to enter a date and time.
- In Lifespan, select whether to power on the instances after they are created, and whether to set a retirement date. If you select a retirement period, you will be prompted for when to receive a retirement warning.
- Click Submit.
The provisioning request is sent for approval. For the provisioning to begin, a user with the admin, approver, or super admin account role must approve the request. The admin and super admin roles can also edit, delete, and deny the requests. You will be able to see all provisioning requests where you are either the requester or the approver.
After submission, the appliance assigns each provision request a Request ID. If an error occurs during the approval or provisioning process, use this ID to locate the request in the appliance logs. The Request ID consists of the region associated with the request followed by the request number. As regions define a range of one trillion database IDs, this number can be several digits long.
Request ID Format
Request 99 in region 123 results in Request ID 123000000000099.
2.9.2. Provisioning an OpenStack Instance from an Image, Volume or Volume Snapshot
Create a request to provision Red Hat OpenStack Platform cloud instances from images, volumes, and volume snapshots using Red Hat CloudForms. Only bootable volumes not in use will be available.
- Navigate to → → .
-
Click
(Lifecycle), then click
(Provision Instances).
- Select an OpenStack image, volume or volume snapshot from the list presented. These files must be available on your OpenStack provider.
- Click Continue.
On the Request tab, enter information about this provisioning request. In Request Information, type in at least 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 Red Hat CloudForms Server is configured to use LDAP, you can use the Look Up button to populate the other fields based on the email address.
NoteParameters with a * next to the label are required to submit the provisioning request. To change the required parameters, see Section 2.9.3, “Customizing Provisioning Dialogs”.
- Click the Purpose tab to select the appropriate tags for the provisioned instance.
Click the Catalog tab for basic instance options.
- To change the source file to use as a basis for the instance, select it from the list of images, volumes, or volume snapshots.
- Select the Number of Instances to provision.
- Type a Instance Name and Instance Description.
- Click the Environment tab to select the instance’s Cloud Tenant, Availabilty Zones, Cloud Network, Security Groups, and Public IP Address. If no specific Cloud Tenant is required, select the Choose Automatically checkbox.
Click the Properties tab to set provider options such as flavors and security settings.
- Select a flavor from the Instance Type list.
- Select a Guest Access Key Pair for access to the instance. For more information about key pairs, see Section 2.9.5, “Managing Key Pairs”.
Click the Volumes tab to provision any volumes with the instance. Volumes are useful for augmenting ephemeral storage of instances with persistent, general-purpose block storage:
- Fill in the Volume Name and Size (gigabytes) fields.
- If you want the volume to be deleted once the instance terminates (thereby making it non-persistent), check Delete on Instance Terminate.
To provision and add multiple volumes to the instance, click Add Volume. Doing so will add new fields you can fill in.
For more information about persistent storage in OpenStack, see the Red Hat OpenStack Platform Storage Guide.
Click the Customize tab to set additional instance options.
- Under Credentials, enter a Root Password for the root user access to the instance.
- Enter a IP Address Information for the instance. Leave as DHCP for automatic IP assignment from the provider.
- Enter any DNS information for the instance if necessary.
- Select a Customize Template for additional instance configuration. Select from the Cloud-Init scripts stored on your appliance.
Click the Schedule tab to set the provisioning and retirement date and time.
- In Schedule Info, choose whether the provisioning begins upon approval, or at a specific time. If you select Schedule, you will be prompted to enter a date and time.
- In Lifespan, select whether to power on the instances after they are created, and whether to set a retirement date. If you select a retirement period, you will be prompted for when to receive a retirement warning.
- Click Submit.
The provisioning request is sent for approval. For the provisioning to begin, a user with the admin, approver, or super admin account role must approve the request. The admin and super admin roles can also edit, delete, and deny the requests. You will be able to see all provisioning requests where you are either the requester or the approver.
After submission, the appliance assigns each provision request a Request ID. If an error occurs during the approval or provisioning process, use this ID to locate the request in the appliance logs. The Request ID consists of the region associated with the request followed by the request number. As regions define a range of one trillion database IDs, this number can be several digits long.
Request ID Format
Request 99 in region 123 results in Request ID 123000000000099.
2.9.3. Customizing Provisioning Dialogs
The default set of provisioning dialogs shows all possible options. However, Red Hat CloudForms also provides the ability to customize which tabs and fields are shown. You can decide what fields are required to submit the provisioning request or set default values.
For each type of provisioning, there is a dialog that can be created to adjust what options are presented. While samples are provided containing all possible fields for provisioning, you can remove what fields are shown but cannot add new fields or tabs.
Edit the dialogs to:
- Hide or show provisioning tabs.
- Hide or show fields. If you hide an attribute, the default will be used, unless you specify otherwise.
- Set default values for a field.
- Specify if a field is required to submit the request.
- Create custom dialogs for specific users.
2.9.3.1. Adding a Provision Dialog for All Users
- Login to the Red Hat CloudForms console for the Red Hat CloudForms server where you want to change the dialog.
- Navigate to → .
- Click the Provisioning Dialogs accordion.
- Click the type of dialog you want to create: Host Provision, VM Provision or VM Migrate.
- Select one of the default dialogs.
-
Click
(Configuration), and then
(Copy this Dialog).
- Type a new Name and Description for the dialog.
In the Content field,
- To remove a tab from display, change its display value to ignore. By choosing ignore, you not only hide the tab, but also skip any fields on that tab that were required. To show the tab, change the display value to show.
To hide a field, change its
:display:
value from:edit
to:hide
. To display fields of most data types, use:edit
. To display a button, use:show
. To set a default value for a field, add:default: defaultvalue
to the list of parameters for the field. Set the:required:
parameter to eithertrue
orfalse
based on your needs.NoteIf you set
:required:
totrue
, the field must have a value for the provision request to be submitted.
- Click Add.
If you are using Provisioning Profiles, you can specify a specific file that holds the customizations. To do this, you must create an instance mapping to this file in the Red Hat CloudForms Applications/provisioning/profile/VM provisioning by group class. By default, if you are using provisioning profiles and the group does not have a defined instance, the appropriate default dialog file will be used based on the type of provisioning selected.
2.9.3.2. Creating a Custom Provision Dialog
- Navigate to → .
- Click on the Provisioning Dialogs accordion.
- Click on the type of dialog you want to create, Host Provision, VM Provision or VM Migrate.
- Select one of the default dialogs.
-
Click
(Configuration), and then
(Copy this Dialog).
Rename the dialog as shown in the examples below.
Type of Provision Dialog Name Provision Virtual Machine from a template
miq_provision_dialogs_groupname_template Example: miq_provision_dialogs_ EvmGroup-user_self_service _template
Clone a Virtual Machine
miq_provision_dialogs_groupname_clone_to_vm Example: miq_provision_dialogs_ EvmGroup-user_self_service _clone_to_vm
Publish a Virtual Machine to a template
miq_provision_dialogs_groupname_clone_to_template Example: miq_provision_dialogs_ EvmGroup-user_self_service _clone_to_template
- Make any changes you need.
In the Content field,
- To remove a tab from display, change its display value to ignore. By choosing ignore, you not only hide the tab, but also skip any fields on that tab that were required. To show the tab, change the display value to show.
To hide a field, change its
:display:
value from:edit
to:hide
. To ensure the field does not get turned back on by a workflow model, use:display_override: :hide
. To display fields of most data types, use:edit
. To display a button, use:show
. To set a default value for a field, add:default: defaultvalue
to the list of parameters for the field. Set the:required:
parameter to eithertrue
orfalse
based on your needs.NoteIf you set
:required:
totrue
, the field must have a value for the provision request to be submitted.
- Click Add.
Enter the name of the new dialog into the dialog name field in the appropriate Red Hat CloudForms Applications/provisioning/profile instance. This dialog can now be referred to in an instance in the Provisioning Profiles class so that it can be used for groups of users.
2.9.4. Provisioning Profiles
Provisioning profiles can be used to customize the dialogs and the state machine (steps used to provision the machine). Profiles can be created for LDAP or Red Hat CloudForms groups. To use provisioning profiles:
- Create a Provisioning Profile instance for the LDAP or Red Hat CloudForms group. If no instance exists, then default settings will be used.
- If customizing dialogs, create a custom dialog file, and specify the name of that file in the provisioning profile instance. If customizing the states for provisioning, create a state instance and set the name of the state instance in the provisioning profile instance.
The diagram below shows where provisioning profiles are called during the entire provisioning process.
2.9.4.1. Creating a Provisioning Profile Instance
- Navigate to → .
Using the tree located in the accordion, click
→ → → → .NoteDOMAIN must be a user-defined Domain and not the locked ManageIQ Domain. If necessary, you can copy the class from the ManageIQ domain into a custom domain.
This example uses the Cloud Namespace, but can also use the Infrastructure namespace.
-
Click
(Configuration),
(Add a New Instance).
-
Make the name of the tag identical to the name of the LDAP or Red Hat CloudForms group you are creating the instance for, replacing spaces in the group name with underscores. For example, change Red Hat CloudForms-test group to Red Hat CloudForms-test_group.
In the dialog name field, enter the name of the customized dialog file. This file must reside on the Red Hat CloudForms appliance in the
/var/www/miq/vmdb/db/fixtures
directory. Red Hat recommends naming the file in the formatmiq_provision_dialogs-groupname.rb
and copying this file to all Red Hat CloudForms appliances. For instructions on creating a custom dialog file, see Section 2.9.3, “Customizing Provisioning Dialogs”.NoteBe sure that the custom dialog file exists. If it does not, an error will appear when the user clicks on the Provisioning button in the Red Hat CloudForms console.
- Click Add.
2.9.4.2. Setting Provisioning Scope Tags
Some non-default placement methods, for example the redhat_best_placement_with_scope or vmware_best_fit_with_scope methods, may require you to set Provisioning Scope tags for a host and a datastore.
To enable these resources for all groups, set the scope to All. To limit access to a select group, create a tag in the Provisioning Scope category with the exact name of the user group and set this tag on the desired resources. See Tags in General Configuration for information on creating tags.
To set the scope for a datastore:
- Navigate to → → .
- Select the datastore to set the provisioning scope for.
-
Click
(Policy), and then
(Edit Tags).
- From the Select a customer tag to assign drop down, select Provisioning Scope and then a value for the tag from the next drop down menu.
- Click Save.
2.9.5. Managing Key Pairs
Key pairs allow you to manage SSH access between a user and provisioned instance. For more information about key pairs in OpenStack, see Manage Key Pairs in the Instances and Images Guide.
To manage key pairs, navigate to
→ → . From there, you can view a list of available key pairs. Click on a key pair to view its details.To create a new key pair:
- Navigate to → → .
-
Click
(Configuration),
(Add a new Key Pair).
- Enter a Name for the key pair.
- If you want to use a public key, copy its contents into the Public Key (optional) field.
- Select which cloud provider on which to create the key pair. The key pair will then be available for use by instances in that provider.
- Click Add.