Launch automation task from a master region appliance


#1

Hi team,

I’m newbie in ManageIQ & CFME. I’m planning a multi-regional architecture and I need to know if there are some kind of troubles or if is possible to launch automation tasks from a master region appliance (with IU role included on it) to a subordinate region in a multi-regional architecture. Could you help me commenting your experience with this kind of issues please?

Thanks a lot!! (Sorry for my poor English)
Nicolás.


#2

The Master Region is designed as a read-only, reporting region aggregating information from the other regions. People have tried launching things from Master Region, but, since this was not designed into the core architecture, they usually run into issues. So, use at your own risk.

Thanks,
@chessbyte


#3

Thank you @chessbyte


#4

I’ve just been dealing with some related stuff and it occurs to me that you could implement some automation that calls the REST API on your sub-regions CFME appliances, from your master region appliance…

For instance, say you have a VM button in your sub-region that calls some automation, then in your master region you could make that button run a different piece of code that calls the sub-region’s REST API to run that same automation, and passing it the necessary parameters.

Have a look at: https://pemcg.gitbooks.io/introduction-to-cloudforms-automation/content/chapter20/calling_automation_from_api.html from Peter McG’s gitbook …

I love this product - you can make it do anything. (But you need to think about it. Just because you can doesn’t always mean you should … ) :smile: heheh.


#5

Hi Stephen

I’ve also thought that this should in theory be possible, I just haven’t had the chance to try it out yet.

Many objects in the VMDB have a ‘region_number’ virtual column that could be used to determine the target miq_server to direct the REST calls to. You could even have a service dialog containing a dynamically populated drop-down list of child-region target MIQ servers to target REST requests to, say from a button.

There are a couple of useful attributes from an miq_server object in this context:

$evm.root[‘miq_server’].region_number (type: Fixnum)
$evm.root[‘miq_server’].has_active_webservices (type: TrueClass)

So it would be straightforward to use $evm.vmdb to enumerate all miq_servers to find the REST-callable server in each region.

As ever the possibilities with MIQ are endless!

pemcg