From 91ce3dca974361b4c38f60e00b7bb7b3478e2d9e Mon Sep 17 00:00:00 2001 From: pzhang Date: Wed, 28 Feb 2024 04:38:14 +0000 Subject: [PATCH] OPENSTACK-2959: we need to update port before build service object when migrate lb tree from A device to B device, agent use network information from service object. so when need to update network first, then build network info into service object. then the agent can use new network (physical info, vlan) from service object. --- f5lbaasdriver/v2/bigip/driver_v2.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/f5lbaasdriver/v2/bigip/driver_v2.py b/f5lbaasdriver/v2/bigip/driver_v2.py index da272870..c7e7981b 100644 --- a/f5lbaasdriver/v2/bigip/driver_v2.py +++ b/f5lbaasdriver/v2/bigip/driver_v2.py @@ -810,6 +810,10 @@ def refresh(self, context, body): try: agent, device = self._schedule_agent_and_device( context, loadbalancer, device_id=device_id) + + if device_id: + self.migrate_vipport(context, agent, device, loadbalancer) + # NOTE(qzhao): Call agent to rebuild LB. service = self._create_service(context, loadbalancer, agent) @@ -817,9 +821,6 @@ def refresh(self, context, body): service["device"] = device agent_host = agent['host'] - if device_id: - self.migrate_vipport(context, agent, device, loadbalancer) - if rebuild_all: self._allocate_acl_groups(context, service) driver.agent_rpc.rebuild_loadbalancer(