Zone Binding for a Service Template Provision Request

Hi there,

my current goal is to bind a ServiceTemplateProvisionRequest to a specific zone.

I know that there is a way for doing this with an AutomationRequest [1] but I don’t know if this solution is adaptable for a ServiceTemplateProvisionRequest.

attrs = {}
attrs['dialog_stack_name'] = $evm.root['dialog_stack_name']
attrs['dialog_password']   = $evm.root['dialog_password']
options = {}
options[:namespace]     = 'Service/Provisioning/StateMachines'
options[:class_name]    = 'ServiceProvision_Template'
options[:instance_name] = 'create_stack'
options[:user_id]       = $evm.vmdb(:user).find_by_userid('admin').id
options[:miq_zone]      = 'Generic'
options[:attrs]         = attrs
auto_approve            = true
$evm.execute('create_automation_request', options, 'admin', auto_approve)

There, we call the method “create_automation_request” to create an automation request but AFAIK there is no method “create_service_provision_template_request”. Can I somehow convert a automation request into a service template provision request? Is there something missing in MIQ?


This functionality is currently being implemented, here’s the RFE: