canonical / lxd

Powerful system container and virtual machine manager
https://canonical.com/lxd
GNU Affero General Public License v3.0
4.27k stars 910 forks source link

lxd-agent: Retry VM hotplug directory share mounts #13674

Closed tomponline closed 4 days ago

tomponline commented 4 days ago

Sometimes the hotplug event is received from LXD before the virtiofs device is available in the guest VM.

So retry several times before giving up to allow it to be activated.

This, in conjunction with a sleep in the lxd-ci tests makes the storage-disks-vm tests more reliable: https://github.com/canonical/lxd-ci/pull/210

Also enables lxd-agent syslog logging for better feedback about what the agent is doing.

Also standardises using the err field in contextual logging rather than error. The majority of uses were already using err, but there were a few stragglers using error.