keepalived virtual_routes wrong order
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Invalid
|
Medium
|
Unassigned |
Bug Description
Neutron version: 13.0.6 (I will try to test this with version Zed as well)
ML2: OVS
1. create a provider network (eg. named: public)
2. create a subnet pool (eg. 100.100.100.32/27)
3. create a 1st subnet /29 from that subnetpool on network "public": 100.100.100.32/29 --gateway 100.100.100.33
4. create a 2nd subnet /29 from that subnetpool on network "public": 100.100.100.40/29 --gateway 100.100.100.33
NOTE: the "physical" gateway of the whole subnetpool is 100.100.100.33
-> so the GW of the 2nd subnet is in the range of the 1st subnet!
neutron_l3_agent will create a keepalived.conf like:
global_defs {
notificatio
router_id neutron
}
vrrp_script ha_health_check_186 {
script "/var/lib/
interval 5
fall 2
rise 2
}
vrrp_instance VR_186 {
state BACKUP
interface ha-f3350150-28
virtual_
priority 50
garp_
nopreempt
advert_int 2
authentication {
auth_type PASS
auth_pass somepass
}
track_interface {
}
virtual_
}
virtual_
}
virtual_routes {
0.0.0.0/0 via 100.100.100.33 dev qg-7b9963a7-72
}
track_script {
}
}
So keepalived will try to create the default route BEFORE the route "100.100.100.32/29 dev qg-7b9963a7-72 scope link" has been created. This will throw an error like:
Jan 26 17:49:56 xxxxxxxx Keepalived_
Jan 26 17:49:56 xxxxxxxx Keepalived_
Jan 26 17:49:56 xxxxxxxx Keepalived_
Jan 26 17:49:56 xxxxxxxx Keepalived_
Jan 26 17:49:56 xxxxxxxx Keepalived_
Jan 26 17:49:56 xxxxxxxx Keepalived_
Jan 26 17:49:56 xxxxxxxx Keepalived_
...
And the default route will be missing:
169.254.0.0/24 dev ha-a1f79365-fc proto kernel scope link src 169.254.0.186
169.254.192.0/18 dev ha-a1f79365-fc proto kernel scope link src 169.254.192.14
192.168.199.0/24 dev qr-24c07a36-4f proto kernel scope link src 192.168.199.1
100.100.100.32/29 dev qg-7b9963a7-72 scope link
100.100.100.40/29 dev qg-7b9963a7-72 proto kernel scope link src 100.100.100.43
Changing the order of "virtual_routes" will fix this issue:
}
virtual_routes {
0.0.0.0/0 via 100.100.100.33 dev qg-7b9963a7-72
}
The error message is now gone:
Jan 27 10:09:31 xxxxxxxxx Keepalived_
Jan 27 10:09:31 xxxxxxxxx Keepalived_
Jan 27 10:09:31 xxxxxxxxx Keepalived_
Jan 27 10:09:31 xxxxxxxxx Keepalived_
Jan 27 10:09:31 xxxxxxxxx Keepalived_
Jan 27 10:09:31 xxxxxxxxx Keepalived_
Jan 27 10:09:31 xxxxxxxxx Keepalived_
And the routing table looks fine:
default via 100.100.100.33 dev qg-7b9963a7-72
169.254.0.0/24 dev ha-a1f79365-fc proto kernel scope link src 169.254.0.186
169.254.192.0/18 dev ha-a1f79365-fc proto kernel scope link src 169.254.192.14
192.168.199.0/24 dev qr-24c07a36-4f proto kernel scope link src 192.168.199.1
100.100.100.32/29 dev qg-7b9963a7-72 scope link
100.100.100.40/29 dev qg-7b9963a7-72 proto kernel scope link src 100.100.100.43
To me, it looks like the order in neutron/
tags: | added: l3-ha |
Changed in neutron: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Adding "onlink" also solves the issue:
virtual_routes {
100.100. 100.32/ 29 dev qg-7b9963a7-72 scope link
0.0.0.0/0 via 100.100.100.33 dev qg-7b9963a7-72 onlink
}
->
Jan 27 11:16:22 xxxxxxxxx Keepalived_ vrrp[1715] : (VR_186) Receive advertisement timeout vrrp[1715] : (VR_186) Entering MASTER STATE vrrp[1715] : (VR_186) setting VIPs. vrrp[1715] : (VR_186) setting E-VIPs. vrrp[1715] : (VR_186) setting Virtual Routes vrrp[1715] : (VR_186) Sending/queueing gratuitous ARPs on ha-f3350150-28 for 169.254.0.186 vrrp[1715] : Sending gratuitous ARP on ha-f3350150-28 for 169.254.0.186
Jan 27 11:16:22 xxxxxxxxx Keepalived_
Jan 27 11:16:22 xxxxxxxxx Keepalived_
Jan 27 11:16:22 xxxxxxxxx Keepalived_
Jan 27 11:16:22 xxxxxxxxx Keepalived_
Jan 27 11:16:22 xxxxxxxxx Keepalived_
Jan 27 11:16:22 xxxxxxxxx Keepalived_
->
default via 100.100.100.33 dev qg-7b9963a7-72 proto 18 onlink
169.254.0.0/24 dev ha-f3350150-28 proto kernel scope link src 169.254.0.186
169.254.192.0/18 dev ha-f3350150-28 proto kernel scope link src 169.254.192.2
192.168.199.0/24 dev qr-24c07a36-4f proto kernel scope link src 192.168.199.1
100.100.100.32/29 dev qg-7b9963a7-72 proto 18 scope link
100.100.100.40/29 dev qg-7b9963a7-72 proto kernel scope link src 100.100.100.43