Catalog Bundle - How to name the VMs


#1

Hi,

I’m trying to provision some VM’s using a Catalog Bundle. In CatalogBundleInitialiaztion, I can see that my dialog option was successfully parsed, and added to my options_hash:

<AEMethod catalogbundleinitialization> Listing Root Object Attributes in linuxera/CatalogBundleInitialization:
...
<AEMethod catalogbundleinitialization> 	dialog_option_0_vm_name: leratest30
....
<AEMethod catalogbundleinitialization> Adding sequence_id:<0> option_key:<:dialog_option_0_vm_name> v:<"leratest30"> to options_hash

Full Log for CatalogBundleInitialization step:

Q-task_id([service_template_provision_task_2013000000000132]) Processing State=[pre2]
Q-task_id([service_template_provision_task_2013000000000132]) Following Relationship [miqaedb:/Service/Provisioning/StateMachines/Methods/CatalogBundleInitialization#create]
Q-task_id([service_template_provision_task_2013000000000132]) Updated namespace [miqaedb:/Service/Provisioning/StateMachines/Methods/CatalogBundleInitialization#create  ManageIQ/Service/Provisioning/StateMachines]
Q-task_id([service_template_provision_task_2013000000000132]) Updated namespace [Service/Provisioning/StateMachines/Methods/catalogbundleinitialization  linuxera/Service/Provisioning/StateMachines]
Q-task_id([service_template_provision_task_2013000000000132]) Invoking [inline] method [linuxera/Service/Provisioning/StateMachines/Methods/CatalogBundleInitialization] with inputs [{}]
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod [linuxera/Service/Provisioning/StateMachines/Methods/CatalogBundleInitialization]> Starting 
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> Listing Root Object Attributes in linuxera/CatalogBundleInitialization:
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> 	ae_result: ok
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> 	ae_state: pre2
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> 	ae_state_retries: 0
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> 	ae_state_started: 2015-05-12 14:07:17 UTC
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> 	ae_status_state: on_entry
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> 	dialog_option_0_vm_name: leratest30
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> 	miq_server: #<MiqAeMethodService::MiqAeServiceMiqServer:0x0000000a2f6250>
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> 	miq_server_id: 2013000000000001
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> 	object_name: CatalogBundleInitialization
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> 	request: clone_to_service
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> 	service_template_provision_task: #<MiqAeMethodService::MiqAeServiceServiceTemplateProvisionTask:0x00000008f58b08>
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> 	service_template_provision_task_id: 2013000000000132
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> 	user: #<MiqAeMethodService::MiqAeServiceUser:0x00000008baa0b0>
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> 	user_id: 2013000000000001
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> 	vmdb_object_type: service_template_provision_task
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> ===========================================
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> *** Service template provision task :<{#<MiqAeServiceServiceTemplateProvisionTask:0x47ac584 @object=#<ServiceTemplateProvisionTask id: 2013000000000132, description: "Provisioning [LX-develBundle] for Service [LX-devel...", state: "pending", request_type: "clone_to_service", userid: "admin", options: {:dialog=>{"dialog_option_0_vm_name"=>"leratest30", "request"=>"clone_to_service"}, :workflow_settings=>{:resource_action_id=>2013000000000016, :dialog_id=>2013000000000001}, :src_id=>2013000000000006, :delivered_on=>2015-05-12 14:07:08 UTC, :pass=>0}, created_on: "2015-05-12 14:07:08", updated_on: "2015-05-12 14:07:17", message: "Processing Pre2", status: "Ok", type: "ServiceTemplateProvisionTask", miq_request_id: 2013000000000049, source_id: 2013000000000006, source_type: "ServiceTemplate", destination_id: 2013000000000059, destination_type: "Service", miq_request_task_id: nil, phase: nil, phase_context: {}>, @virtual_columns=["region_description", "region_number"], @associations=["destination", "miq_request", "miq_request_task", "miq_request_tasks", "service_resource", "source"]>>
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> Detected Service:<LX-develBundle> Id:<2013000000000059>
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> Inspecting Dialog Options:<{"dialog_option_0_vm_name"=>"leratest30", "request"=>"clone_to_service"}>
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> Adding sequence_id:<0> option_key:<:dialog_option_0_vm_name> v:<"leratest30"> to options_hash
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> Adding sequence_id:<0> option_key:<:request> v:<"clone_to_service"> to options_hash
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> Inspecting options_hash:<{0=>{:dialog_option_0_vm_name=>"leratest30", :request=>"clone_to_service"}}>
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> Processing Tag Key:<:dialog_option_0_vm_name> Value:<"leratest30">
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> Processing Tag Key:<:request> Value:<"clone_to_service">
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> Child service name:<LX-DBdevel> group_idx:<1>
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> Adding Dialog Option:<{:dialog_option_0_vm_name => "leratest30"}> to Child Service:<LX-DBdevel>
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> Adding Dialog Option:<{:request => "clone_to_service"}> to Child Service:<LX-DBdevel>
Q-task_id([service_template_provision_task_2013000000000132]) <AEMethod catalogbundleinitialization> Inspecting Child Service:<LX-DBdevel> Dialog Options:<{:dialog_option_0_vm_name=>"leratest30", :request=>"clone_to_service"}>

But miq_provision object for the new VM to be provisioned does not include these and the provisioned vm gets the name cfmeXX

<AEMethod vmware_preprovision> Listing Provisioning Object Attributes in linuxera/vmware_PreProvision:
....    
<AEMethod vmware_preprovision> 	options: {:service_template_request=>false, :initial_pass=>true, :miq_request_dialog_name=>"miq_provision_dialogs_template", 
...
:vm_target_name=>"cfme024", 
...
:vm_target_hostname=>"changeme", :miq_force_unique_name=>[true, 1], :service_guid=>"2d698f86-f8b0-11e4-afe8-001a4ab9997a", :service_resource_id=>2013000000000136}

Does anybody have any pointers how to pass (one or more) dialog options to actual provisioned VMs? What I’m trying to do is provision a bunch of VMs with Catalog Bundle, and name them according to dialog options and tags associated.

Thanks & regards,

Ekin.

Full Log for PreProvision step:

Q-task_id([miq_provision_2013000000000135]) Processing State=[PreProvision]
Q-task_id([miq_provision_2013000000000135]) Following Relationship [miqaedb:/Infrastructure/VM/Provisioning/StateMachines/Methods/PreProvision#VMware]
Q-task_id([miq_provision_2013000000000135]) Updated namespace [miqaedb:/Infrastructure/VM/Provisioning/StateMachines/Methods/PreProvision#VMware  ManageIQ/Infrastructure/VM/Provisioning/StateMachines]
Q-task_id([miq_provision_2013000000000135]) Updated namespace [Infrastructure/VM/Provisioning/StateMachines/Methods/vmware_preprovision  linuxera/Infrastructure/VM/Provisioning/StateMachines]
Q-task_id([miq_provision_2013000000000135]) Invoking [inline] method [linuxera/Infrastructure/VM/Provisioning/StateMachines/Methods/vmware_PreProvision] with inputs [{}]
Q-task_id([miq_provision_2013000000000135]) <AEMethod [linuxera/Infrastructure/VM/Provisioning/StateMachines/Methods/vmware_PreProvision]> Starting 
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> Listing Root Object Attributes in linuxera/vmware_PreProvision:
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	ae_provider_category: infrastructure
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	ae_result: ok
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	ae_state: PreProvision
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	ae_state_retries: 0
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	ae_state_started: 2015-05-12 14:08:09 UTC
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	ae_status_state: on_entry
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	miq_provision: #<MiqAeMethodService::MiqAeServiceMiqProvisionVmware:0x00000009e6ef48>
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	miq_provision_id: 2013000000000135
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	miq_server: #<MiqAeMethodService::MiqAeServiceMiqServer:0x0000000a3da1f8>
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	miq_server_id: 2013000000000001
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	object_name: AUTOMATION
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	request: vm_provision
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	state_machine: VMProvision_vm
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	target_class: Lifecycle
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	target_component: VM
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	target_instance: Provisioning
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	user: #<MiqAeMethodService::MiqAeServiceUser:0x0000000a3e37d0>
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	user_id: 2013000000000001
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	vmdb_object_type: miq_provision
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> ===========================================
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> Listing Provisioning Object Attributes in linuxera/vmware_PreProvision:
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	created_on: 2015-05-12 14:07:08 UTC
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	description: Provision from [el6-BasicServerTemplate-20150302] to [cfme024]
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	destination_id: 
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	destination_type: 
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	id: 2013000000000135
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	message: Applying PreProvision Customizations
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	miq_request_id: 2013000000000049
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	miq_request_task_id: 2013000000000134
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	options: {:service_template_request=>false, :initial_pass=>true, :miq_request_dialog_name=>"miq_provision_dialogs_template", :owner_email=>"admin@linuxera.com", :requester_enabled=>["disabled"], :purpose_enabled=>["disabled"], :current_tab_key=>:customize, :owner_phone=>nil, :owner_country=>nil, :owner_phone_mobile=>nil, :owner_title=>nil, :owner_first_name=>nil, :owner_manager=>nil, :owner_address=>nil, :owner_company=>nil, :owner_last_name=>nil, :owner_manager_mail=>nil, :owner_city=>nil, :owner_department=>nil, :owner_load_ldap=>nil, :owner_manager_phone=>nil, :owner_state=>nil, :owner_office=>nil, :owner_zip=>nil, :request_notes=>nil, :vm_tags=>[], :dns_servers=>"192.168.3.121, 192.168.4.140", :sysprep_organization=>nil, :sysprep_password=>nil, :sysprep_server_license_mode=>["perServer", "Per server"], :ldap_ous=>[nil, nil], :sysprep_timezone=>[nil, "(GMT-12:00) International Date Line West"], :dns_suffixes=>"linuxera.hq", :sysprep_product_id=>nil, :sysprep_identification=>["domain", "Domain"], :sysprep_per_server_max_connections=>"5", :sysprep_computer_name=>nil, :sysprep_workgroup_name=>"WORKGROUP", :sysprep_spec_override=>[true, 1], :addr_mode=>["static", "Static"], :linux_host_name=>"changeme", :sysprep_domain_admin=>nil, :sysprep_change_sid=>[true, 1], :sysprep_domain_name=>[nil, nil], :sysprep_upload_file=>nil, :gateway=>"192.168.4.10", :ip_addr=>"192.168.4.252", :linux_domain_name=>"linuxera.hq", :sysprep_domain_password=>nil, :sysprep_auto_logon=>[true, 1], :sysprep_enabled=>["fields", "Specification"], :sysprep_delete_accounts=>[false, 0], :sysprep_upload_text=>nil, :wins_servers=>"", :subnet_mask=>"255.255.255.0", :sysprep_full_name=>nil, :sysprep_auto_logon_count=>[1, "1"], :customization_template_script=>nil, :root_password=>nil, :hostname=>nil, :new_datastore_grow_increment=>nil, :new_datastore_create=>[false, 0], :placement_cluster_name=>[nil, nil], :new_datastore_aggregate=>[nil, nil], :new_datastore_max_size=>nil, :new_datastore_storage_controller=>[nil, nil], :cluster_filter=>[nil, nil], :host_filter=>[nil, nil], :ds_filter=>[nil, nil], :new_datastore_volume=>[nil, nil], :new_datastore_fs_type=>["NFS", "NFS"], :rp_filter=>[nil, nil], :new_datastore_thin_provision=>nil, :placement_auto=>[false, 0], :new_datastore_size=>nil, :new_datastore_autogrow=>[false, 0], :placement_folder_name=>[nil, nil], :new_datastore_name=>nil, :placement_rp_name=>[2013000000000001, "Default for Host balin.linuxera.hq"], :placement_dc_name=>[2013000000000005, "linuxera-vmw"], :number_of_vms=>[1, "1"], :vm_description=>nil, :vm_prefix=>nil, :src_vm_id=>[2013000000000083, "el6-BasicServerTemplate-20150302"], :vm_name=>"changeme", :pxe_server_id=>[nil, nil], :host_name=>nil, :provision_type=>["vmware", "VMware"], :linked_clone=>[nil, nil], :snapshot=>[nil, nil], :vm_filter=>[nil, nil], :schedule_type=>["immediately", "Immediately on Approval"], :vm_auto_start=>[true, 1], :schedule_time=>2015-03-03 07:55:00 UTC, :retirement=>[0, "Indefinite"], :retirement_warn=>[604800, "1 Week"], :vdi_new_desktop_pool_name=>nil, :vdi_farm=>[nil, nil], :vdi_new_desktop_pool_assignment=>[nil, nil], :vdi_desktop_pool_create=>[false, 0], :vdi_desktop_pool=>[nil, nil], :vdi_enabled=>[false, 0], :vdi_desktop_pool_user_list=>nil, :vlan=>["dvs_DPortGroup_4", "DPortGroup_4 (linuxera-DSwitch)"], :mac_address=>nil, :disk_format=>["unchanged", "Default"], :cpu_limit=>-1, :memory_limit=>-1, :number_of_sockets=>[1, "1"], :cores_per_socket=>[1, "1"], :cpu_reserve=>0, :vm_memory=>["1024", "1024"], :memory_reserve=>0, :network_adapters=>[1, "1"], :start_date=>"3/3/2015", :start_hour=>"9", :start_min=>"55", :name=>"LX-DBdevel", :description=>"Linuxera Devel DBserver", :long_description=>nil, :provision_cost=>nil, :display=>false, :catalog_id=>nil, :available_catalogs=>[["LX Devel Catalog", 2013000000000002], ["Test System Catalog", 2013000000000001]], :retire_fqname=>"", :reconfigure_fqname=>"", :fqname=>"", :available_dialogs=>{2013000000000001=>"basicserverdialog", 2013000000000002=>"Test Bed Configuration", 2013000000000003=>"OSE Installer"}, :st_prov_type=>"vmware", :service_type=>"atomic", :placement_host_name=>[2013000000000001, "balin.linuxera.hq"], :placement_ds_name=>[2013000000000004, "lera_vmware2_DS"], :src_vm_nics=>["Network adapter 1"], :src_vm_lans=>[], :customize_enabled=>["disabled"], :src_ems_id=>[2013000000000001, "linuxera Vcenter"], :sysprep_custom_spec=>["2013000000000001", "spec1"], :delivered_on=>nil, :dialog_id=>0, :pass=>0, :dns_domain=>"linuxera.hq", :vm_target_name=>"cfme024", :vm_target_hostname=>"changeme", :miq_force_unique_name=>[true, 1], :service_guid=>"2d698f86-f8b0-11e4-afe8-001a4ab9997a", :service_resource_id=>2013000000000136}
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	phase: 
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	phase_context: {}
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	request_type: template
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	source_id: 2013000000000083
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	source_type: VmOrTemplate
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	state: pending
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	status: Ok
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	type: MiqProvisionVmware
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	updated_on: 2015-05-12 14:08:10 UTC
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> 	userid: admin
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> ===========================================
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> Provision:<2013000000000135> Request:<2013000000000049> Type:<MiqProvisionVmware>
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> Template:<el6-BasicServerTemplate-20150302> Provider:<linuxera Vcenter> Vendor:<VMware> Product:<red hat enterprise linux 6 (64-bit)> Bitness:<>
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> Processing set_folder...
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> Provisioning object <:placement_folder_name> updated with <[nil, nil]>
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> Processing set_folder...Complete
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> Processing set_notes...
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> Provisioning object <:vm_notes> updated with <Owner:  
Email: admin@linuxera.com
Source: el6-BasicServerTemplate-20150302>
Q-task_id([miq_provision_2013000000000135]) <AEMethod vmware_preprovision> Processing set_notes...Complete
Q-task_id([miq_provision_2013000000000135]) <AEMethod [linuxera/Infrastructure/VM/Provisioning/StateMachines/Methods/vmware_PreProvision]> Ending
Q-task_id([miq_provision_2013000000000135]) Method exited with rc=MIQ_OK
Q-task_id([miq_provision_2013000000000135]) Followed  Relationship [miqaedb:/Infrastructure/VM/Provisioning/StateMachines/Methods/PreProvision#VMware]
Q-task_id([miq_provision_2013000000000135]) Processed  State=[PreProvision] with Result=[ok]
Q-task_id([miq_provision_2013000000000135]) Next State=[Provision]
Q-task_id([miq_provision_2013000000000135]) In State=[PreProvision], invoking [on_exit] method=[update_provision_status(status => 'Applied PreProvision Customizations')]
Q-task_id([miq_provision_2013000000000135]) Updated namespace [Infrastructure/VM/Provisioning/StateMachines/VMProvision_vm/update_provision_status  ManageIQ/Infrastructure/VM/Provisioning/StateMachines]
Q-task_id([miq_provision_2013000000000135]) Invoking [inline] method [ManageIQ/Infrastructure/VM/Provisioning/StateMachines/VMProvision_VM/update_provision_status] with inputs [{"status"=>"Applied PreProvision Customizations"}]
Q-task_id([miq_provision_2013000000000135]) <AEMethod [ManageIQ/Infrastructure/VM/Provisioning/StateMachines/VMProvision_VM/update_provision_status]> Starting 
Q-task_id([miq_provision_2013000000000135]) <AEMethod [ManageIQ/Infrastructure/VM/Provisioning/StateMachines/VMProvision_VM/update_provision_status]> Ending
Q-task_id([miq_provision_2013000000000135]) Method exited with rc=MIQ_OK

Documentation and worked examples for Automate features
#2

Hi Ekin,

Our upcoming release contains some enhancements for vm and service naming. Until then, you should be able to set the vm name by modifying the catalogiteminitialization automate method.

Service dialogs can be really confusing. Here’s how it’s supposed to work:
All dialog entries are automatically prefixed with “dialog_” so it’s not necessary to add the dialog prefix when creating the service dialog attributes.
The dialog processing is supposed to pass the correct information to the appropriate item(s). This is accomplished by the use of a naming and numbering schema.
In addition to custom dialog names, attribute names containing “option” and “tag” could have special meaning.
The dialog numbering schema is setup so dialog attributes with zero key entries are global and passed to all service items. The non-zero key entries are applied to the service items that have a matching provision order. Service item 1 will have options for 0 and 1, service item 2 will have options for 0 and 2, ……
The combination of naming(options and tags) and numbering(global vs item specific) is key to setting up the dialog attributes:
The provision order is what determines how the dialog information is passed to each catalog item for processing. For example, if you had a Catalog Bundle that contained 3 Catalog Items, you would set the provision order for each item to pass information based on the dialog number scheme described above.

To set the name of a VM, you should set both the vm_target_name and vm_name in the child dialog options.

Let me know if you have any questions.

Regards,
Tina


#3

Hi Tina,

Thanks for your detailed reply, it is very helpful… But my question still stands, let me elaborate:

  • When I provision a single VM via using a Catalog Item (i.e. Provisioning Entry Point is CatalogItemInitialization), I have dialog_option_0_vm_name in $evm.root at the beginning of vmware_PreProvison method. So I can set :vm_target_name and :vm_name in the miq_provision object in this method - this is working perfectly fine.

  • But this fails when I use CatalogBundleInitialization as an entry point: I use catalog items with “Display in Catalog” option un-checked as Catalog Bundle resources (so they have no Provisioning Entry Point set). The Provisioning Entry Point for the bundle is Service/Provisioning/StateMachines/ServiceProvision_Template/CatalogBundleInitialization

  • Although I can still see dialog_option_0_vm_name in $evm.root at the CatalogBundleInitialization, and options_hash is populated successfully, I’m unable to pass these values to the following methods - i.e. PreProvision, where I usually set :vm_target_name etc.

  • And if I’m not mistaken, there is no [‘miq_provision’] object at the CatalogBundleInitialization phase, so it is not possible to set an :vm_target_name at that point in time. And I assume this makes sense in a way, we will have a number of VMs to provision, every one of them having their unique provision object.

I suspect what I need is a way to access the options_hash for the child VM in a method after CatalogBundleInitialization.

I hope I was able to express my question clearly rather than getting it more complicated…

Thanks again,


#4

I think the part you are missing is that the individual items in the bundle should point to CatalogItemInitialization so that when they are deployed it then goes through the item initialization.


#5

Thanks Brad,

I -falsely- assumed CatalogBundleInitialization was sufficent, but as you’ve pointed, CatalogItemInitialization is also required to pass dialog options not only to the children, but also to the grandchildren.

One more question though - is there a reason why Catalog Entry Point field is invisible when Display in Catalog is unchecked in the Add new Catalog Item dialog? Since I did not want individual items to show up on their own, I thought leaving entry point (along with Dialog etc.) blank was the default for items that make up a bundle. And to try your suggestion, I had to check Display in Catalog, select entry point, and then uncheck the Display… again - a bit of confusing I think…

Thanks again,

Ekin.


#6

Ekin,

I think that would be a good RFE, to move that outside of the hidden items and always available whether or not display in catalog is chosen.

Cheers!