Last active
August 29, 2015 14:07
-
-
Save upa/fd91ff40908b070b7173 to your computer and use it in GitHub Desktop.
sflow patch for neutron 2.3.4.83 openvswitch agent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# openvswitch sflow settings | |
[ovs] | |
sflow_port = 6343 | |
sflow_rate = 2048 | |
sflow_dstip = 10.0.0.10 | |
local_ip = 10.0.2.15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- ovs_lib.py.bak 2014-06-24 18:54:12.514194648 +0900 | |
+++ ovs_lib.py 2014-06-25 11:17:33.711783262 +0900 | |
@@ -127,6 +127,16 @@ | |
self.run_vsctl(['--', 'set-fail-mode', self.br_name, 'secure'], | |
check_error=True) | |
+ def set_sflow_config(self, dstip, portnum, rate): | |
+ | |
+ target = "target=\"%s:%d\"" % (dstip, portnum) | |
+ sampling = "sampling=%d" % rate | |
+ | |
+ self.run_vsctl(['--', '--id=@sflow', 'create', 'sflow', | |
+ target, sampling, 'polling=10', '--', 'set', | |
+ 'bridge', self.br_name, 'sflow=@sflow'], | |
+ check_error=True) | |
+ | |
def set_protocols(self, protocols): | |
self.run_vsctl(['--', 'set', 'bridge', self.br_name, | |
"protocols=%s" % protocols],% tomo:/Users/upa/work/src/c7d46e1a95d75d69c3de % |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- ovs_neutron_agent.py.bak 2014-06-24 18:45:42.410215468 +0900 | |
+++ ovs_neutron_agent.py 2014-06-25 11:16:29.307998341 +0900 | |
@@ -125,6 +125,7 @@ | |
polling_interval, tunnel_types=None, | |
veth_mtu=None, l2_population=False, | |
minimize_polling=False, | |
+ sflow_dstip = None, sflow_rate = 64, sflow_port = 6643, | |
ovsdb_monitor_respawn_interval=( | |
constants.DEFAULT_OVSDBMON_RESPAWN), | |
arp_responder=False): | |
@@ -214,6 +215,18 @@ | |
# Initialize iteration counter | |
self.iter_num = 0 | |
+ # Initialize sflow parameters | |
+ self.sflow_dstip = sflow_dstip | |
+ self.sflow_rate = int(sflow_rate) | |
+ self.sflow_port = int(sflow_port) | |
+ | |
+ LOG.warning(_("sflow config for int_br : %s %d %d" % | |
+ (self.sflow_dstip, self.sflow_rate, self.sflow_port))) | |
+ | |
+ if sflow_dstip : | |
+ self.int_br.set_sflow_config(self.sflow_dstip, self.sflow_port, | |
+ self.sflow_rate) | |
+ | |
def _check_arp_responder_support(self): | |
'''Check if OVS supports to modify ARP headers. | |
@@ -1467,6 +1480,9 @@ | |
veth_mtu=config.AGENT.veth_mtu, | |
l2_population=config.AGENT.l2_population, | |
arp_responder=config.AGENT.arp_responder, | |
+ sflow_port=config.OVS.sflow_port, | |
+ sflow_dstip=config.OVS.sflow_dstip, | |
+ sflow_rate=config.OVS.sflow_rate, | |
) | |
# If enable_tunneling is TRUE, set tunnel_type to default to GRE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment