Skip to content

Commit c6296c6

Browse files
OPENSTACK-2959: get from_device and to_device
1. send the source device info to agent, agent can use the device info to delete source device neutorn selfip port. 2. not raise exception when migrate between the same device, although it will cause neutron selfip port lost. 3. when source device and target device is the same, we raise exception at neutron lbaas server side.
1 parent 805ad0a commit c6296c6

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

f5lbaasdriver/v2/bigip/driver_v2.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,14 @@ def _schedule_migrate_agent_device(
437437
LOG.info("Loadbalancer %s is rescheduled to agent %s",
438438
loadbalancer.id, agent.id)
439439

440-
# Load device info and return
441-
device = self.driver.device_scheduler.load_device(context,
442-
device_id)
440+
# Load source device info
441+
from_device = self.driver.device_scheduler.load_device(
442+
context, bond['device_id'])
443+
444+
# Load target device info
445+
device = self.driver.device_scheduler.load_device(
446+
context, device_id)
447+
443448
self._validate_device(device, loadbalancer, device_id)
444449

445450
# Update binding table
@@ -451,8 +456,11 @@ def _schedule_migrate_agent_device(
451456
LOG.info("Loadbalancer %s is migrate to device %s",
452457
loadbalancer.id, device["id"])
453458

454-
LOG.info("LB %s is migrate to agent %s device %s",
455-
loadbalancer.id, agent["id"], device["id"])
459+
LOG.info("Loadbalancer %s is migrate from device %s to device %s "
460+
"by agent %s", loadbalancer.id, from_device["id"],
461+
device["id"], agent["id"])
462+
463+
device["from_device"] = from_device
456464

457465
return agent, device
458466

0 commit comments

Comments
 (0)