Chapter 4. Fulfilling Requests
4.1. Fulfilling a Request
After a request has been approved, Red Hat CloudForms 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 Datastore accordion. The default set of execution steps is shown below. For more information on state machines, see Section 126.96.36.199, “State Machines”.→ , then listed under → → → → → . The value for each state shows where the instance resides in the
4.2. Default Execution Steps in States Instance
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.
Integrates with IPAM to register with DNS.
Integrates with CMDB (Configuration Management Database) to register with the CMDB.
Integrates with IPAM to register with active directory.
Create the virtual machine or instance.
Check that the new virtual machine or instance is in the VMDB.
Integrate with IPAM to register the IP address with DHCP Server.
Integrate with IPAM to activate the virtual machine or instance in the CMDB.
Send email to owner that the virtual machine or instance has been provisioned.
Quotas allow you to establish maximum usage thresholds for an user, group, or tenant 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 tenant or group as a whole.
188.8.131.52. Applying User or Group Quotas
- Log in as a user with administrator or super administrator rights to the Red Hat CloudForms console.
- Navigate to → .
- Copy the → → → → instance to a custom DOMAIN.
From the accordion menu, click→ → → → .Note
By default, quotas are applied to tenants and do not require any change in→ .
Click (Configuration), (Edit this instance).
Set the value for Quota Source Type to user or group.Important
A user creating a provisioning request must have an email address saved in their profile, or provisioning may fail. See Creating a User in General Configuration for details on configuring users.
- Set the values for VM Warning Count, VM Maximum Count, Storage Warning Limit, Storage Maximum Limit, CPU Warning Count, CPU Maximum Count, Memory Warning Limit, or Memory Maximum Limit to be the maximums for a specific user or group.
- Click Save.
184.108.40.206. Applying a Tag to a User or User Group
- From the settings menu, select Configuration.
- 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.
When quotas are applied by both automate instance and tagging, the tagged values will have higher precedence.
220.127.116.11. State Machines
The automate state machine processes an ordered list of states. It can ensure the successful completion of a step before the next step is run, permit steps to be retried, allow setting a maximum time to retry the state before exiting, and number of retries before exiting the state. Before each state is executed, the
On_Entry method is executed and after the state ends the
On_Error method is executed based on how the state ends.
The following components make up a Red Hat CloudForms automate state machine:
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.
Method to run when exiting the state.
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.
Runs after the On_Entry method completes (The actual state being processed).
Maximum number of times to retry the state before exiting.
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_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.
- 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.
18.104.22.168. 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.
22.214.171.124. Editing the Default State Instance
- Navigate to → .
From the accordion menu, click→ → → → → .Note
DOMAIN 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.
126.96.36.199. 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.
188.8.131.52. 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.
184.108.40.206. Viewing a Virtual Machine or Instance Summary
From→ , click the virtual machine or instance that you want to view.