Here is the code, just change the attribute name to what your CA is and it will make the services for you and add VMs as they show up.  I run it once a month/week just to create new services if you add a new 'Business Unit' or 'Customer' etc...  From there, since it is a service it would be a lot easier to aggregate memory/cpu etc...  attributeName = "Business Unit";   ts = server.get("TopologyService");   def createOrUpdateObject(typeName, propertyValues) {
              def type = ts.getType(typeName);           objShell = ts.getObjectShell(type);           propertyValues.each ({propertyName, propertyValue ->                     def prop = type.getProperty(propertyName);                     if (!prop.isMany()) {
                                  objShell.set(prop, propertyValue);                     }                     else if (propertyValue instanceof Collection) {
                                  objShell.getList(prop).addAll(propertyValue);                     }                     else {
                                  objShell.getList(prop).add(propertyValue);                     }           });           return ts.mergeData(objShell); }     // Find all attribute X values values = [] as Set; vmType = ts.getType("VMWVirtualMachine"); vms = ts.getObjectsOfType(vmType);   vms.each { vm -> def custAtts = vm.get("customAttributes"); custAtts.each { ca->           caName = ca.get("name");           if(caName == attributeName)           {
                        caValue = ca.get("value").trim();                     if(caValue.length()>0)                     {
                                  values.add(caValue);                     }           } } }         // Create Services named value Y,Z,... attaching a DMC to each valSvcs = []; values.each { val->   // Create the service valSvc = createOrUpdateObject("FSMService", [name:attributeName + " "+val]);   // Create the DMC dmc = createOrUpdateObject("FSMDynamicManagedComponent",                     [name:val+" container", container:valSvc,                     componentQuery:"VMWVirtualMachine where customAttributes.name = '"+attributeName+"' and customAttributes.value = '"+val+"'",                     queryConditions:"customAttributes.name = '"+attributeName+"' and customAttributes.value = '"+val+"'",                     baseQuery:"/modules[fqId='system:virtualvmw']/queries[fqId='system:virtualvmw.581']"]);   //           Add the dynamic managed component to the service valSvc = createOrUpdateObject("FSMService", [name:attributeName + " "+val, definition:[dmc]]); valSvcs.add(valSvc); }     // Create Service named attribute X fsmAttService = createOrUpdateObject("FSMService", [name:(attributeName), definition:valSvcs]);   // Create Category fsmCategory = createOrUpdateObject("FSMCategory", [name:"Attributes", definition:[fsmAttService]]);
Hello,  We are using custom attributes on our vms for setting customer tag. I need to create a report with all clusters,the need is to know what is using by customer.  for example :    i know, ill need lots of request   I have the request get vm list for customer.  I'm working for the row table but i dont know how to handle the view ?   if someone have someting like that or can help, it will be a pleasure.   Thx  Davy,
Create custom report per cluster