<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Arial",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link="#0563C1" vlink="#954F72"><div class=WordSection1><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;background:white'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New";color:#333333'>I want to use Neutron Meter with gnocchi to report the egress bandwidth used for public traffic.<br>So I created neutron meter labels and neutron meter rules to include all ipv4 traffic:<br>+-------------------+----------------------------------------------------------------------------------------------------+<br>| Field | Value |<br>+-------------------+----------------------------------------------------------------------------------------------------+<br>| direction | egress |<br>| id | f2c9b9a8-0af3-40a5-a718-6e841bad111d |<br>| is_excluded | False |<br>| location | cloud='', project.domain_id='default', project.domain_name=, |<br>| | project.id='80120067cd7949908e44dce45aeb7712', project.name='billing', region_name='xxx', |<br>| | zone= |<br>| metering_label_id | d0068fc8-4a3e-4108-aa11-e3c171d4d1e1 |<br>| name | None |<br>| project_id | None |<br>| remote_ip_prefix | 0.0.0.0/0 |<br>+-------------------+----------------------------------------------------------------------------------------------------+<o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;background:white;max-width: 45em;font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial;text-decoration-color: initial;word-spacing:0px' id="yui_3_10_3_1_1581587135729_2462"><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New";color:#333333'>And excluded all private nets:<br>+-------------------+----------------------------------------------------------------------------------------------------+<br>| Field | Value |<br>+-------------------+----------------------------------------------------------------------------------------------------+<br>| direction | egress |<br>| id | 838c9631-665b-42b6-b1e9-539983a38573 |<br>| is_excluded | True |<br>| location | cloud='', project.domain_id='default', project.domain_name=, |<br>| | project.id='80120067cd7949908e44dce45aeb7712', project.name='billing', region_name='xxx', |<br>| | zone= |<br>| metering_label_id | 435652e6-e985-4351-a31a-954bace9eea0 |<br>| name | None |<br>| project_id | None |<br>| remote_ip_prefix | 10.0.0.0/8 |<br>+-------------------+----------------------------------------------------------------------------------------------------+<o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;background:white;max-width: 45em;font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial;text-decoration-color: initial;word-spacing:0px'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New";color:#333333'>It works fine for just one project but if I apply it to all projects it fails and no measures are recorded in gnocchi.<o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;background:white;max-width: 45em;font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial;text-decoration-color: initial;word-spacing:0px'><span style='font-size:9.0pt;font-family:"Courier New";color:#333333'>The neutron-metering-agent.log shows the following warning:<br>Feb 13 09:14:18 xxx_host neutron-metering-agent: 2020-02-13 09:14:09.648 4732 WARNING neutron.agent.linux.iptables_manager [req-4c38f1f5-2db4-4d4a-9c1f-9585b1b50427 65c6d4bdcbc7469a910f6361b7f70f27 80120067cd7949908e44dce45aeb7712 - - -] Duplicate iptables rule detected. </span><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New";color:#333333'>This may indicate a bug in the iptables rule generation code. Line: -A neutron-meter-r-28155d45-d16 -s 10.0.0.0/8 -o qg-c61bafef-ea -j RETURN<o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;background:white;max-width: 45em;font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial;text-decoration-color: initial;word-spacing:0px'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New";color:#333333'>I would expect that it is possible to have similar rules for different projects.<o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;background:white;max-width: 45em;font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial;text-decoration-color: initial;word-spacing:0px'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New";color:#333333'>What do you think? Is it part of the rule creation code?<o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;background:white;max-width: 45em;font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial;text-decoration-color: initial;word-spacing:0px' id="yui_3_10_3_1_1581587135729_2792"><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New";color:#333333'>In the iptables_manager code the function is criticized:<br></span><span style='font-size:9.0pt;font-family:"Courier New";color:#333333'><a href="https://github.com/openstack/neutron/blob/86e4f141159072421a19080455caba1b0efef776/neutron/agent/linux/iptables_manager.py"><span lang=EN-US style='color:#0033AA'>https://github.com/openstack/neutron/blob/86e4f141159072421a19080455caba1b0efef776/neutron/agent/linux/iptables_manager.py</span></a></span><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New";color:#333333'><br># TODO(kevinbenton): remove this function and the next one. They are<br>        # just oversized brooms to sweep bugs under the rug!!! We generate the<br>        # rules and we shouldn't be generating duplicates.<br>        def _weed_out_duplicates(line):<br>            if line in seen_lines:<br>                thing = 'chain' if line.startswith(':') else 'rule'<br>                LOG.warning("Duplicate iptables %(thing)s detected. This "<br>                            "may indicate a bug in the iptables "<br>                            "%(thing)s generation code. Line: %(line)s",<br>                            {'thing': thing, 'line': line})<br>                return False<br>            seen_lines.add(line)<br>            # Leave it alone<br>            return True<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><a href="https://bugs.launchpad.net/neutron/+bug/1863068"><span lang=EN-US>https://bugs.launchpad.net/neutron/+bug/1863068</span></a><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph;line-height:120%;text-autospace:none'><span lang=EN-US style='font-size:10.0pt;line-height:120%;font-family:"Arial",sans-serif;color:black;letter-spacing:.05pt'>Merlin Blom<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>