VMware Cloud Community
urbanenomad
Contributor
Contributor

vCAC and vCOP common UUID for resource

I have access to data from vCAC through plugins with vCOrchestrator and I see some UUIDs identifying resources such as a VM.  I also am using the Beta vCOperations Manager to get stats for the different VM resources.  But for some reason the resourceID that I use for vCOp is not matching to vCAC Entity instances.  Is there a common UUID that is used in both vCAC and vCOp if so what is that field name in vCAC?  So far the only common identifier is the VM name but that may not be unique when we start segregating by business units.

0 Kudos
6 Replies
admin
Immortal
Immortal

Hi,

You could try using morefs if you have a VCenter deployment.

Those can be found as "ExternalReferenceId" in vCAC, which in terms corresponds to vCOps Resource.Identifiers - key= "VMEntityObjectID"

A bit complex but that's where vCAC meets vCOps for vCenter at the moment from my experience with the products.

Tell us how it went.

Best regards,

Leni Kirilov

0 Kudos
qc4vmware
Virtuoso
Virtuoso

We can use the morefs if we also have the vCenter it belongs to.  Eventually we will have more than one vCenter in this vCOPS installation so we might encounter duplicate morefs.  If we also know the vCenter based on the vCOPS tracking of the vm then the lookup should be easy and accurate.  It would be nice if they also included the vCenter vm's uuid in addition to the moref (the vCAC:VirtualMachines have this property).  I could do something janky like search each vCenter for the moref then check to make sure the names match.

0 Kudos
ggochkov
VMware Employee
VMware Employee

Hi,

1. If your exact use case is to have stats for  a Vitual machine provisioned by vCAC I think this is pretty easy:

Just create your Get-vCops-stats(param VC:VirtualMachine) workflow in vCOrchestrator and define a vCAC resource action for it. Then just execute this resource action as a Day2 operation on a vCAC Virtual machine item. Inside Get-vCops-stats workflow just call the VCops API for the moref and VChost you get from the VC:VirtualMachine.id. In fact VC:VirtualMachine.id is a string like <VCHost>/MoRef.

2. If your case is: Get some stats using vCo workflow calling VCops API and update the VM on vCAC side.

Then you could use what Leni Kirilov said above: to get vCOps Resource.Identifiers - key= "VMEntityObjectID" from stats and find the vCAC VM item by "ExternalReferenceId" (using vCould automation center API)

0 Kudos
qc4vmware
Virtuoso
Virtuoso

Our specific use case is we are gathering a bunch of stats from the vCOPS api (outside of vCO) and also gathering a bunch of stats from a vCO workflow which is churning through information from the vCACCAFE plugin.  We are trying to link the vCACCAFE:CatalogResource to the vCOPS information by way of the VC:VirtualMachine. 

We can use the vm moref like was suggested it just doesn't seem like an accurate way of doing this.  vCOPS must also be accounting for the individual vCenter each vm resides in but not exposing that in the rest call we are making.  vCAC:VirtualMachines have a reference to the vm's uuid which I can lookup with the vCenter sdk.  I'd prefer to use that as my reference but like I said we can probably get by using the moref.

0 Kudos
qc4vmware
Virtuoso
Virtuoso

After playing with the api today I see that the vCenter ID is also tracked.  I missed that somehow.  Running this command:

curl -X POST -b ./tmpcookie --user admin http://myserver/HttpPostAdapter/OpenAPIServlet -d "action=lookupResource&resourceName="myresource"" -k

Yielded this response:

resourceName=myresource&adapterKindKey=VMWARE&resourceKindKey=VirtualMachine&identifiers=VMEntityName::myresource::false$$VMEntityObjectID::vm-123$$VMEntityVCID::OURUNIQUEID

So it looks like VMEntityObjectID + VMEntityVCID is what I need to make a unique match.  Now we can confidently link these items together.

0 Kudos
Monberg
Enthusiast
Enthusiast

When you are ready for vR Ops 6 you can use the REST API found at https://vrops-url/suite-api

It's a small website with code examples and full documentation. You can even invoke the API straight from your browser!

Start with this for example: https://vrops-url/suite-api/api/resources?name=something

Regards,

Michael

0 Kudos