Running an Automate method in a particular zone


#1

Hello,

We have made extensive use of dynamic dialogs and other shared methods that talk to VMware directly and we also have multiple zones that have limited connectivity between them. Our workers in one zone can not talk to the vCenters in another zone.

I have successfully used the REST API to trigger requests that belong to a particular zone. Is there a way to do this directly within Automate?


#2

@gmccullough can you review this question from @ewannema and forward to a SME if necessary.


#3

According to Red Hat support this is not possible at this time.

For the time being I am going to investigate doing this in a roundabout way using the REST API and a generic instantiator request method I have created.

It is likely to be a bit of a Rube Goldberg machine but we were looking at this anyway to try and get some test coverage around our state machines.


#4

I believe you can do this with create_automation_request:

options = {}
options[:namespace] = 'Stuff’
options[:class_name] = 'Methods’
options[:instance_name] = 'MyInstance’
options[:user_id] = $evm.vmdb(:user).find_by_userid(‘pemcg’).id
options[:attrs] = attrs
options[:miq_zone] = zone
approve = true

$evm.execute(‘create_automation_request’, options, ‘admin’, approve)


Feedback requested: Helper gem for Automate development
#5

@pemcg

Thanks for the tip.

We are still on MIQ 5.4. I see that this method is available starting with the capablanca branch. I will weigh the need to backport something like this with our upgrade plans.