Service Dialog And Catalogs selection box appears empty

Hi all,

I’m trying to build a service catalog with a dialog as the attached screenshot, but the selection fields always appears empty on flavors list. In this case I’m trying to read the available flavors from Openstack but It doesn’t appear anything from the list.

I’m using this Entry point: “/ ManageIQ / Cloud / Orchestration / Operations / Methods / Available_Flavors”

Any hint what I could be missing?

Thanks

I think those methods are intended to be used when you’re creating an orchestration template service (ManageIQ).

I think the easiest way to list all openStack flavours in a dialog dropdown would be to create a simple expression method to list them. No Ruby is necessary, there’s an example here.

Hope this helps,
pemcg

Hi Peter,

thank you so much, I’ll check it out.

Regards

Hi Peter,

now it appears something, thank you. But how can I select the outputs I want to see? In this case I want to see the name, num cpus, memory, disk, etc.

I tried to follow the simulation to see what outputs I have, but I don’t see any output, maybe I’m doing the wrong simulation?

I’ve attached the method I’m using.

Thanks

You probably need the extra flexibility of a Ruby method to perform the lookup in this case. Then you can format the dropdown text string any way you like, such as “f1: (1 CPU, 4GB memory, 20GB disk)”

pemcg

Hi Peter,

so I created the method below but I always get the error.

[----] I, [2021-06-02T10:01:43.579885 #2474:2b25642702b8] INFO – : Getting flavours available for Cloud Tenant:
[----] E, [2021-06-02T10:01:43.583308 #2474:2b25642702b8] ERROR – : The following error occurred during method evaluation:
[----] E, [2021-06-02T10:01:43.584813 #2474:2b25642702b8] ERROR – : NoMethodError: undefined method ext_management_system' for nil:NilClass** **[----] E, [2021-06-02T10:01:43.586971 #2474:2b25642702b8] ERROR -- : <AEMethod get_flavors>** **[----] E, [2021-06-02T10:01:43.587954 #2474:2b25641a0e3c] ERROR -- : Method STDERR: /ITCenter/Cloud/Integration/Methods/get_flavors:16:in ‘: undefined method `ext_management_system’ for nil:NilClass (NoMethodError)
[----] I, [2021-06-02T10:01:43.5

Description: Called from a Dialog Dropdown list field. Will fill with available Cloud Networks for a specific Tenant.

Can you post a link to your method (I’d suggest pasting it into a pasteboard somewhere and posting the link here).

Hi Peter,

https://pastebin.com/ezNQySAF

Thanks

line 9 isn’t finding a valid cloud_tenant_id (I suspect that source_id is nil), which is why the log line at 10 is just printing "Getting flavours available for Cloud Tenant: " Try printing out $evm.root['tenant'].name to check that you’re where you think you are.

pemcg

Hi Peter,

I have a method to retrieve the networks using cloud_tenant_id = $evm.root[‘tenant’].source_id and it’s working: https://pastebin.com/UkvC4Pei

Could it be this: cloud_tenant.ext_management_system.flavors.each do |flavor| ??

Thanks

This means that the value of cloud_tenant was nil rather than a valid object, because your $evm.vmdb lookup (line 12) failed to find anything matching the blank cloud_tenant_id (confirmed from the log message from line 10).

Not all tenant objects will have a valid source_id attribute, that’s why I suggested printing the current tenant name, or even dumping $evm.root[‘tenant’] in its entirety so that you can see what’s there.

Hope this helps,
pemcg