No information from Neutron Metering agent

Bug #1506567 reported by Sergey Kolekonov on 2015-10-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
High
Brian Haley

Bug Description

I deployed OpenStack cloud with stable/kilo code - a controller/network node and a compute node (Ubuntu 14.04). I have Metering agent enabled and configured as follows:
driver = neutron.services.metering.drivers.iptables.iptables_driver.IptablesMeteringDriver
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver

When I try to check information from it in Ceilometer, I always get zero. e.x.:

root@node-1:~# ceilometer sample-list -m bandwidth -l10
+--------------------------------------+-----------+-------+--------+------+----------------------------+
| Resource ID | Name | Type | Volume | Unit | Timestamp |
+--------------------------------------+-----------+-------+--------+------+----------------------------+
| 66fab4a9-aefe-4534-b8a3-b0c0db9edf82 | bandwidth | delta | 0.0 | B | 2015-10-15T16:55:26.766000 |

Is it expected? I spawned two VMs and tried to pass some traffic between them using iperf, but still no results

Cedric Brandily (cbrandily) wrote :

Did you configure meters using neutron meter-label-create and neutron meter-label-rule-create?

Changed in neutron:
status: New → Incomplete
Sergey Kolekonov (skolekonov) wrote :

Yes, I did. For egress/ingress and 0.0.0.0/32 CIDR

Ryan Moats (rmoats) wrote :

0.0.0.0/32 looks a little suspicious to me - did you try specifying the actual VM instance IPs in the rules?

tags: added: metering
Launchpad Janitor (janitor) wrote :

[Expired for neutron because there has been no activity for 60 days.]

Changed in neutron:
status: Incomplete → Expired
Shang-Yi Chuang (i-simon-f) wrote :

I have the same issue when i enabled DVR.
I ended up installed neutron-metering-agent on compute nodes and patch neutron/services/metering/drivers/iptables/iptables_driver.py

+++ iptables_driver.py 2015-12-29 08:32:17.788539773 +0000
@@ -35,6 +35,8 @@
 RULE = '-r-'
 LABEL = '-l-'

+ROUTER_2_FIP_DEV_PREFIX = 'rfp-'
+
 config.register_interface_driver_opts_helper(cfg.CONF)
 config.register_use_namespaces_opts_helper(cfg.CONF)
 cfg.CONF.register_opts(interface.OPTS)
@@ -129,12 +131,12 @@
             del self.routers[router_id]

     def get_external_device_name(self, port_id):
- return (EXTERNAL_DEV_PREFIX + port_id)[:self.driver.DEV_NAME_LEN]
+ return (ROUTER_2_FIP_DEV_PREFIX + port_id)[:self.driver.DEV_NAME_LEN]

     def _process_metering_label_rules(self, rm, rules, label_chain,
                                       rules_chain):
         im = rm.iptables_manager
- ext_dev = self.get_external_device_name(rm.router['gw_port_id'])
+ ext_dev = self.get_external_device_name(rm.router['id'])
         if not ext_dev:
             return

It looks like a DVR issue when using metering? It's worth looking triaging this one again.

Changed in neutron:
status: Expired → New
tags: added: l3-dvr-backlog

Shang-Yi Chuang is metering just required to monitor on the 'rfp' interface or also on the 'qg' and 'fg' interfaces.
If it is VM to VM traffic (East-West) then you can monitor everything from the 'rfp-' interface.
Is it also required to monitor the external traffic through the 'qg' and 'fg' interface.

Changed in neutron:
status: New → Confirmed

Fix proposed to branch: master
Review: https://review.openstack.org/377108

Changed in neutron:
assignee: nobody → Swaminathan Vasudevan (swaminathan-vasudevan)
status: Confirmed → In Progress
Changed in neutron:
importance: Undecided → High
Changed in neutron:
assignee: Swaminathan Vasudevan (swaminathan-vasudevan) → Brian Haley (brian-haley)
Changed in neutron:
assignee: Brian Haley (brian-haley) → Swaminathan Vasudevan (swaminathan-vasudevan)
Changed in neutron:
assignee: Swaminathan Vasudevan (swaminathan-vasudevan) → Brian Haley (brian-haley)
Changed in neutron:
milestone: none → ocata-3

Reviewed: https://review.openstack.org/377108
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=ec6ed98cfaca455a663c0e6909b7faeb703a349e
Submitter: Jenkins
Branch: master

commit ec6ed98cfaca455a663c0e6909b7faeb703a349e
Author: Swaminathan Vasudevan <email address hidden>
Date: Mon Sep 26 14:08:50 2016 -0700

    DVR: Fix IPtables driver for metering with DVR routers

    IPTables driver for metering was not handling the DVR router
    namespaces properly for configuring the metering forward rules.

    This patch addresses the issue by configuring the iptables
    manager based on the availability of the namespace and selecting
    the respective namespaces such as router namespace and snat
    namespace with the right external device.

    Change-Id: I6790d6ff42d9f8fa220e1a231ae94cbf8b60506c
    Closes-Bug: #1506567

Changed in neutron:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/423557
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=f7ba749b9b3c25e082c534bec514d539c35346b1
Submitter: Jenkins
Branch: stable/newton

commit f7ba749b9b3c25e082c534bec514d539c35346b1
Author: Swaminathan Vasudevan <email address hidden>
Date: Mon Sep 26 14:08:50 2016 -0700

    DVR: Fix IPtables driver for metering with DVR routers

    IPTables driver for metering was not handling the DVR router
    namespaces properly for configuring the metering forward rules.

    This patch addresses the issue by configuring the iptables
    manager based on the availability of the namespace and selecting
    the respective namespaces such as router namespace and snat
    namespace with the right external device.

    Closes-Bug: #1506567
    (cherry picked from commit ec6ed98cfaca455a663c0e6909b7faeb703a349e)

    Conflicts:
     neutron/db/metering/metering_db.py
     neutron/services/metering/drivers/iptables/iptables_driver.py

    Change-Id: I6790d6ff42d9f8fa220e1a231ae94cbf8b60506c

tags: added: in-stable-newton

Reviewed: https://review.openstack.org/424285
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=ffcd24a3a8fdaa050e3b8f14d30d623e10aee399
Submitter: Jenkins
Branch: stable/mitaka

commit ffcd24a3a8fdaa050e3b8f14d30d623e10aee399
Author: Swaminathan Vasudevan <email address hidden>
Date: Mon Sep 26 14:08:50 2016 -0700

    DVR: Fix IPtables driver for metering with DVR routers

    IPTables driver for metering was not handling the DVR router
    namespaces properly for configuring the metering forward rules.

    This patch addresses the issue by configuring the iptables
    manager based on the availability of the namespace and selecting
    the respective namespaces such as router namespace and snat
    namespace with the right external device.

    Closes-Bug: #1506567
    (cherry picked from commit ec6ed98cfaca455a663c0e6909b7faeb703a349e)

    Conflicts:
     neutron/db/metering/metering_db.py
     neutron/services/metering/drivers/iptables/iptables_driver.py

    Change-Id: I6790d6ff42d9f8fa220e1a231ae94cbf8b60506c

tags: added: in-stable-mitaka

This issue was fixed in the openstack/neutron 10.0.0.0b3 development milestone.

tags: added: neutron-proactive-backport-potential

This issue was fixed in the openstack/neutron 9.3.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers