Add network usage counter support for libvirt

Registered by Phil Day

Currently only the xen virt driver supports the generation of network bandwidth usage data.

This blueprint will add comparible libvirt functionality based on IPtables

Blueprint information

Status:
Complete
Approver:
Russell Bryant
Priority:
High
Drafter:
Phil Day
Direction:
Approved
Assignee:
Phil Day
Definition:
Superseded
Series goal:
None
Implementation:
Deferred
Milestone target:
None
Completed by
Russell Bryant

Related branches

Sprints

Whiteboard

I discussed this with Phil Day and it seems that this has been dropped in favor of other efforts. --russellb

The IPtables based approach mainatins an instance specifiic billing chain. Rules can be configured within the chain for specific subnets, enabling some traficr to be excluded from the totals.

Currently the virt driver only exposes a single method for updating the bw_usage_cache table, and as in the xen driver the data is maintianed in the hypervisor no specific processing is required for vm creation/deletion.

With IPtables some work is required to create and remove the billing chains. We will encapulate this in the libvirt driver.

Recongnising that not every libvirt user will want to use this approch to billing, we will implement a configurable driver within libvirt which is called on vm creation and deletion, and from the get_all_bw_usage method.

Implementation will be in two stages:

1) Add support for a configurable driver to libvirt (so that alternative implemenations can be supported), and provide a default NoOp driver to match the existing functionality

2) Add an IPtables based driver that can collect counter values and providd filtering on specific subnets

Gerrit topic: https://review.openstack.org/#q,topic:bp/libvirt-network-usage,n,z

Addressed by: https://review.openstack.org/11300
    Change IPtablesManager to preserve packet:byte counts.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.