Page MenuHomeVyOS Platform

Bond VRRP Race Condition
Resolved (N/A)PublicBUG

Description

There's an issue with VyOS where loading the configuration from a file won't bring up a VRRP interface properly. It creates the interface in Linux, but doesn't populate keepalived or start listening on the virtual address. The configuration has to be loaded a second time (after removing the interface manually via sudo ip link del). I'd guess its a race condition of some kind.

This was once working, but the difference is that we've since switched to using a bonded interface. Previously VyOS was a VM where the hypervisor had a bond in the bridge - but now it is a physical machine and looks like a bug in VyOS with bonds/vrrp and configuration loading.


user@vyos-sw1# run show interfaces
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface        IP Address                        S/L  Description
---------        ----------                        ---  -----------
bond0            -                                 u/u  Access switch/mgmt interface
bond1            -                                 u/u  Aggregation 10G uplink
...
bond1.285        x.x.x.x/29                        u/u
                 x.x.x.x/29
bond1.298        x.x.x.x/29                        u/u
bond1.412        x.x.x.x/29                        u/u
                 x.x.x.x/29
bond1.414        x.x.x.x/29                        u/u
                 x.x.x.x/29
bond1.432        x.x.x.x/29                        u/u
                 x.x.x.x/29
...

/etc/keepalived/keepalived.conf appears to be missing vlan 298 completely.

Configuration appears to be empty though,

user@vyos-sw1# show interfaces bonding bond1 vif 298
Configuration under specified path is empty

Loading the same configuration a second time shows the changes,

user@vyos-sw1# compare 0
[edit high-availability vrrp]
+group bond1-298-105 {
+    advertise-interval 5
+    interface bond1.298
+    priority 250
+    virtual-address x.x.x.x/29
+    vrid 105
+}
[edit interfaces bonding bond1]
+vif 298 {
+    address x.x.x.x/29
+    firewall {
+        local {
+            name protect-re-local
+        }
+    }
+}
[edit service dhcp-relay]
+interface bond1.298
>interface bond1.212
>interface bond1.215
>interface bond1.219
>interface bond1.222
>interface bond1.225
>interface bond1.227
>interface bond1.229
>interface bond1.230
>interface bond1.232
>interface bond1.241
>interface bond1.243
>interface bond1.246
>interface bond1.270
>interface bond1.285
>interface bond1.412
>interface bond1.414
>interface bond1.432
>interface bond1.487
>interface bond1.501
>interface bond1.4092

But trying to commit it shows an issue as the interface/address already exists,

user@vyos-sw1# commit
[ interfaces bonding bond1 vif 298 ]
RTNETLINK answers: File exists
[[interfaces bonding bond1 vif 298]] failed

Deleting the interface manually and committing again works,

user@vyos-sw1# sudo ip link del bond1.298
[edit]
user@vyos-sw1# commit
[edit]
user@vyos-sw1# run show interfaces
...
bond1.298        x.x.x.x/29                   u/u
                 x.x.x.x/29
...

Details

Difficulty level
Easy (less than an hour)
Version
1.2.6
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)

Event Timeline

I can't reproduce it.

[email protected]:~$ show interfaces 
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface        IP Address                        S/L  Description
---------        ----------                        ---  -----------
bond0            -                                 u/u  
bond0.11         10.0.11.1/24                      u/u  
                 100.64.11.1/29
bond0.12         10.0.12.1/24                      u/u  
                 100.64.12.1/29
bond0.13         10.0.13.1/24                      u/u  
                 100.64.13.1/29
bond0.14         10.0.14.1/24                      u/u  
                 100.64.14.1/29
bond0.15         10.0.15.1/24                      u/u  
                 100.64.15.1/29
bond0.16         10.0.16.1/24                      u/u  
                 100.64.16.1/29
bond0.17         10.0.17.1/24                      u/u  
                 100.64.17.1/29
bond0.18         10.0.18.1/24                      u/u  
                 100.64.18.1/29
bond0.19         10.0.19.1/24                      u/u  
                 100.64.19.1/29
bond0.20         10.0.20.1/24                      u/u  
                 100.64.20.1/29
bond0.21         10.0.21.1/24                      u/u  
                 100.64.21.1/29
bond0.22         10.0.22.1/24                      u/u  
                 100.64.22.1/29
bond0.23         10.0.23.1/24                      u/u  
                 100.64.23.1/29
bond0.24         10.0.24.1/24                      u/u  
                 100.64.24.1/29
bond0.25         10.0.25.1/24                      u/u  
                 100.64.25.1/29
bond0.26         10.0.26.1/24                      u/u  
                 100.64.26.1/29
bond0.27         10.0.27.1/24                      u/u  
                 100.64.27.1/29
bond0.28         10.0.28.1/24                      u/u  
                 100.64.28.1/29
bond0.29         10.0.29.1/24                      u/u  
                 100.64.29.1/29
bond0.30         10.0.30.1/24                      u/u  
                 100.64.30.1/29
eth0             192.168.122.14/24                 u/u  
eth1             -                                 u/u  
lo               127.0.0.1/8                       u/u  
                 ::1/128
[email protected]:~$ 
[email protected]:~$ 
[email protected]:~$ show vrrp 
Name    Interface      VRID  State    Last Transition
------  -----------  ------  -------  -----------------
BND011  bond0.11         11  MASTER   2m13s
BND012  bond0.12         12  MASTER   2m13s
BND013  bond0.13         13  MASTER   2m13s
BND014  bond0.14         14  MASTER   2m13s
BND015  bond0.15         15  MASTER   2m13s
BND016  bond0.16         16  MASTER   2m13s
BND017  bond0.17         17  MASTER   2m13s
BND018  bond0.18         18  MASTER   2m13s
BND019  bond0.19         19  MASTER   2m13s
BND020  bond0.20         20  MASTER   2m13s
BND021  bond0.21         21  MASTER   2m13s
BND022  bond0.22         22  MASTER   2m13s
BND023  bond0.23         23  MASTER   2m13s
BND024  bond0.24         24  MASTER   2m13s
BND025  bond0.25         25  MASTER   2m13s
BND026  bond0.26         26  MASTER   2m13s
BND027  bond0.27         27  MASTER   2m13s
BND028  bond0.28         28  MASTER   2m13s
BND029  bond0.29         29  MASTER   2m13s
BND030  bond0.30         30  MASTER   2m13s
[email protected]:~$

Checked on 1.2.6 and 1.2.7-epa1

@iomart-network-team can you describe more details?

Did you use set commands - or did you use load ...? Its regularly/easily produced here.

We generate the configuration file automatically then use load /config/config.boot to apply it. But when doing so (see original post), you get an error as it doesn't create the interface properly, or populate keepalived etc.

I use set. Then commit and "save" the configuration and reboot the server.

Specifically, to reproduce the issue - you need to make the changes in the configuration file - and use load /config/xxx

The issue is not reproduced using set commands, it is reproduced using load

@iomart-network-team You don't need to change any file, but you can.
If you change something in the file, it not a bug.
It more seems like some typo in the file, which you generate.

Do you have a real problem when you configure it via "set xxxx xxxx" ?

Did you read the original bug details? It clearly outlines how to replicate this with clear step-by-step instructions.

The configuration file does not contain any syntax errors, the file is loaded without errors. You can see this from the clear instructions provided.

dmbaturin edited projects, added VyOS 1.4 Sagitta; removed VyOS 1.2 Crux.
dmbaturin set Issue type to Unspecified (please specify).

Not reproduced
Re-open it with all steps to reproduce, including scripts that generate your config.
The Load is used anywhere and never has issues like this.
Close it for now.