Enthusiast
Enthusiast

Proper way to map XaaS Type on vRA 7.X Catalog

Jump to solution

I have the following scenario (opinions are always welcome):

I want to provision a Load Balancer as a Service using XaaS. So, to accomplish this task, I've used the vRO DynamicType Plugin to create this association tree:

Namespace: LoadBalancer

  • Device (the device itself)
    • Virtual Server (virtual server data such as source/destination address, fqdn and some profiles)
      • Pool (Pool with the servers)
        • Pool Member (Servers themselves)

Then, I've created a workflow to Create a new load balancer wich takes some input such as:

  • Network Environment: So I can determine wich of my load balancers will have the request virtual server created
  • Server List: For now, I'm using a datagrid wich basically receives Server Address and Port (Wich I still dont know how to properly validate each inclusion on this grid, but I guess this is another thread)
  • Domain Name: From a list, the user will pick up an allowed domain.
  • <Few other informations>

And the workflow output is a DynamicType:LoadBalancer.VirtualServer. When the workflow finishes, I create the output using DynamicTypeManager.makeObject(), which for some reason, does not return anything while debugging but I can see the data when refreshing the inventory.

That setted up, I created the following:

XaaS Custom Resource: DynamicType:LoadBalancer.VirtualServer to create a Virtual Server resource with the form that I wanted (somehow) display to the end user after workflow is finished.

XaaS Resource Mapping: Map the custom resource Virtual Server to orchestrator type DynamicType:LoadBalancer.VirtualServer with it's proper Map workflow

XaaS Blueprint: The XaaS itself, with the proper form and provisioned resource mapped to the output parameter.

When I request the XaaS blueprint thru the Catalog, the workflow does work and the load balancer is provisioned perfectly except that nothing returns to the end user, so, I cannot tell the user what's the FQDN that I just generated, the source ip address and some more information that my object have. The deployment screen just shows it's completed but no response information is displayed.

Am I missing something or is there a better way to accomplish this scenario?

Thanks in advance :smileygrin:

0 Kudos
1 Solution

Accepted Solutions
Hot Shot
Hot Shot

DynamicTypesManager.makeObject() is used by the finder methods for dynamic types.

To have a dynamic type be returned by an XaaS workflow to the vRA inventory your workflow must use DynamicTypesManager.getObject().

With the item available in the inventory now they will be able to see the properties you have exposed on the object. Those properties can also be used for binding in blueprints.

As you are creating an XaaS Custom Resource there is no need to have an XaaS Mapping.

View solution in original post

0 Kudos
2 Replies
Hot Shot
Hot Shot

DynamicTypesManager.makeObject() is used by the finder methods for dynamic types.

To have a dynamic type be returned by an XaaS workflow to the vRA inventory your workflow must use DynamicTypesManager.getObject().

With the item available in the inventory now they will be able to see the properties you have exposed on the object. Those properties can also be used for binding in blueprints.

As you are creating an XaaS Custom Resource there is no need to have an XaaS Mapping.

View solution in original post

0 Kudos
Enthusiast
Enthusiast

Seems like the problem is the findById mapping? I've created a workflow wich receives the DynamicTypes:MyObject as parameter, I can choose the item in inventory but still cannot get it's id by scripting:

System.log(runbook.id) throws this exception:

[2020-01-22 12:01:33.232] [E] Workflow:Execute Runbook / Scriptable task (item3) : java.lang.ClassCastException: ch.dunes.model.type.TypeConverter$NullObject cannot be cast to com.vmware.o11n.plugin.dynamictypes.model.DynamicObject

[2020-01-22 12:01:33.245] [E] Workflow execution stack:

***

item: 'Execute Runbook/item3', state: 'failed', business state: 'null', exception: 'ch.dunes.model.type.TypeConverter$NullObject cannot be cast to com.vmware.o11n.plugin.dynamictypes.model.DynamicObject'

workflow: 'Execute Runbook' (27d94a29-b53f-4807-9839-dd285d3fea7c)

Any hints?

Problem was due to cache settings. I was saving the data on cache using a prefix but the object id didn't have this prefix.

findByIdMapping is called everytime you try to do object.<anything>() so just for reference, make sure it does return the object proxy correctly.

0 Kudos