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

doc: Add documentation note for when LXD 5.0 is already installed #437

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gabrielmougard
Copy link
Contributor

fixes #410

Copy link

@token47 token47 left a comment

Choose a reason for hiding this comment

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

Looks good to me!!


```{note}
Depending on you machine OS and state, the LXD snap might already be installed (e.g, you have a version of Ubuntu on the machine having LXD 5.0 already installed).
In this case instead of doing `sudo snap install lxd --channel=5.21/stable --cohort="+"`, just do `sudo snap remove lxd --purge && sudo snap install lxd --channel=5.21/stable --cohort="+"`
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't have to uninstall the snap as you can just refresh it:

Suggested change
In this case instead of doing `sudo snap install lxd --channel=5.21/stable --cohort="+"`, just do `sudo snap remove lxd --purge && sudo snap install lxd --channel=5.21/stable --cohort="+"`
In this case instead of running `sudo snap install lxd --channel=5.21/stable --cohort="+"`, refresh the snap with `sudo snap refresh lxd --channel=5.21/stable --cohort="+"`

Copy link

Choose a reason for hiding this comment

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

This does not work. I specifically mentioned issues if refreshing (my second bullet in original post). Something is left behind during the upgrade process. This may be a separate bug, but for now it is what happens.

Copy link

Choose a reason for hiding this comment

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

Somehow you get "Invalid project configuration key "features.networks.zones"" if you refresh, but you don't get this error if you purge and install again.

Copy link
Contributor

@masnax masnax Oct 22, 2024

Choose a reason for hiding this comment

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

I remember this issue. Looking at LXD, features.networks.zones does have support in 5.21, but is not supported in 5.0, which suggest the rejecting system was still on 5.0, but being supplied data created on 5.21 since the config field is set. Since the setup got so far as updating tables on the joiner, what's odd to me is that such a combination passed API/database version checking in LXD in the first place.

I do remember from the initial Mattermost thread that the snaps were listed as 5.21.

Worth a bit more investigation I think. @token47 are you able to reproduce this with any consistency?

Copy link
Contributor

Choose a reason for hiding this comment

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

I just gave this a try by running microcloud init on a system with lxd 5.21 installed, and lxd 5.0 installed on a joiner. Indeed this is the error I see:

Error: Failed to join cluster: Failed to initialize member: Failed to initialize storage pools and networks: Failed to update local member project "default": Invalid project configuration key "features.networks.zones"

So it seems we eagerly try to update the projects table before doing any API/database version checking in 5.0, thus getting back a misleading/non-descriptive error. The real error is the daemon versions are incompatible.

Still not sure why snap info listed 5.21, but maybe I just failed to catch a 5.0 in there.

Copy link

@token47 token47 Oct 22, 2024

Choose a reason for hiding this comment

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

Interestingly, I'm not being able to reproduce this anymore. Maybe something changed on LXD snap in the last days?

This is a test without upgrading lxd snap from 5.0 to 5.21 -> https://pastebin.canonical.com/p/mjpSWMhKmp/
This is a test with the refresh (not purge+install) -> https://pastebin.canonical.com/p/q75c9c25tc/

As you can see, second test was giving me error before but now seems to have worked.

NOTE: just to be clear, this happened on first node already during init, not on a node join later.

Copy link
Contributor

Choose a reason for hiding this comment

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

@token47 IIRC the error in the first link seems to be caused by not having at least LXD 5.21.x.

If this still isn't reproducible anymore please let us know so we can close the PR and the related issue. LXD 5.21/stable channel was updated recently so maybe it contained a fix for this.

Copy link

Choose a reason for hiding this comment

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

Sorry but have been unable to test this since. You seem to have hit the same issue, so maybe you could try one more time to make sure it was not a fluke for me? Maybe something actually changed that indirectly fixed this.

Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
@gabrielmougard gabrielmougard force-pushed the fix/doc-explanation-on-install branch from b9f9b35 to 9d8b5d4 Compare October 22, 2024 08:41
@minaelee
Copy link
Contributor

minaelee commented Nov 4, 2024

Question: Does the same apply for all snaps, not just lxd? That is, could a machine intended for a MicroCloud cluster already have microceph or microovn installed previously, and thus also need to those to be refreshed instead of installed? If so, the wording of the addition should be changed. If not, disregard.

@roosterfish
Copy link
Contributor

Question: Does the same apply for all snaps, not just lxd?

@minaelee valid point. You can potentially already have LXD, MicroCloud, MicroCeph and MicroOVN installed from either the right or different channel.

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.

docs: add LXD purge step to installation instructions
5 participants