The agent should fail to start when
enable_distributed_routing = True and l2_population = False
otherwise the router won't behave as expected.
All the cross subnet traffic (between VMs of the same tenant)
in DVR is now handled locally on the compute node using the router namespace.
A Linux namespace is created for every virtual router,
on each compute node that hosts VMs that are connected to that router.
The local DVR performs the routing and replaces the source MAC address and
the destination MAC address for every packet leaving the compute node.
In order to do that correctly, the router must be populated with
all the L2 addresses of the attached networks
Change-Id: Id2b56d852eff4773a347f490b19ad9eefc86af9c
Closes-Bug: #
1417633
Co-Authored-By: Romil Gupta <romilg@hp.com>
'agent_type': q_const.AGENT_TYPE_OVS,
'start_flag': True}
+ # Validate agent configurations
+ self._check_agent_configurations()
+
# Keep track of int_br's device count for use by _report_state()
self.int_br_device_count = 0
self.dvr_plugin_rpc, self.state_rpc):
rpc_api.client.timeout = timeout
+ def _check_agent_configurations(self):
+ if self.enable_distributed_routing and not self.l2_pop:
+ raise ValueError(_("DVR cannot be enabled without "
+ "L2 population."))
+
def _ofport_set_to_str(ofport_set):
return ",".join(map(str, ofport_set))
self.assertFalse(set_ovs_db_func.called)
self.assertFalse(delete_flows_func.called)
+ def test_check_agent_configurations_raises(self):
+ self.agent.enable_distributed_routing = True
+ self.agent.l2_pop = False
+ self.assertRaises(ValueError,
+ self.agent._check_agent_configurations)
+
+ def test_check_agent_configurations(self):
+ self.agent.enable_distributed_routing = True
+ self.agent.l2_pop = True
+ self.assertIsNone(self.agent._check_agent_configurations())
+
def test_port_bound_deletes_flows_for_valid_ofport(self):
self._mock_port_bound(ofport=1, new_local_vlan=1)