From fc45beeb0311dc07c7b60c2459bafbf2bfecdb29 Mon Sep 17 00:00:00 2001 From: Kobi Samoray Date: Sun, 11 Sep 2016 10:20:22 +0300 Subject: [PATCH] NSXv: Configure metadata when detaching from VDR When a network is detached from VDR and attached to a new DHCP Edge, metadata LB should be configured on that Edge. Change-Id: I74e11526b74c0699d91ea0ba9e34db5b63ab0a16 --- .../nsx_v/drivers/distributed_router_driver.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py b/vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py index 924f479102..fb2099cec6 100644 --- a/vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py +++ b/vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py @@ -458,7 +458,7 @@ class RouterDistributedDriver(router_driver.RouterBaseDriver): router_id) # Reattach to regular DHCP Edge - self.edge_manager.create_dhcp_edge_service( + dhcp_id = self.edge_manager.create_dhcp_edge_service( context, network_id, subnet) address_groups = ( @@ -466,6 +466,15 @@ class RouterDistributedDriver(router_driver.RouterBaseDriver): network_id)) self.edge_manager.update_dhcp_edge_service( context, network_id, address_groups=address_groups) + if dhcp_id: + edge_id = self.plugin._get_edge_id_by_rtr_id(context, + dhcp_id) + if edge_id: + with locking.LockManager.get_lock(str(edge_id)): + md_proxy_handler = ( + self.plugin.metadata_proxy_handler) + if md_proxy_handler: + md_proxy_handler.configure_router_edge(dhcp_id) return info