Given a a uuid of a vm, is there an easy way to find its datacenter?
I managed to figure out this piece of code seems to do the trick but it seems rather circular (find all datacenters then look through each one, filtering by itself, looking for the vm?) Is this the way to do it or is there something better?
var dcs=VcPlugin.getAllDatacenters();
for each (dc in dcs)
{
temp = dc.sdkConnection.searchIndex.findAllByUuid(dc, vmUuid, true);
if (temp == null)
System.log("not found");
else
System.log("found vm in dc: "+dc.name);
}