With the work of https://github.com/ManageIQ/manageiq/pull/10737 we can instantiate an OpenShift container template from ManageIQ. Next we need to support OpenShift provisioning through automate.
A typical ManageIQ provisioning automate has pre-provsioning, provisioning, check-provisioned, and post-provisioning steps. The provisioning step connects to a provider to create resources. The check-provisioned step periodically polls from the provider the status of the creation until it finishes, and refreshes the provider afterward.
The OpenShift container template instantiation process creates multiple objects. It is however not a trivial task to implement logic to monitor the overall status of the instantiation if not impossible. There is no single handle to identify the instantiation. We need to monitor the status of all created objects, and way to determine whether an object creation is completed can be different.
After some discussion we suggest not to monitor and wait for the completion of the instantiation. An OpenShift provisioning is consider completed once the
instantiate method returns. The provisioning can fail if the method raise errors. The resulting objects will be refreshed and collected in ManageIQ db through OpenShift events. Since each template can create many objects, there may be an impact on the refresh performance if every object triggers a full refresh. We can research whether a target refresh can apply here.
In order to automate the OpenShift template provisioning we need to add a new type to catalog items. Each OpenShift template needs a dedicated service dialog that allows the user to fill in answers to parameters required by the template. Parameters for a template are well defined, so we can have a tool to automatically generate the corresponding service dialog. However the dialog needs to be created in advance through a manual UI operation.