VMware Cloud Community
ericr999
Enthusiast
Enthusiast

Configuration Element of CompositeType

Hello all,

How does everyone goes one with this kind of issue ? At first it seemed a good idea to create a CE with an Array of CompositeType, and the fields are normally strings.

But I'm not at a point that I have to add more and more stuff to these CE, and sometimes update a bunch of them... Via the GUI is not pratical, via an export there's also chances of errors.

At one point I thought maybe I should think about another way maybe store this in the code of an action ?

Here's what my CE looks like:

pastedImage_0.png

So at one point in some of my workflows, I bind that CE in my workflow, go through it with some basic values like the OS and environnement, and I would get the folder and the site to use for our Monitoring system. But this has come a lot harder to maintain because I have so many possibilities. This one can be quite simple but from time to time, the people managing the monitoring system could ask me to use a different site for a specific environnement. But yes, I agree that right now, by the look of this, I could probably simplify this.

6 Replies
parmarr
VMware Employee
VMware Employee

There were already similar therads answered, please refer: https://communities.vmware.com/message/2633797#2633797

https://communities.vmware.com/message/2388538#2388538

Sincerely, Rahul Parmar VMware Support Moderator
0 Kudos
ericr999
Enthusiast
Enthusiast

parmarr, its funny, the first post was a older post of mine. Illian, gave me a good answer, but what I'm trying to see now, is to edit an Array of CompositeType. If I want to update only 1 field in the array. Right now I have to delete the line, re-add it, and if I want to have a neat array, I have to move the line around to make it readable, otherwise it will sit at the bottom as the last inserted element.

So I haven't found a way to manage huge arrays of compositetype, or even huge arrays of string in a CE. But yes, I could add one and delete the old one.

And the second link, its a cool info, but it doesn't help to do a inplace replace if I can say.

But ultimately, my question, is am I doing the right thing ? Or should I consider an alternative ? I mean, is it a good way of storing that amount of info that I have to update from time to time ? And add more stuff to it, and with time I fear that it will be harder to manage. I was thinking of maybe storing that huge arrat into a scriptable task or an action maybe ?

What's your use cases of CE and when you use them and when you use something else ?

Thanks!

0 Kudos
ericr999
Enthusiast
Enthusiast

I was thinking about this issue yesterday, I thought that I could maybe uses the Vmware Tags. Would it be a good idea ?

All I want to do is Tag objects like VM Folder, Ressources Pool, Datastore Clusters, vCenter, So lets take a VM Folder:

VMFolders would have Tags such as:

  • Site
  • zone

Other objects like Datastore Clusters:

  • Site
  • Zone
  • Disk Service Level (like Bronze or Silver, etc...)

And then I would have an action that would go through all vCenters, find the needed objets that fits the requested values, if I find more than one, I could potentaly return an error.

I've never used Tags before, and from what I read, it seems to be doing exactly that, and I can't see a reason not to use them.

0 Kudos
iiliev
VMware Employee
VMware Employee

Yes, tags should work. The only "problem" is that there are several different ways to work with tags in vRO Smiley Happy

  • via PowerShell plug-in
  • via vAPI plug-in
  • via REST plug-in
  • maybe via vCenter plug-in (tags weren't available in plug-in versions before 7.3, and I'm not sure VcTag-related stuff I see in 7.3 API Explorer is the same thing as vSphere 6 tags)

Also, there is Tagging plug-in by Christophe Decanini, available at https://code.vmware.com/samples?id=1437

0 Kudos
ericr999
Enthusiast
Enthusiast

I would like to use them with the vCenter plugin, because in the end, I will then pass that returned value to another workflow that will start the cloning process or vm creation process depending on the os type.

And I'm using 7.3, so I guess I should be good then! Smiley Happy Yay!

I'm happy because I won't have to manually update the list of items.

0 Kudos
iiliev
VMware Employee
VMware Employee

OK, try with vCenter plug-in, and please report back if what the vCenter plug-in 7.3 exposes in the scripting are the "real" tags. For example, if you tag some object using vCenter plug-in scripting API, are the newly added tags/values visible in the vSphere Web Client UI views for the same object?