]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Adds OVS_HYBRID_PLUG flag to portbindings
authorKevin Benton <blak111@gmail.com>
Thu, 27 Mar 2014 02:40:12 +0000 (02:40 +0000)
committerKevin Benton <blak111@gmail.com>
Thu, 27 Mar 2014 06:41:19 +0000 (23:41 -0700)
Adds a flag to the ML2, openvswitch, and BigSwitch
plugins to inform nova that the OVS hybrid plugging
strategy should be used.

Closes-Bug: #1112912
Change-Id: If004db60e084f4cea095ca9ecccb0537240d4183

neutron/extensions/portbindings.py
neutron/plugins/bigswitch/plugin.py
neutron/plugins/ml2/drivers/mech_ofagent.py
neutron/plugins/ml2/drivers/mech_openvswitch.py
neutron/plugins/nec/nec_plugin.py
neutron/plugins/openvswitch/ovs_neutron_plugin.py
neutron/plugins/ryu/ryu_neutron_plugin.py

index acf0efcd25917a68bc28ecf76bb51fb861683416..002c9f2a1710722a8fb9836b317a1784ac77aaab 100644 (file)
@@ -43,7 +43,10 @@ PROFILE = 'binding:profile'
 #
 #  - port_filter : Boolean value indicating Neutron provides port filtering
 #                  features such as security group and anti MAC/IP spoofing
+#  - ovs_hybrid_plug: Boolean used to inform Nova that the hybrid plugging
+#                     strategy for OVS should be used
 CAP_PORT_FILTER = 'port_filter'
+OVS_HYBRID_PLUG = 'ovs_hybrid_plug'
 
 VIF_TYPE_UNBOUND = 'unbound'
 VIF_TYPE_BINDING_FAILED = 'binding_failed'
index 444fa7b285d3c9d8909c368beb931c56d81e17fe..833fcea170a89bea8798c098bf8b8bc252c89353 100644 (file)
@@ -374,7 +374,9 @@ class NeutronRestProxyV2Base(db_base_plugin_v2.NeutronDbPluginV2,
         port[portbindings.VIF_DETAILS] = {
             # TODO(rkukura): Replace with new VIF security details
             portbindings.CAP_PORT_FILTER:
-            'security-group' in self.supported_extension_aliases}
+            'security-group' in self.supported_extension_aliases,
+            portbindings.OVS_HYBRID_PLUG: True
+        }
         return port
 
     def _check_hostvif_override(self, hostid):
index 3d3909b0148a1692fdf6d054289dada629cca61e..b593e61d6bb82c25948f5ec1de394228b722ec10 100644 (file)
@@ -41,7 +41,8 @@ class OfagentMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
         super(OfagentMechanismDriver, self).__init__(
             constants.AGENT_TYPE_OFA,
             portbindings.VIF_TYPE_OVS,
-            {portbindings.CAP_PORT_FILTER: True})
+            {portbindings.CAP_PORT_FILTER: True,
+             portbindings.OVS_HYBRID_PLUG: True})
 
     def check_segment_for_agent(self, segment, agent):
         mappings = agent['configurations'].get('bridge_mappings', {})
index b070bb9e7c9be310eccd9f746ef170ad593a5f1e..0565b97301669c879315d6a8799e0268b90cfa07 100644 (file)
@@ -36,7 +36,8 @@ class OpenvswitchMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
         super(OpenvswitchMechanismDriver, self).__init__(
             constants.AGENT_TYPE_OVS,
             portbindings.VIF_TYPE_OVS,
-            {portbindings.CAP_PORT_FILTER: True})
+            {portbindings.CAP_PORT_FILTER: True,
+             portbindings.OVS_HYBRID_PLUG: True})
 
     def check_segment_for_agent(self, segment, agent):
         mappings = agent['configurations'].get('bridge_mappings', {})
index 811250ca17f8542342712d807cf7bbea96fd5b78..2fe59d01a6ec43a9cb0e75802c6d4579d36549a5 100644 (file)
@@ -401,7 +401,10 @@ class NECPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
             portbindings.VIF_DETAILS: {
                 # TODO(rkukura): Replace with new VIF security details
                 portbindings.CAP_PORT_FILTER:
-                'security-group' in self.supported_extension_aliases}}
+                'security-group' in self.supported_extension_aliases,
+                portbindings.OVS_HYBRID_PLUG: True
+            }
+        }
         return binding
 
     def _extend_port_dict_binding_portinfo(self, port_res, portinfo):
index ec23da0870bc8a7bb19c34308bde348ad66fcc24..2cfe2674b60670d17a8e940e2208caca81721427 100644 (file)
@@ -292,7 +292,8 @@ class OVSNeutronPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
             portbindings.VIF_DETAILS: {
                 # TODO(rkukura): Replace with new VIF security details
                 portbindings.CAP_PORT_FILTER:
-                'security-group' in self.supported_extension_aliases}}
+                'security-group' in self.supported_extension_aliases,
+                portbindings.OVS_HYBRID_PLUG: True}}
         self._parse_network_vlan_ranges()
         ovs_db_v2.sync_vlan_allocations(self.network_vlan_ranges)
         self.tenant_network_type = cfg.CONF.OVS.tenant_network_type
index 4dd0e745de8a1b08d467177f7d21a328bc8cf19c..9259d771ff6fcf2397cb830b1a8f31376ea5224a 100644 (file)
@@ -116,7 +116,10 @@ class RyuNeutronPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
             portbindings.VIF_DETAILS: {
                 # TODO(rkukura): Replace with new VIF security details
                 portbindings.CAP_PORT_FILTER:
-                'security-group' in self.supported_extension_aliases}}
+                'security-group' in self.supported_extension_aliases,
+                portbindings.OVS_HYBRID_PLUG: True
+            }
+        }
         portbindings_base.register_port_dict_function()
         self.tunnel_key = db_api_v2.TunnelKey(
             cfg.CONF.OVS.tunnel_key_min, cfg.CONF.OVS.tunnel_key_max)