ovn-octavia-provider associates to wrong logical router when LogicalRouterPortEvent is fired and network has multiple routers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
New
|
Undecided
|
Unassigned |
Bug Description
Hi all,
When a loadbalancer is created with a VIP in a network having multiple routers, the LogicalRouterPo
This is caused by the LogicalRouterPo
When the event is fired for a Logical Router Port not owned by the router owning the default gateway, lb_create_lrp_assoc adds all the load balancers having a VIP in the associated network to the router by calling _update_
This behavior can be verified by looking a the load balancer external ids and the "load_balancer" key of the router owning the logical router port event fired.
During a logical router port event, the load balancer ids must be added only if the router is the router owning the default gateway for the network, using the same logic found in method _find_lr_of_ls.
tags: | added: ovn-octavia-provider |
I have been doing some tests about this bug and I have come to the following conclusions:
- As you said when the LogicalRouterPo rtEvent (add interface to N2 to R1) is triggered these actions are taking place for each LB present on the new network (N2) that is not present on the router (R1):
1 - The unique LBs on the network (N2) are added to the router's (R1) LB field OVN NB DB
2 - The unique LBs on the network (N2) are added to the Logical_Switch LB field OVN NB DB related to router (R1)
3 - The external_ids.lr_ref field of the LB been iterated is modified by adding the affected router (R1)
4 - The unique LBs on the router (R1) are added to the Logical_Switch LB field OVN NB DB related to network (N2)
so taking that into consideration and reading several times your comment, I understand that your proposal it is as follow:
- Step 1, 2 and 4 keeps same
- Step 3 needs to be modified and only modify the lr_ref of the LB if the router (R1) it is the default gateway of network (N2)
Am I right?
Assuming above change, we can see some examples (I hope I manage to explain myself and don't mess up :D)
case a) Different networks (nx, snx and rx created and after that LBx created)
│n1 │ │ n2 │
│ │
│ │
LB1 ─────►sn1 │ │ sn2 ◄──── LB2
ls_ref=n1 │ │ ls_ref=n2
lr_ref=r1 │ │ lr_ref=r2
│r1 │ │ r2 │
─────── ─────── ─────── ─────── ─────── ─────── ─────── ─────── ─────── ─────── ───────
When we add a interface from r1 to n2, this is the final result:
│n1 │ │ n2 │
│ │
│ │
LB1 ─────►sn1 │ ┌────┤ sn2 ◄──── LB2
ls_ref=n1 │ │ │ ls_ref=n2
lr_ref=r1 │ │ │ lr_ref=r2
│r1 ├──────┘ │ r2 │
case b) Same network (nx, snx and rx created and after that LBx created)
│ n1 │
│ │
│ │
LB1 ─────►sn1 │ │ sn2 ◄──── LB2
ls_ref=n1 │ │ ls_ref=n1
lr_ref=r1 │ │ lr_ref=r2
│r1 │ │ r2 │
──────