I use openconnect vpn connections on my lxd image.
It works fine when my host uses 5.10.11 kernel but when I use Linux LTS 5.4.94. It somehow cant connect.
Otherwise everything works fine.
This is so weird that I have no clue how to debug.
Could it be that the kernel used updating lxd causes problem if at boot time I switch kernels?
Indeed, if you get this issue when you run this VPN software on the host (and switch between the two kernel versions), then it makes sense to look into the support forums of the VPN software.
Having said that, if you then know that the Linux kernel is the source of the problem, you can use LXD to perform your tests.