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 :
Cluster list
Cluster 1
total memory
number cpu
customer 1
total memory for this customer
total cpu for this customer
customer 2
total memory for this customer
total cpu for this customer
Cluster 2
total memory
number cpu
customer 1
total memory for this customer
total cpu for this customer
customer 2
total memory for this customer
total cpu for this customer
…
…
…
…
…
…
…
…
…
…
…
…
…
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.
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...
What would probably be the easiest way off the top of my head is to build a function/query that will grab all of the VMs and then count the custom attributes(CA) for each type (which is customer name in this case) and then from that list/count of VMs to get your resources utilizations or core/memory allocated counts.
The alternative to that would be to build an array/map file that goes and does all of the work once and then use that to generate the table. I'd say it's half a day of PSO or so either way.
How many VMs do you have in this environment and do you want this to be more of a report or a dashboard? The reason I ask is if there are a lot of VMs it could take awhile to query this and we might be best served with a batch query to get what we need in one chunk and/or use a hash map.
It would take a bit of coding, but what might be easier is I have a script that will take all the custom attributes for a type (Say a CA called 'Customer Name) and then build a services from that list. You could then take that and build your views from services.
DELL-Thomas B
171 Posts
1125
0
Posted September 12th, 2013 17:00
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...