Skip to content

Update lxc-setup script on lxd vm instances#117

Merged
blackboxsw merged 1 commit into
canonical:masterfrom
lucasmoura:fix-setup-lxc-script
Feb 18, 2021
Merged

Update lxc-setup script on lxd vm instances#117
blackboxsw merged 1 commit into
canonical:masterfrom
lucasmoura:fix-setup-lxc-script

Conversation

@lucasmoura
Copy link
Copy Markdown

When we create Xenial and Bionic lxd vm instances through pycloudlib, we need to provide a script to install the lxd-agent
on those machines. Recently, one of the services that was being started in this script was dropped from lxd, lxd-agent-9p. We are
now updating the script to remove references to that service.

This is the new script being used:

#!/bin/sh
if ! grep lxd_config /proc/mounts; then
    mkdir -p /run/lxdagent
    mount -t 9p config /run/lxdagent
    VIRT=$(systemd-detect-virt)
    case $VIRT in
        qemu|kvm)
            (cd /run/lxdagent/ && ./install.sh)
            umount /run/lxdagent
            systemctl start lxd-agent
            ;;
        *)
    esac
fi

And we can see that lxd has dropped support for the lxd-agent-9p service on this commit:
lxc/incus@2d013df

Copy link
Copy Markdown
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

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

I think your commit message should reference the upstream lxd changeset that broke due to removal of the /lib/systemd/system/lxd-agent-9p.service

https://github.com/lxc/lxd/commit/2d013dfbeb.

Otherwise LGTM

When we create Xenial and Bionic lxd vm instances through
pycloudlib, we need to provide a script to install the lxd-agent
on those machines. Recently, one of the services that was being
started in this script was dropped from lxd, lxd-agent-9p, as can
be seen here:

lxc/incus@2d013df

We are now updating the script to remove references to that service
@blackboxsw
Copy link
Copy Markdown
Collaborator

Hrm I'm holding off on approval of this as I can't reproduce this issue locally (outside of ua-client integration tests). Once I can properly reproduce with pycloudlib alone, i can +1 this. Until then, I'll hold on approviing.

@lucasmoura
Copy link
Copy Markdown
Author

@blackboxsw pycloudlib is not raising any failures if cloud-init fails to run since #93. This might explain why you are not seeing this error. But if you are explicitly checking the status of cloud-init and it is not failing, please let me know and I will work on it

@blackboxsw
Copy link
Copy Markdown
Collaborator

blackboxsw commented Feb 18, 2021

Ok was able to reproduce the error today, right the issue was raise_on_error wasn't happening:

# /var/lib/cloud/scripts/per-once/setup-lxc.sh

LXD agent has been installed, reboot to confirm setup.
To start it now, unmount this filesystem and run: systemctl start lxd-agent
Failed to start lxd-agent-9p.service: Unit lxd-agent-9p.service not found.

Changing the service to drop lxd-agent-9p works.

Copy link
Copy Markdown
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

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

LGTM!

@blackboxsw blackboxsw merged commit 21cfa21 into canonical:master Feb 18, 2021
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