[openstack-dev] [metering] question about pollster counters

John Tran njhtran at gmail.com
Thu Aug 16 22:26:31 UTC 2012


I'm working on pollsters for networking - The storage data that I'd be
sending to collector are about each instance's vnic(s).  Therefore,
should the storage data (Collector obj) be about the instance metadata
or should it be about the virtual_interface metadata?  The instance db
obj is originally passed to the pollster therefore I can get the
metadata and other db associated values easily for it.  The vnic data
is obtained from libvirt xml response, therefore contains none of the
unique id info from the db.

Referring to the storage section of
http://wiki.openstack.org/EfficientMetering, here are the columns:

* Source - left as '?'
* user_id - obtained by looking at the instance's db obj
* project_id - same as user_id
* resource_id - <unique_id of the vnic?>   ** the vnic xml data
freturned from libvirt has a filtterref that looks like: <filterref
filter='nova-instance-instance-00000001-fa163e71ec6d'>

* resource_metadata -  < for instance db obj or for vnic xml data> ?
* meter_type - 'cumulative'    ** what are the other options ?
* meter_volume - <value of the meter>
* meter_duration - <time value>

Here's am example libvirt xml data returned for vnic:

    <interface type='bridge'>
      <mac address='fa:16:3e:71:ec:6d'/>
      <source bridge='br100'/>
      <target dev='vnet0'/>
      <filterref filter='nova-instance-instance-00000001-fa163e71ec6d'>
        <parameter name='DHCPSERVER' value='10.0.0.1'/>
        <parameter name='IP' value='10.0.0.2'/>
        <parameter name='PROJMASK' value='255.255.255.0'/>
        <parameter name='PROJNET' value='10.0.0.0'/>
      </filterref>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
    </interface>

To make a long question short, what do I use for the resource_id and
resource_metadata when recording storage for a net pollster meter?



More information about the OpenStack-dev mailing list