VMware Cloud Community
smithgp
Enthusiast
Enthusiast
Jump to solution

vCAC vCO plugin -- get vCACCAFECsResourceType for internal "IaaS VC VirtualMachine" resource type in workflow?

Hi -

I'm in vCO using the 6.0.1 vCO Plug-in for vCAC, trying to create a vCAC ADS resource action to run against a VC:VirtualMachine. When I manually register my action workflow in the vCAC UI, it finds the VC:VirtualMachine input parameter and maps it to an "IaaS VC VirtualMachine" resource type, and the action shows and runs correctly against VMs selected in the vCAC UI Items.

Now, in a workflow to create the resource action, I'm trying to use createResourceActionFromWorkflow() from the com.vmware.library.vcaccafe.asd.resourceaction package, which requires a vCACCAFECsResourceType (i.e. VCACCAFE:CustomResource) object. I want to point to the same "Infrastructure.Virtual" resource type which the vCAC UI uses, but I can't seem to find it in a safe fashion.

If I get a previously created VCACCAFE:ResourceAction and look at its getInputParameter().getResourceType() in a workflow, I can see an object that looks like:

[2014-08-11 16:14:50.094] [I] type.id=eaba1f37-6154-4c17-94ae-ea419cb9e14e

[2014-08-11 16:14:50.095] [I] type.name=IaaS VC VirtualMachine

[2014-08-11 16:14:50.095] [I] type.externalTypeId=Infrastructure.Virtual

[2014-08-11 16:14:50.095] [I] type.vcoType=VC:VirtualMachine

[2014-08-11 16:14:50.095] [I] type.vcoId=null

[2014-08-11 16:14:50.095] [I] type.providerId=asd.external

[2014-08-11 16:14:50.096] [I] type.tenantId=_internal

and if I do a new vCACCAFECsResourceType() and set the values (especially the id) in that object manually and use that in createResourceActionFromWorkflow(), it works. But, it doesn't feel safe to hard-code the type.id in my workflow -- will that work on other vCAC installs?

Also, I have been to get the corresponding vCACCAFEResourceType via:


vCACCAFEHost.createAdvancedDesignerClient().getAdvancedDesignerCsResourceTypeService().getResourceType('_internal', 'Infrastructure.Virtual');

but that's a different object class and I can't see how to get the corresponding vCACCAFECsResourceType.

I also tried doing a com.vmware.library.vcaccafe.asd.customresources.createCustomResourceFromInventoryType() for 'VC:VirtualMachine' and then using that vCACCAFECsResourceType to create the resource action. It creates and publishes just fine, but the action never shows in the vCAC UI (using the same entitlement as when using Infrastructure.Virtual).

Any ideas? Thanks,

Greg

0 Kudos
1 Solution

Accepted Solutions
smithgp
Enthusiast
Enthusiast
Jump to solution

This turns out to be just an issue in 6.0.

When I switched to 6.1, the entries from the 'Resource Mappings' tab in the UI show up in the 'ASD Custom Resources' folder of the vCACCAFEHost's inventory, and vCACCAFEEntitiesFinder.findCustomResources(host) returns them, with the one mapped to 'VC:VirtualMachine' having the right guid. That same method in 6.0 would return an empty array.

View solution in original post

0 Kudos
4 Replies
smithgp
Enthusiast
Enthusiast
Jump to solution

Actually, it's

host.createCatalogProviderClient().getCatalogProviderResourceTypeService().getResourceType('Infrastructure.Virtual');

that gives the corresponding Infrastructure.Virtual vCACCAFEResourceType. That getAdvancedDesignerCsResourceTypeService().getResourceType() calls throws an 'Invalid argument'.

Still stumped, though.

Greg

0 Kudos
smithgp
Enthusiast
Enthusiast
Jump to solution

Also, just found:

host.createCatalogProviderClient().getCatalogProviderCatalogItemTypeService().getCatalogItemType('Infrastructure.Virtual');

which gives essentially the same data but as a vCACCAFECatalogItemType. I thought maybe getOutputResourceTypeId() would give me something related to the vCACCAFECsResourceType id, but it's null.

0 Kudos
smithgp
Enthusiast
Enthusiast
Jump to solution

This turns out to be just an issue in 6.0.

When I switched to 6.1, the entries from the 'Resource Mappings' tab in the UI show up in the 'ASD Custom Resources' folder of the vCACCAFEHost's inventory, and vCACCAFEEntitiesFinder.findCustomResources(host) returns them, with the one mapped to 'VC:VirtualMachine' having the right guid. That same method in 6.0 would return an empty array.

0 Kudos
jmedd
Enthusiast
Enthusiast
Jump to solution

Thanks for posting about this, just what I was looking for Smiley Happy

Blog: http://jonathanmedd.net | Twitter: @jonathanmedd
0 Kudos