[Solved] Retrieving options from Bundle requests


#1

Hi @pemcg @gmccullough @bronaghs ,

I have recently started provisioning service dialogs via bundles. I am trying to set options via a custom method in the “/ Service / Provisioning / StateMachines / ServiceProvision_Template / CatalogBundleInitialization” (pre3) method::service_setup that needs to be retrieved by methods in / Infrastructure / VM / Provisioning / StateMachines / VMProvision_VM

I use / Service / Provisioning / StateMachines / ServiceProvision_Template / CatalogItemInitialization
to set options for child provisioning tasks, eg data_center = task.destination.options[:dialog][‘dialog_data_center’] I can see the options set in (pre3) in the objectwalker in CatalogItemInitialization but cant find the right way to retrieve them.

How should I set these options in “/ Service / Provisioning / StateMachines / ServiceProvision_Template / CatalogBundleInitialization” (pre3) method::service_setup

or how can I retrieve what I see in objectwalker, specifically ipam_fusionlayer_infinity_ip_address_was_loadbalancer?

| | | — no custom attributes —
| | $evm.root[‘service_template_provision_task’].miq_request (type: Association)
| | miq_request = $evm.root[‘service_template_provision_task’].miq_request
| | (object type: MiqAeServiceServiceTemplateProvisionRequest, object ID: 51000000001801)
| | | — attributes follow —
| | | miq_request.approval_state = approved (type: String)
| | | miq_request.created_on = 2017-10-17 07:58:37 UTC (type: ActiveSupport::TimeWithZone)
| | | miq_request.description = Provisioning Service [Red Hat Websphere Cluster] from [Red Hat Websphere Cluster] (type: String)
| | | miq_request.destination_id = nil
| | | miq_request.destination_type = nil
| | | miq_request.fulfilled_on = nil
| | | miq_request.id = 51000000001801 (type: Fixnum)
| | | miq_request.message = Server [Cloud Development] Service [RHEL IHS Bundle] Step [pre2] Status [Processing Pre2] Message [Processed Pre1] (type: String)
| | | miq_request.options[:cart_state] = ordered (type: String)
| | | miq_request.options[:delivered_on] = 2017-10-17 08:11:29 UTC (type: Time)
| | | miq_request.options[:dialog] = {“dialog_itsm_env”=>“DR”, “dialog_option_1_job_template_name”=>“Linux_Websphere_IHS.Web.IH”, “dialog_option_2_job_template_name”=>“Linux_WAS.App.WS”, “dialog_number_of_vms”=>“1”, “dialog_option_2_zone”=>“Green”, “dialog_option_1_zone”=>“Green”, “dialog_baas”=>“No”, “dialog_monitor”=>“No”, “dialog_envname”=>“Non-Prod”, “dialog_data_center”=>“IMC3”, “dialog_cx_project_id”=>“imt12345”, “dialog_cx_remedy_appid”=>“0000”, “dialog_cx_crq_id”=>“abcd123456”, “dialog_vm_size”=>“Small”} (type: Hash)
| | | miq_request.options[:ldap_ad_galaxy_id] = cppclau (type: String)
| | | miq_request.options[:requester_group] = imt12345 (type: String)
| | | miq_request.options[:src_id] = 51000000000048 (type: Fixnum)
| | | miq_request.options[:user_message] = Server [Cloud Development] Service [RHEL IHS Bundle] Step [pre2] Status [Processing Pre2] Message [Processed Pre1] (type: String)
| | | miq_request.options[:workflow_settings] = {:resource_action_id=>51000000012669, :dialog_id=>51000000000017} (type: Hash)
| | | miq_request.process = true (type: TrueClass)
| | | miq_request.reason = Auto-Approved (type: String)
| | | miq_request.region_description = Region 51 (type: String)
| | | miq_request.region_number = 51 (type: Fixnum)
| | | miq_request.request_state = active (type: String)
| | | miq_request.request_type = clone_to_service (type: String)
| | | miq_request.request_type_display = Service Provision (type: String)
| | | miq_request.requester_id = 51000000000030 (type: Fixnum)
| | | miq_request.requester_name = CPPCLAU (type: String)
| | | miq_request.resource_type = ServiceTemplateProvisionRequest (type: String)
| | | miq_request.service_order_id = 51000000001648 (type: Fixnum)
| | | miq_request.source_id = 51000000000048 (type: Fixnum)
| | | miq_request.source_type = ServiceTemplate (type: String)
| | | miq_request.stamped_on = 2017-10-17 08:10:09 UTC (type: ActiveSupport::TimeWithZone)
| | | miq_request.state = active (type: String)
| | | miq_request.status = Ok (type: String)
| | | miq_request.tenant_id = 51000000000032 (type: Fixnum)
| | | miq_request.type = ServiceTemplateProvisionRequest (type: String)
| | | miq_request.updated_on = 2017-10-17 08:16:03 UTC (type: ActiveSupport::TimeWithZone)
| | | miq_request.v_approved_by = admin (type: String)
| | | miq_request.v_approved_by_email = daniel.wessels@levvel.io (type: String)
| | | — end of attributes —
| | | — virtual columns follow —
| | | miq_request.reason = Auto-Approved (type: String)
| | | miq_request.region_description = Region 51 (type: String)
| | | miq_request.region_number = 51 (type: Fixnum)
| | | miq_request.request_type_display = Service Provision (type: String)
| | | miq_request.resource_type = ServiceTemplateProvisionRequest (type: String)
| | | miq_request.stamped_on = 2017-10-17 08:10:09 UTC (type: ActiveSupport::TimeWithZone)
| | | miq_request.state = active (type: String)
| | | miq_request.v_approved_by = admin (type: String)
| | | — end of virtual columns —
| | | — associations follow —
| | | miq_request.approvers (type: Association (empty))
| | | miq_request.destination (type: Association (empty))
| | | miq_request.miq_request (type: Association)
| | | miq_request = miq_request.miq_request
| | | (object type: MiqAeServiceServiceTemplateProvisionRequest, object ID: 51000000001801)
| | | | Object MiqAeServiceServiceTemplateProvisionRequest with ID 51000000001801 has already been printed…
| | | miq_request.miq_request_tasks (type: Association)
| | | miq_request.miq_request_tasks.each do |miq_request_task|
| | | (object type: MiqAeServiceServiceTemplateProvisionTask, object ID: 51000000004813)
| | | | Object MiqAeServiceServiceTemplateProvisionTask with ID 51000000004813 has already been printed…
| | | — next miq_request_task —
| | | (object type: MiqAeServiceServiceTemplateProvisionTask, object ID: 51000000004812)
| | | | — attributes follow —
| | | | miq_request_task.created_on = 2017-10-17 08:11:29 UTC (type: ActiveSupport::TimeWithZone)
| | | | miq_request_task.description = Provisioning [Red Hat Websphere Cluster] for Service [Red Hat Websphere Cluster] (type: String)
| | | | miq_request_task.destination_id = 51000000001536 (type: Fixnum)
| | | | miq_request_task.destination_type = Service (type: String)
| | | | miq_request_task.id = 51000000004812 (type: Fixnum)
| | | | miq_request_task.message = Finished ValidateUser (type: String)
| | | | miq_request_task.miq_request_id = 51000000001801 (type: Fixnum)
| | | | miq_request_task.miq_request_task_id = nil
| | | | miq_request_task.options[:cart_state] = ordered (type: String)
| | | | miq_request_task.options[:data_center] = IMC3 (type: String)
| | | | miq_request_task.options[:delivered_on] = 2017-10-17 08:11:29 UTC (type: Time)
| | | | miq_request_task.options[:dialog] = {“dialog_itsm_env”=>“DR”, “dialog_option_1_job_template_name”=>“Linux_Websphere_IHS.Web.IH”, “dialog_option_2_job_template_name”=>“Linux_WAS.App.WS”, “dialog_number_of_vms”=>“1”, “dialog_option_2_zone”=>“Green”, “dialog_option_1_zone”=>“Green”, “dialog_baas”=>“No”, “dialog_monitor”=>“No”, “dialog_envname”=>“Non-Prod”, “dialog_data_center”=>“IMC3”, “dialog_vm_size”=>“Small”, “request”=>“clone_to_service”} (type: Hash)
| | | | miq_request_task.options[:envname] = Non-Prod (type: String)
| | | | miq_request_task.options[:ipam_fusionlayer_infinity_ip_address_id] = 61768 (type: Fixnum)
| | | | miq_request_task.options[:ipam_fusionlayer_infinity_ip_address_id_ihs_loadbalancer] = 61767 (type: Fixnum)
| | | | miq_request_task.options[:ipam_fusionlayer_infinity_ip_address_id_was_loadbalancer] = 61768 (type: Fixnum)
| | | | miq_request_task.options[:ipam_fusionlayer_infinity_ip_address_ihs_loadbalancer] = 10.213.151.70 (type: String)
| | | | miq_request_task.options[:ipam_fusionlayer_infinity_ip_address_was_loadbalancer] = 10.213.151.76 (type: String)
| | | | miq_request_task.options[:ipam_fusionlayer_infinity_network_info] = nil
| | | | miq_request_task.options[:network_gateway] = 10.213.148.1 (type: String)
| | | | miq_request_task.options[:network_subnet_mask] = 255.255.252.0 (type: String)
| | | | miq_request_task.options[:network_usage] = Data (type: String)
| | | | miq_request_task.options[:parsed_dialog_options] = —

Thanks


#2

I would say that it is in

$evm.root[‘service_template_provision_task’].options[:
ipam_fusionlayer_infinity_ip_address_was_loadbalancer]


#3

ok, so your target is line 85 from your output:

miq_request_task.options[:ipam_fusionlayer_infinity_ip_address_was_loadbalancer] = 10.213.151.76 (type: String)

You’d be able to retrieve this using something like:

miq_request_task.get_option(:ipam_fusionlayer_infinity_ip_address_was_loadbalancer), but the challenge is finding the correct miq_request_task.

object_walker tries to give you hints as to the code that you need to use. Start with line 3 of your output:

| | miq_request = $evm.root['service_template_provision_task'].miq_request

This gives you the miq_request object. Now take a look at lines 61 & 62:

| | | miq_request.miq_request_tasks (type: Association)
| | | miq_request.miq_request_tasks.each do |miq_request_task|

This is in the — associations follow — section, and as object_walker knows there is more than one item in this associations list, it iterates through the list of miq_request_tasks

The slight challenge here is that we can see that the value you need is in one of these miq_request_task objects, but it might not be the first one (lines 63-65):

| | | (object type: MiqAeServiceServiceTemplateProvisionTask, object ID: 51000000004813)
| | | | Object MiqAeServiceServiceTemplateProvisionTask with ID 51000000004813 has already been printed…
| | | — next miq_request_task —

I would imagine that the MiqAeServiceServiceTemplateProvisionTask with ID 51000000004813 is your $evm.root['service_template_provision_task'] object, which has already been printed, so you could skip this using something like the following:

  next if miq_request_task.id == $evm.root['service_template_provision_task'].id

If you had multiple items in your bundle you might have to do some further testing to see if you had the right task object, for example:

next unless miq_request_task.options.has_key?(:ipam_fusionlayer_infinity_ip_address_was_loadbalancer)

So the total would be something like:

miq_request = $evm.root['service_template_provision_task'].miq_request
miq_request.miq_request_tasks.each do |miq_request_task|
  next if miq_request_task.id == $evm.root['service_template_provision_task'].id
  next unless miq_request_task.options.has_key?(:ipam_fusionlayer_infinity_ip_address_was_loadbalancer)
  ip = miq_request_task.get_option(:ipam_fusionlayer_infinity_ip_address_was_loadbalancer)
end

You’d probably need to make it more production-ready by adding some additional testing for possible error conditions in that loop, but that should get you to the value you’re after.

Hope this helps,
pemcg


#4

Thanks @pemcg @fdupont

Have tried a few things, but I keep getting [undefined method `[]=’ for nil:NilClass]

[----] E, [2017-10-17T21:34:30.697157 #21891:a375fc8] ERROR – : Q-task_id([service_template_provision_task_51000000004871]) [undefined method []=' for nil:NilClass] (druby://127.0.0.1:33744) -:308:inblock in get_vm_prefix’
(druby://127.0.0.1:33744) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1624:in perform_without_block' (druby://127.0.0.1:33744) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1584:inperform’
(druby://127.0.0.1:33744) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1657:in block (2 levels) in main_loop' (druby://127.0.0.1:33744) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1653:inloop’
(druby://127.0.0.1:33744) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1653:in block in main_loop' (druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/invokemethod.rb:11:inblock_yield’
(druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/invokemethod.rb:18:in block in perform_with_block' (druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/invokemethod.rb:15:ineach’
(druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/invokemethod.rb:15:in perform_with_block' (druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1582:inperform’
(druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1657:in block (2 levels) in main_loop' (druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1653:inloop’
(druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1653:in block in main_loop' <code: miq_request.miq_request_tasks.each do |miq_request_task|>:244:inget_vm_prefix’
<code: get_vm_prefix>:494:in block in pass_dialog_values_to_provision_task' /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1624:inperform_without_block’
/opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1584:in perform' /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1657:inblock (2 levels) in main_loop’
/opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1653:in loop' /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1653:inblock in main_loop’
[----] E, [2017-10-17T21:34:30.702996 #21891:a375fc8] ERROR – : Q-task_id([service_template_provision_task_51000000004871]) [connection closed]
(druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:579:in load' (druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:641:inrecv_reply’
(druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:941:in recv_reply' (druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1254:insend_message’
(druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1142:in block (2 levels) in method_missing' (druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1229:inopen’
(druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1141:in block in method_missing' (druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1160:inwith_friend’
(druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1140:in method_missing' (druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/invokemethod.rb:11:inblock_yield’
(druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/invokemethod.rb:18:in block in perform_with_block' (druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/invokemethod.rb:15:ineach’
(druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/invokemethod.rb:15:in perform_with_block' (druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1582:inperform’
(druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1657:in block (2 levels) in main_loop' (druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1653:inloop’
(druby://127.0.0.1:38456) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1653:in block in main_loop' (druby://hkgx3ecf5001.nwow001.corp.ete.cathaypacific.com:33744) -:549:inpass_dialog_values_to_provision_task’
(druby://hkgx3ecf5001.nwow001.corp.ete.cathaypacific.com:33744) -:568:in block in pass_dialog_values_to_children' (druby://hkgx3ecf5001.nwow001.corp.ete.cathaypacific.com:33744) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1624:inperform_without_block’
(druby://hkgx3ecf5001.nwow001.corp.ete.cathaypacific.com:33744) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1584:in perform' (druby://hkgx3ecf5001.nwow001.corp.ete.cathaypacific.com:33744) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1657:inblock (2 levels) in main_loop’
(druby://hkgx3ecf5001.nwow001.corp.ete.cathaypacific.com:33744) /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1653:in `loop’


#5

I think we’d need to see some of your code.

Can you post the dozen or so lines leading up to line 308 in get_vm_prefix


#6

@pemcg
get_vm_prefix.txt (2.0 KB)


#7

inspects.txt (23.2 KB)


#8

@h[:ipam_fusionlayer_infinity_ip_address_ihs_loadbalancer] = ihs_loadbalancer_ip

undefined method []=’ for nil:NilClass

looks like @h might be nil?


#9

yes think so too, just found that… getting ready to test the revised code


#10

hey @pemcg that did fix the null error, thanks!

still not getting the options…?

logs show “next unless miq_request_task.options.has_key?(:ipam_fusionlayer_infinity_ip_address_was_loadbalancer)” is never true…

if os_name.include? "Websphere Cluster"
  miq_request = task.miq_request
  miq_request.miq_request_tasks.each do |miq_request_task|
    next if miq_request_task.id == $evm.root['service_template_provision_task'].id
    next unless miq_request_task.options.has_key?(:ipam_fusionlayer_infinity_ip_address_was_loadbalancer)
    ihs_loadbalancer_ip = miq_request_task.get_option(:ipam_fusionlayer_infinity_ip_address_ihs_loadbalancer)
    ihsloadbalancer_id = miq_request_task.get_option(:ipam_fusionlayer_infinity_ip_address_id_ihs_loadbalancer)
    was_loadbalancer_ip = miq_request_task.get_option(:ipam_fusionlayer_infinity_ip_address_was_loadbalancer)
    was_loadbalancer_id = miq_request_task.get_option(:ipam_fusionlayer_infinity_ip_address_id_was_loadbalancer)
    $evm.log :info, "WAS debug for miq_request.miq_request_tasks #{ihs_loadbalancer_ip} #{was_loadbalancer_id}"
    @h[:ipam_fusionlayer_infinity_ip_address_ihs_loadbalancer] = ihs_loadbalancer_ip
    @h[:ipam_fusionlayer_infinity_ip_address_id_ihs_loadbalancer] = ihsloadbalancer_id
    @h[:ipam_fusionlayer_infinity_ip_address_was_loadbalancer] = was_loadbalancer_ip
    @h[:ipam_fusionlayer_infinity_ip_address_id_was_loadbalancer] = was_loadbalancer_id
  end
end

#11

From the output of object walker, it seems the data is already available in
’task’.
What does ‘task.options’ contain ?


#12

task = $evm.root[‘service_template_provision_task’]

and from objectwalker, it doesn’t look like the options are there

| $evm.root[‘service_template_provision_task’] => #MiqAeMethodService::MiqAeServiceServiceTemplateProvisionTask:0x00000014a12f48 (type: DRb::DRbObject, URI: druby://127.0.0.1:46381)
| | — attributes follow —
| | $evm.root[‘service_template_provision_task’].created_on = 2017-10-17 13:06:34 UTC (type: ActiveSupport::TimeWithZone)
| | $evm.root[‘service_template_provision_task’].description = Provisioning [RHEL IHS Bundle] for Service [RHEL IHS Bundle] (type: String)
| | $evm.root[‘service_template_provision_task’].destination_id = 51000000001556 (type: Fixnum)
| | $evm.root[‘service_template_provision_task’].destination_type = Service (type: String)
| | $evm.root[‘service_template_provision_task’].id = 51000000004864 (type: Fixnum)
| | $evm.root[‘service_template_provision_task’].message = Processing override_service_description… (type: String)
| | $evm.root[‘service_template_provision_task’].miq_request_id = 51000000001811 (type: Fixnum)
| | $evm.root[‘service_template_provision_task’].miq_request_task_id = 51000000004863 (type: Fixnum)
| | $evm.root[‘service_template_provision_task’].options[:cart_state] = ordered (type: String)
| | $evm.root[‘service_template_provision_task’].options[:delivered_on] = 2017-10-17 13:06:34 UTC (type: Time)
| | $evm.root[‘service_template_provision_task’].options[:dialog] = {“request”=>“clone_to_service”} (type: Hash)
| | $evm.root[‘service_template_provision_task’].options[:ldap_ad_galaxy_id] = cppclau (type: String)
| | $evm.root[‘service_template_provision_task’].options[:parent_service_id] = 51000000001555 (type: Fixnum)
| | $evm.root[‘service_template_provision_task’].options[:parent_task_id] = 51000000004863 (type: Fixnum)
| | $evm.root[‘service_template_provision_task’].options[:parsed_dialog_options] = —
| | 0:
| | :itsm_env: DR
| | :dialog_itsm_env: DR
| | :number_of_vms: ‘1’
| | :dialog_number_of_vms: ‘1’
| | :baas: ‘No’
| | :dialog_baas: ‘No’
| | :monitor: ‘No’
| | :dialog_monitor: ‘No’
| | :envname: Non-Prod
| | :dialog_envname: Non-Prod
| | :data_center: IMC3
| | :dialog_data_center: IMC3
| | :cx_project_id: imt12345
| | :dialog_cx_project_id: imt12345
| | :cx_remedy_appid: ‘0000’
| | :dialog_cx_remedy_appid: ‘0000’
| | :cx_crq_id: abcd123456
| | :dialog_cx_crq_id: abcd123456
| | :vm_size: Small
| | :dialog_vm_size: Small
| | 1:
| | :job_template_name: Linux_Websphere_IHS.Web.IH
| | :zone: Green
| | 2:
| | :job_template_name: Linux_WAS.App.WS
| | :zone: Green
| | (type: String)
| | $evm.root[‘service_template_provision_task’].options[:parsed_dialog_tags] = — {}
| | (type: String)
| | $evm.root[‘service_template_provision_task’].options[:pass] = 0 (type: Fixnum)
| | $evm.root[‘service_template_provision_task’].options[:requester_group] = imt12345 (type: String)
| | $evm.root[‘service_template_provision_task’].options[:scaling_idx] = 1 (type: Fixnum)
| | $evm.root[‘service_template_provision_task’].options[:scaling_min] = 1 (type: Fixnum)
| | $evm.root[‘service_template_provision_task’].options[:service_resource_id] = 51000000002554 (type: Fixnum)
| | $evm.root[‘service_template_provision_task’].options[:src_id] = 51000000000046 (type: Fixnum)
| | $evm.root[‘service_template_provision_task’].options[:user_message] = Finished ValidateUser (type: String)
| | $evm.root[‘service_template_provision_task’].options[:vlan] = [nil, nil] (type: Array)
| | $evm.root[‘service_template_provision_task’].options[:workflow_settings] = {:resource_action_id=>51000000012669, :dialog_id=>51000000000017} (type: Hash)
| | $evm.root[‘service_template_provision_task’].phase = nil
| | $evm.root[‘service_template_provision_task’].phase_context = {} (type: Hash)
| | $evm.root[‘service_template_provision_task’].region_description = Region 51 (type: String)
| | $evm.root[‘service_template_provision_task’].region_number = 51 (type: Fixnum)
| | $evm.root[‘service_template_provision_task’].request_type = clone_to_service (type: String)
| | $evm.root[‘service_template_provision_task’].source_id = 51000000000046 (type: Fixnum)
| | $evm.root['service_template_p


#13

Ok, I had missed the fact that miq_request_task is a child task of the
parent request, but not necessarily the current task.


#14

I think within your loop, maybe try a debug log line, something like:

miq_request.miq_request_tasks.each do |miq_request_task|
  $evm.log(:info, "Task: #{miq_request_task.id}, Options: #{miq_request_task.options.inspect}")
  next if...
  ...

end

#15

Hey @pemcg and @fdupont, thanks for the help. Got it going via a few test runs, objwalks and extra logging. Pretty much as you suggested from the get go Pete. This worked for me.

task = $evm.root[‘service_template_provision_task’]
miq_request = task.miq_request
miq_request.miq_request_tasks.each do |miq_request_task|
next if miq_request_task.id == $evm.root[‘service_template_provision_task’].id
next unless miq_request_task.options.has_key?(:ipam_fusionlayer_infinity_ip_address_ihs_loadbalancer)
var = miq_request_task.options[:ipam_fusionlayer_infinity_ip_address_ihs_loadbalancer]

Thanks again!