Chapter 4. Fulfilling Requests
4.1. Fulfilling a Request
After a request has been approved, CloudForms Management Engine then goes through the steps required to complete the request. The steps followed for a regular provision from a virtual machine to a virtual machine (not to a template) are found by navigating to → , then listed under → → → → → . The value for each state shows where the instance resides in the Datastore accordion. The default set of execution steps is shown below. For more information on state machines, see section State Machines.
4.2. Default Execution Steps in States Instance
| Step | Description |
|---|---|
| Customize Request | Apply customizations. |
| Acquire IP Address | Integrates with IPAM (IP Address Management) to get an IP Address. |
| Acquire MAC Address | Integrates with IPAM to get a MAC Address. |
| Register DNS | Integrates with IPAM to register with DNS. |
| Register CMDB | Integrates with CMDB (Configuration Management Database) to register with the CMDB. |
| Register AD | Integrates with IPAM to register with active directory. |
| PreProvision | Pre-provisioning steps. |
| Provision | Create the virtual machine or instance. |
| CheckProvisioned | Check that the new virtual machine or instance is in the VMDB. |
| PostProvision | Post-provisioning steps. |
| Register DHCP | Integrate with IPAM to register the IP address with DHCP Server. |
| Activate CMDB | Integrate with IPAM to active the virtual machine or instance in the CMDB. |
| Email owner | Send email to owner that the virtual machine or instance has been provisioned. |
4.2.1. Quotas
Quotas allow you to establish maximum usage thresholds for an owner or group for provisioned virtual machines or instances and are integrated into provisioning profiles. These maximums are checked after the approval but before the actual provision request is started. The quota is set for the group as a whole.
4.2.1.1. Editing the Default Quota
- Log in as a user with administrator or super administrator rights to the CloudForms Management Engine console.
- Navigate to → .
From the accordion menu, 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),
(Edit this instance).
- Set the values for Owner - Max CPUs Allowed, Owner - Max Memory Allowed, or Owner - Max Storage Allowed to be the maximums for a specific owner.
- Set the values for Group - Max CPUs Allowed, Group - Max Memory Allowed, or Group - Max Storage Allowed to be the maximums for a specific user group.
- Click Save.
4.2.1.2. Using Tags for Owner and Group Quotas
CloudForms Management Engine provides tags for enforcing quotas for the owners of virtual machines or instances. Ownership of a virtual machine or instance can be set either during the provisioning process or by using the Configuration Set Ownership button. If a virtual machine or instance has an owner, the value is displayed in the Lifecycle section of the virtual machine or instance summary page.
Quota tags can be assigned directly to either a group or owner not to a configuration item. The table below shows the tags for use in quotas.
| Category Display Name (Name) | Use |
|---|---|
| Quota Max CPU (quota_max_cpu) | Sets the maximum number of CPUs summed over all virtual machines and instances owned by the group or user. Sample Values: 1, 2, 3, 4, 5, 10, 20, 30, 40, 50 |
| Quota Max Memory (quota_max_memory) | Sets the maximum memory summed over all virtual machines and instances owned by the group or user. Sample Values: 1024, 2048, 4096, 8192, 10240, 20480, 40960, 81920 (in MB) |
| Quota Max Storage (quota_max_storage) | Sets the maximum storage summed over virtual machines and instances owned by the group or user. Sample Values: 10, 100, 1000, 20, 200, 40, 400 (in GB) |
4.2.1.3. Applying a Tag to a User or User Group
- Click → .
- Click the Access Control accordion, and select the user or group that you want to tag.
-
Click
(Policy), then click
(Edit Tags).
- Select the appropriate customer tag to assign, then the value.
- Click Save.
4.2.1.4. State Machines
A State Machine stores the status of something at a given time, and can operate on input to change the status. It can also cause an action or output to take place for any given change. State machines are also designed so that State-B cannot begin until State-A completes successfully.
The following components make up a CloudForms Management Engine automate state machine:
| Component | Description |
|---|---|
| On_Entry | Method to run when entering the state. It enables you to execute an automate method to do some pre-processing before the state of the state machine is processed. |
| On_Exit | Method to run when exiting the state. |
| On_Error | Method to run if an error is encountered when running the state. It enables you to execute an automate method to do some final processing before the state machine finally exits (MIQ_ABORT) due to the error. |
| Default Value | Runs after the On_Entry method completes (The actual state being processed). |
| Max Retries | Maximum number of times to retry the state before exiting. |
| Max Time | Maximum time in seconds to retry the state before exiting. |
In the diagram below, you can see how these components combine to create a state machine workflow.
The retry logic, On_Entry and On_Error are distinct cases in the program flow.
Code snippet demonstrating the state machine retry logic:
# Get current provisioning status task = $evm.root['service_template_provision_task'] task_status = task['status'] result = task.status Then check the result to see how it should proceed: case result when 'error' $evm.root['ae_result'] = 'error' ..... when 'retry' $evm.root['ae_result'] = 'retry' $evm.root['ae_retry_interval'] = '1.minute' when 'ok' $evm.root['ae_result'] = 'ok' end When the result is "retry", it sets: $evm.root['ae_result'] = 'retry' $evm.root['ae_retry_interval'] = '1.minute'
The following image shows a simple state machine pertaining to approving a provision request. This instance can be found in → → → → → → → .
- The attribute max_vms has a value of 1. State machine processing can use the attributes of the state machine instance to make logic decisions. In this case, the validate_request method, which is processed during the On_Entry portion of the ValidateRequest state, evaluates the max_vms attribute. If the number of virtual machines requested is less than the max_vms value, the request can be auto-approved. See the validate_request method for more details.
- ValidateRequest is the first state to be executed.
- ApproveRequest is the next state to be executed.
Grayed out items reflect values that are set in the class schema. These values can be overwritten on a per instance basis.
4.2.1.5. Customizing Provisioning States
The steps followed when provisioning a virtual machine or cloud instance are completed based on instances from the → → → → → class. Depending on your environment you can remove, change, or add steps to the provisioning process. For example, if you are not integrating with IPAM or a CMDB, then you can remove those execution steps.
4.2.1.6. Editing the Default State Instance
- Navigate to → .
From the accordion menu, 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), then
(Edit this instance).
- For each step that you want to remove, clear the entries in the Value, On Entry, On Exit, and On Error columns.
- Click Save.
4.2.1.7. Viewing the Status of a Provisioning Request
After a request has been approved, the various stages of fulfillment are executed. You can see the progress of the provisioning process by viewing its status.
- Navigate to → . The list of requests is shown.
- Click on a specific request for more information. Once the provisioning begins, if the request was supposed to create more than one virtual machine or instance, a field will appear called Provisioned VMs. Click on the number that appears next to it for information on each of the individual provisions.
4.2.1.8. Viewing a Provisioned Virtual Machine or Instance
When a virtual machine or instance is created as a result of a provisioning request, its summary screen will show when it was provisioned in the Lifecycle area of the respective summary.
-
From → , click the virtual machine or instance that you want to view.
4.2.1.9. Viewing a Virtual Machine or Instance Summary
From → , click the virtual machine or instance that you want to view.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.