[openstack-dev] [telemetry][ceilometer]Cannot get vmware virtual machine's disk usage rate via vsphere inspector
gord at live.ca
Thu Jun 29 12:58:52 UTC 2017
i'll be honest, i don't think any of the active developers on Ceilometer
uses or knows anything about vmware driver. you will probably want to
reach out to vmware themselves so they can provide support or fix the
driver (or ideally move the vmware driver to their own repo).
On 28/06/17 10:34 AM, Along Meng wrote:
> HI, all
> Today I try to add a new pollster plugin in ceilometer-agent-compute to
> collect vmware virtual machines's disk usage rate.
> After researched the vmware docs:
> I think I can call the vsphere inspector get the
> counter capacity.provisioned and capacity.usage.
> Then I can get the virtual machine's disk usage rate via: disk_util
> = capacity.usage/capacity.provisioned
> *But, when I add a new function in vsphere inspector like below, It
> cannot get any data from vcenter:*
> My example code like this:
> def inspect_disks(self, instance, duration=None):
> vm_moid = self._ops.get_vm_moid(instance.id <http://instance.id/>)
> if not vm_moid:
> raise virt_inspector.InstanceNotFoundException(
> _('VM %s not found in VMware vSphere') % instance.id
> VC_DISK_PROVISIONED_CNTR = "disk:capacity.provisioned:average"
> disk_counter_id =
> disk_infos = self._ops.query_vm_aggregate_stats(vm_moid,
> mem_counter_id, duration)
> print “The disk info is:%s” % disk_infos
> The disk_infos is empty.
> I try to use these functions to query the counter value:
> self._ops.query_vm_device_stats(vm_moid, disk_counter_id, duration)
> self._ops.query_vm_aggregate_stats(vm_moid, mem_counter_id, duration)
> *But cannot get any data from vcenter, and I'm sure the vcenter service
> is correct in my env.*
> *Does anyone know what's wrong with my code? *
> *Or is there any other solutions for my requirement.*
More information about the OpenStack-dev