Change VM provisioning state machine based on criteria


I would like to have several VM provisioning state machines. And my goal is to choose one I need before the actual service provisioning kicks off. So my question is if there is any way to control what VM provisioning state machines will be executed while I’m in Service provisioning state machine /ManageIQ/Service/Provisioning/StateMachines/ServiceProvision_Template?


The selection of VM provisioning state machine class is made using a combination of the contents of the /Infrastructure/VM/Lifecycle/Provisioning instance, along with the value of the entry for get_state_machine in the provisioning user’s group profile (under /Infrastructure/VM/Provisioning/Profile/).

The default state machine for a clone from template provision is:


but you could have alternative classes such as:


It should be feasible to manipulate either the contents of /Infrastructure/VM/Lifecycle/Provisioning, or to create custom group profiles that select the appropriate state machine class. You’d need to find a way of creatively setting the provisioning user/group to match the desired profile if you took the latter approach - maybe by making a custom call to $evm.execute(‘create_provision_request’,…) specifying the appropriate user.

Hope this helps,