Fully customized automation request on multi-regional setup

automate

#1

Hello community,

We have implemented CloudForms with multiple Regions and Zones, all commanded by the Master Region (99)… and everything looks fine, we’re able to lunch a provisioning of a vm based on template thrhough service catalog in any target zone of any region. So, good at this point, the out-of-the-box provisioning workflow works!.

Now, we’ve developed a custom service catalog (generic type) and a custom provisioning statemachine (generic lifecycle) that connects with RH Satellite 6 via API to provision VMs (customised totally on-demand) in some provider (vmware or rhev) through Compute Resource of Satellite. Once the VM is created, the statemachine execute an EMS Refresh and loops until the object is recognized in VMDB (of the same region), then the email_complete method ends the workflow.

This process works fine when a provision of a new vm is triggered from its own region (scope local), but when we trigger the automation from the master region (this is our objective) the state machine doesn’t work as intended because the master doesn’t know how must execute the request, but I think this is normal because the out-of-the-box provisioning workflow looks at the template to find the target provider and zone, but in this automation we don’t use virtualization templates… (I almost sure that this is how the automation define where to provision a new VM, please let me know if I’m wrong)

So, to workaround we are trying to integrate in our code the new “create_automation_request” method but with some difficulties and here begin the questions…

  1. I can see that approvement and quota validation happens before the service request is being created, so the approvement should be proccessed for Master or subourdinated/target Remote Region?

  2. “create_automation_request” should be implemented to relocate the request to the target region/zone right? but in the master or remote code? in the provisioning generic statemachine or in some “proxy” top level method??

  3. In case of “create_automation_request” method need to be implemented on master, I must send the catalog options like an array via “attrs” hash of the method??

  4. Currently, when we submit a request in the Master catalog, the request begin but the dialog is still in the form and show us an error message like this: “Error during ‘Provisioning’: Failed to retrieve MiqRequest instance with id 1000000000688”… we should write a method that return the MiqRequest value in somewhere/somehow?

Some important details…

  1. The master workers has active automation and provider operations roles.
  2. Workers on remote regions has automation, provider operations and all the other infra roles.
  3. Service Catalog, company tags, users, groups, and automation namespaces are the same in Master and Remote Regions.

Beforehand, thank you so much!!

@pemcg, What do you think about this? :stuck_out_tongue: