I need to create a report of datastore capacity, provision and usage. What is the best tool to do that? Vcenter API seems more concerned with creating VMs and such.

Is this the right tool for the job?


The VMware SDK offers very many complex ways to assess you VMware/vSphere server. If you know Perl, have a look at the munin plugin for VMware. Around line 308 you can see that the datastore performance data (how much is used, committed, unshared) per VM is read out. In the loop above that, the metrics per datastore are acquired. With a little modification of the @all_graphs section (line 393ff.) you should be able to create the report you need.

Essentially, the SDK provides a superset of the information found at https://vSpherehost/mob/?moid=ha-host.

Of course, you could also set up a munin server&node and have the datastore usage monitored in real time.

One thing you should be aware of: running the SDK on a free licence of vSphere will only give you read-only access, which also means that the datastore metrics are not updated unless you manually hit refresh in the vSphere Client.

| improve this answer | |
  • One thing to keep in mind is that the Perl VMware SDK is not redistributable. See Redistribution Information. So if you intend to ship your code to others, they'll have to install the Perl VMware SDK themselves. The Java SDK has no such limitation (see same link). – Peter V. Mørch Jul 3 '14 at 5:36

A good starting point would be using a Reporting Tool like Icinga or Nagios. It is a great tool for monitoring your environment, anyway, even though setting it up properly takes quite some time for larger environments.

Icinga offers advanced reporting functions which can be very useful for your task. Use the esx plugin for icinga. It works using the VMware vSphere Perl SDK and measures almost any Data you like.

You could even try using the plugin on its own, since it is simply a perl script depending on the VMware vSphere Perl SDK. Do this if you want to do a simple one-time report.

If I had to do that task, I'd use Icinga + Icinga-web + pnp4nagios + jasperreports-server + nagiosql. nagvis is a nice extra, since I'd be at it, anyway.

It works by gathering performance data on every check, which is later used by the jasperreports-server to create a full report on the data. You will have to plan it out beforehand all the way or you will end up with a messy configuration that works as reliable as a taped up fairy lights in the rain.

Also it's not worth doing such a setup if you didn't plan on setting up a proper monitoring system, anyway.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.