Chapter 21. The Provisioning State Machine

So far in Part II we have studied the access-control-group-specific processing related to provisioning a virtual machine. We have seen how approval and quotas are handled, and how the entries from the WebUI provisioning dialog are added to the provisioning request and task objects in the options hash.

The common workflow for provisioning virtual machines is handled by the VM provision state machine.

The virtual machine and instance provisoning workflows are each controlled by a VM provision state machine in their respective /Infrastructure and /Cloud namespaces. These state machines define the steps in the virtual machine provisioning workflow and contain flexible preprovision and postprovision processing options. Instances run as part of this state machine have access to the provisioning task object via $evm.root['miq_provision'].

State Machine Schema

The VM provision state machine ({Cloud/Infrastructure}/VM/Provisioning/StateMachines/VMProvision_VM) class schema contains a number of states (see Figure 21-1).

The VMProvision_VM State Machine
Figure 21-1. The VMProvision_VM state machine

Several of these states (such as RegisterCMDB or RegisterAD) contain no out-of-the-box values but are there as placeholders should we wish to add the functionality to our own customized instance.

Some states (such as PreProvision) have values that include an appended message—for example: ...

Get Mastering CloudForms Automation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.