Collect quotas details for each tenant

Im trying to create an automation script that for each execution will collect quotas details for each tenant in a specific provider and than will save it into a csv.

I was able to iterate through the tenants and was able to extract their defined quotas values.

  1. Any Ideas about how can I get the value of the used resource for each defined quota?
  2. Any ideas about how to save the data to a csv file that will be updated on each execution?
  3. Thoughts of the best way to execute this automation? schedule? event? a button?



There should be a “used” association for each quota object that you can access.


tenant = $evm.vmdb(:cloud_tenant).find_by_name("tenant1")
quotas = tenant.cloud_resource_quotas
quotas.each {|quota| puts "used " << quota.used << " of " << quota.value }

@jockey10 Thank you! btw where can I find a documentation for these kind of stuff? association/attributes for specific objects?

ideas about #2 and #3?

#2 I’ve never used it, but there seems to be quite a good CSV Gem: (you’d need to install this to your appliance first).

#3 This depends whether you wanted it updated automatically on a schedule, or manually. A button on the provider is probably the simplest if you’re happy to manually trigger this.

Many of the methods are documented here:, but you might also want to checkout the “Investigative Debugging” chapter here: (I also presented a session on this at the ManageIQ Summit, video here:

Hope this helps,

@pemcg wow that’s a great help! Great book! thank you!