Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 9 commits into from
Jun 27, 2024

Conversation

tomponline
Copy link
Member

@tomponline tomponline commented Jun 27, 2024

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:
canonical/lxd-ci#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.

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
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.

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
In this case we need it to ensure non-zero exit code is returned.

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
@tomponline tomponline marked this pull request as ready for review June 27, 2024 12:53
simondeziel
simondeziel previously approved these changes Jun 27, 2024
Copy link
Member

@simondeziel simondeziel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one tiny optional nitpick.

You found quite a few places where s/error/err/ was needed, good thing!

lxd-agent/main_agent.go Outdated Show resolved Hide resolved
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
@tomponline tomponline merged commit 762f7dc into canonical:main Jun 27, 2024
28 checks passed
@tomponline tomponline deleted the tp-agent-disk-wait branch June 27, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants