The ceilometer.compute.virt.vmware.vsphere_operations Module

The ceilometer.compute.virt.vmware.vsphere_operations Module

class ceilometer.compute.virt.vmware.vsphere_operations.VsphereOperations(api_session, max_objects)[source]

Bases: object

Class to invoke vSphere APIs calls.

vSphere APIs calls are required by various pollsters, collecting data from VMware infrastructure.

get_perf_counter_id(counter_full_name)[source]

Method returns the ID of VC performance counter by its full name.

A VC performance counter is uniquely identified by the tuple {‘Group Name’, ‘Counter Name’, ‘Rollup Type’}. It will have an id - counter ID (changes from one VC to another), which is required to query performance stats from that VC. This method returns the ID for a counter, assuming ‘CounterFullName’ => ‘Group Name:CounterName:RollupType’.

get_vm_mobj(vm_instance_id)[source]

Method returns VC mobj of the VM by its NOVA instance ID.

query_vm_aggregate_stats(vm_mobj, counter_id, duration)[source]

Method queries the aggregated real-time stat value for a VM.

This method should be used for aggregate counters.

Parameters:
  • vm_mobj – managed object of the VM
  • counter_id – id of the perf counter in VC
  • duration – in seconds from current time, over which the stat value was applicable
Returns:

the aggregated stats value for the counter

query_vm_device_stats(vm_mobj, counter_id, duration)[source]

Method queries the real-time stat values for a VM, for all devices.

This method should be used for device(non-aggregate) counters.

Parameters:
  • vm_mobj – managed object of the VM
  • counter_id – id of the perf counter in VC
  • duration – in seconds from current time, over which the stat value was applicable
Returns:

a map containing the stat values keyed by the device ID/name

query_vm_property(vm_mobj, property_name)[source]

Method returns the value of specified property for a VM.

Parameters:
  • vm_mobj – managed object of the VM whose property is to be queried
  • property_name – path of the property
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.