unhappyvra
Enthusiast
Enthusiast

XaaS provisioning request - no item in the "Items" tab

Hi!

I'm trying to connect vRA 7.3 to external REST API system to provision and manage objects in it through vRA.

I configured Dynamic Types "My Type"  (with dynamic types plugin v2) and saw all my external objects in vRO inventory (under Dynamic Types plugin). Next I configured XaaS "Custom Resource" == "My Type", vRA showed all "My Type" properties without any problem. So, on the next step I created XaaS blueprint, connected vRO workflow to deploy an object in external system (workflow output parameter = "My Type" object, workflow properly returns "My Type" object). In XaaS blueprint I selected "Provisioning Resource" == "My Type", it showed proper mapping to my workflow output parameter... Published blueprint, added to service, grant permission to users, bla-bla-bla Smiley Happy 

So, now I have my XaaS blueprint in "Catalog" tab, I can even request it (and vRO would deploy object in external system!!!), but - I don't see any my objects in the "Items" tab... vRO could see them in its own inventory... Without objects in "Items" I can't do day-2 operations or anything else!

So, question is - why I don't see XaaS objects in my "Item" tab? Where do I need to look to find out what's wrong with all this stuff?

16 Replies
nmshadey
Enthusiast
Enthusiast

Do you see the object listed under the Dynamic types inventory in vRO? Also are you using a clustered vRO setup and does the object appear on both vRO inventories?

0 Kudos
unhappyvra
Enthusiast
Enthusiast

Yes, I could see a new object in vRO's Dynamic Types. I don't have any problem with objects in vRO, at least it looks like everything fine here. I use vRA's vRO, single node, not clustered.

0 Kudos
DanieleUlrich
Enthusiast
Enthusiast

Dynamic Types are out of the box in a subtab under items and not in deployments.

dynamic types.png

If it is the first time you are provisioning new dynamic types, you might have to refresh the browser in order to allow vra portal to add the tab.

0 Kudos
unhappyvra
Enthusiast
Enthusiast

Well, this is exactly what i'm asking - I don't have "Dynamic Types" box/category, it never appeared in my "Items" tabs (even days later, even in other browsers Smiley Happy)

I opened SR,waiting they answer.

BTW, could you please describe how you made it work? Did you use Dynamic plugin generator?

0 Kudos
DanieleUlrich
Enthusiast
Enthusiast

I followed these blogs: https://www.vcoteam.info/articles/learn-vco/291-sql-plug-in-dynamictypes-simple-cmdb-for-vcac-part-1...

https://www.vcoteam.info/articles/learn-vco/291-sql-plug-in-dynamictypes-simple-cmdb-for-vcac-part-1...

(3 Parts, dynamic types with a database as data source)

If you see the objects in vRO then there has to be a problem in returning the object into the vRA inventory (a resource object should wrap the dynamic type).

You already confirmed some steps that are needed, but let me double down on what I learned so far:

custom_resources.jpg

That's what you are refering as ""Custom Resource" == "My Type", I guess.

resource_type.jpg

resource_usage.jpg

Here you can check where the custom resources are referenced. Do you see your XaaS blueprint?

resource_return_type.jpg

That's what you refer with "workflow output parameter = "My Type" object, workflow properly returns "My Type" object). In XaaS blueprint I selected "Provisioning Resource" == "My Type""

So honestly I do not see a reason why it should fail, provided that the dynamic type was successfully returned to the workflow.

I used the "old" plugin generator, Dynamic Types plug-in generator package - Samples - VMware {code}

Did you check the logs of vra (I assume there has to be an error on returning the result object)?

PS: maybe you first have to change your nickname to happyvra Smiley Wink

0 Kudos
unhappyvra
Enthusiast
Enthusiast

Thank you DanieleUlrich for sharing this info. I did exactly the same (almost - I used gen v2 plugin instead). In XaaS Custom Resources --> "Where used" section I could see my blueprint. XaaS blueprint workflow has output parameter with my dynamic type. Where do I need to look to check what object workflow returning to vRA? In vRO I could see my workflow's returning object.

Here is a screen of my Custom resources type - vRA got all properties defined in vRO dynamic type:

pastedImage_0.png

So I guess something is wrong with transferring object from vRO --> vRA. Any idea, which logs do I need to look? 

0 Kudos
DanieleUlrich
Enthusiast
Enthusiast

As you have debugged the return value of the workflow I would check the vra log first:

vra:/var/log/vcac/catalina.log

then in

vra:/var/log/vmware/vco/app-server/server.log

for vRO.

As I already pointed out, I used the old dynamic types plugin. v2 seems to be a 0.3 version, looks like very experimental?

The mapping you showed looks great, this should really work.

0 Kudos
unhappyvra
Enthusiast
Enthusiast

So, I finally found a solution and I'm very mad at VMware...

The key problem was using this code to return my Dynamic object to vRA:

var objects = Server.findAllForType("DynamicTypes:" + namespace + "." + typeName);

for each (var object in objects)

{

if ( object.name == vm_name )

{

  My_object = object;

  System.log(object.name);

  break;

}

}

Despite the fact that Server.findAllForType() really found my Dynamic objects and I got proper My_object, it wasn't recognized by vRA.

And actually I had to use this:

My_object = DynamicTypesManager.getObject(namespace, typeName, object.id);

So, to proper return Dynamic Type object to vRA you have to use DynamicTypesManager() class instead of well-known findAllForType().

If anybody know what is the difference here and why "findAllForType()" is not good to use - I'll be very thankful for this info!

0 Kudos
DanieleUlrich
Enthusiast
Enthusiast

In your loop you filter on the name whereas the finder method works with the ID.

Secondly, the scripting classes returned by Server.findAll or  DynamicTypesManager.getObject do not have to be the same.

But it's awesome that you have found the point in the flow where the object is not properly handed over.

What I do not understand: why do you loose control of your newly created dynamic type? Why do you have to do this lookup at all instead of holding the new instance in a variable or output param?

0 Kudos
unhappyvra
Enthusiast
Enthusiast

In your loop you filter on the name whereas the finder method works with the ID.

Hmm, I confused... findForAllTypes actually returned array of my objects, because in a loop I can do check "object.name == name". In debug I saw that it worked and handled "object" as I expected. If findForAllTypes had returned nothing, I would had a failed loop/check. In code you could see that I called DynamicTypesManager using my "object.id" returned by findForAllTypes/loop.

I just don't understand why array element from findForAllTypes != DynamicTypesManager (or why I should return to vRA DynamicTypesDynamicObjectProxy (as it does DynamicTypesManager.getObject() ) instead of just my dynamic type...).

Anyway, the key problem here - lack of documentation of how to work with Dynamic Types + vRA. Official documentation tells nothing about this complexity... How do I suppose to know this nuances?  I just wonder, how do they (VMware) think customers should do XaaS integration - by paying millions to PSO?

Please, tell me I'm wrong and VMware has tons of documents about it - I'll be happy to see them.

I'm not sure what do you meant by "loosing control" - vRA  blueprint calls vRO workflow to create object in REST API system, REST API returns to vRO newly created object, so I never even have control of this object... that's why I do a loop to re-read all DynamicTypes objects, identify new one and return it to vRA as a result.

0 Kudos
DanieleUlrich
Enthusiast
Enthusiast

REST API returns to vRO newly created object, so I never even have control of this object.

Could you please post a snippet how these calls look like?

If I create a new entity with a REST call, I have already the reference to the newly created object and do not have to ask the runtime system to hand it over (again).

The second problem (object type resp. class) could be the cause of the problems with returning the object to vRA. If vRA is expecting the DynamicType wrapper class, this will cause an class cast exception in Java it the return type is not an instance of the expected class. But yes, documentation can always be improved. Unfortunately I do not find the time do write a comprehensive documentation on my own components as well from time to time.

0 Kudos
unhappyvra
Enthusiast
Enthusiast

I guess I need to clarify this moment - in Dynamic Types plugin v2 is possible to tie REST API host and newly created Dynamic Type. So any time something new appears in REST Host (any new object created through API or system's GUI - doesn't matter), vRO automatically updates it own inventory. So, I do nothing to extract objects from REST API Host to vRO inventory. I just calls REST API against this host, very simple. That's why I don't have any control on this process (and don't have Dynamic Type object in my workflow), it is all vRO magic - for me. If you could explain it to me - I'll be very thankful!

0 Kudos
DanieleUlrich
Enthusiast
Enthusiast

OK, but I will come back to you later, I'm in Barcelona at VMworld and do not have the time to look into the plugin v2.

0 Kudos
unhappyvra
Enthusiast
Enthusiast

DanieleUlrich​ - any updates/thoughts? I'm still waiting a response from VMware support, could not believe that this is some kind of secret documents Smiley Happy 

robertgrignon
Contributor
Contributor

I am dealing with exactly the same issue. Any followup to this thread would be greatly appreciated...

0 Kudos
topuli
Enthusiast
Enthusiast

it seems as if everyone who works with dynamicTypes will read this sooner or later. i have checked unhappyvra´s statement and this looks like the right answer.if i use the findForType method my deployed item does NOT show up in VRA. if i use the DynamicTypesManager.getObject method the deployed item DOES show up in vra. for those who are new to DynamicTypes, you have to bind the result of the DynamicTypesManager.getObject method to an out variable that represents the DynamicTypes Type you use. The following is a scriptable task that sets outitem to the result of the DynamicTypesManager.getObject method. outitem represents the DynamicTypes Type testItem in the namespace test.

//testItem2= Server.findForType("DynamicTypes:test.testItem", "testFolder" + "/" + "testItem");
//System.log("testItem2 : " + testItem2);
//System.log("testItem2.id: " + testItem2.id);
testItem = DynamicTypesManager.getObject("test", "testItem", testItem.id); //testitem.id is the attribute id from the DynamicObjectProxy object returned by getObject
System.log("testItem.id: " + testItem.id);
item=testItem;
outItem=testItem;
//System.log ("testItem2 :" + testItem2);
System.log ("outItem :" + outItem);
System.log ("item :" + item);

finally a few links that helped me:

a good overview:   https://www.vcoteam.info/articles/learn-vco/281-enabling-vcloud-

a detailed implementation:   https://www.vcoteam.info/articles/learn-vco/323-how-to-create-a-microsoft-dns-dynamic-types-plug-in....

t.

0 Kudos