Is it possible to upgrade lxd 4.14 (snap) to lxd 5.0

Hi,

My setup is perhaps somewhat unusual. It is totally disconnected from the internet. I use the sneakernet method to import things from the internet.

At the moment I’m running LXD 4.14 (snap). My question: can I manually install a (downloaded) LXD 5.0 snap onto a running LXD 4.14? Is that upgrade handled gracefully?
Also important to mention, this is a cluster with 6 hosts. Do I need to shutdown all 6 hosts before installing that LXD 5.0 snap on each of them?

Related to this. I’ve searched everywhere, but it seems impossible to find old LXD snaps. As soon as the snapstore gets a new LXD channel version all prior snaps are gone. Surely they must be somewhere, but unavailable on the public internet. I really don’t understand why that is. (This is probably a “design” choice of snapcraft, but what purpose does that have?)

Yeah, upgrading from anything from 4.0 or higher will work, so 4.14 can refresh to 5.0 just fine.
You don’t need to shut them down but as a cluster, they will not fully upgrade until they are all refreshed.

So you’ll need to snap download on a connected system, sneakernet that to all 6 machines and then manually do the snap install, ideally on all 6 at the same time.

Make sure that all machines show a clean lxc cluster list prior to doing this and you should be all good.

Thanks Stéphane, I’ll give that a try.

Great. It worked!

Two observations after the upgrade.

  1. containers kept running, but inside the containers they failed to read some files in /proc, such as /proc/uptime and /proc/cpuinfo
  2. stopping a container times out after 30 seconds; however the stopping succeeds

Both problems are gone after a restart of the container.

Ah, sounds like you had a LXCFS crash or restart as part of your migration :frowning:

Well, no. The problem may be that I didn’t have lxcfs installed. For some reason I uninstalled lxcfs a few weeks ago.

To be honest, I am not quite sure what role LXCFS is playing on the LXD hosts.

Furthermore, I noticed that some long-running containers had lxcfs installed. Newer containers don’t have that. In the mean time I have removed lxcfs from all containers because I was still getting warnings from df (in the container) about the lxcfs mount point.

lxcfs should be installed on the host system, when it’s present, it allows for files like /proc/meminfo, /proc/cpuinfo, /proc/loadavg, /proc/uptime, … to show information that matches the container’s own environment (cgroup limits, uptime, load, …) rather than the system-wide values.

When absent, you just get the full system values regardless of limits that may be in place.

For containers, we did a few fixes recently which should cause LXD running in a container to detect that environment and just passthrough the lxcfs from the host rather than spawn its own, saving resources and leading to more accurate responses.

Hmm OK. I’ve (re)installed LXCFS on the LXD hosts. Still, I didn’t see the correct uptime in the containers. I guessed I needed to restart LXD, and indeed, after that it is OK.

Many thanks Stéphane

Yes you will need to restart.

1 Like