Downgrade lxd from snap from edge to stable

Ubuntu 18.04. I had installed lxd from snap edge:

snap switch --channel edge lxd 
snap install lxd

# lxc info | grep version
api_version: "1.0"
  driver_version: 3.1.0 (devel)
  kernel_version: 4.15.0-52-generic
  server_version: "3.14"
  storage_version: 0.8.1-0york1~18.04

Now I want to switch to snap stable:

snap switch --channel stable lxd 
snap refresh

lxc info | grep version
api_version: "1.0"
  driver_version: 3.1.0
  kernel_version: 4.15.0-52-generic
  server_version: "3.14"
  storage_version: ""

And lxc list shows empty list of containers. Switched back to edge and containers are available again.

How to correct downgrade lxd from edge to stable channel?

LXD downgrades aren’t supported. If you’re lucky our database hasn’t changed and they work, but as is the case right now, edge was moved to a completely different database backend than what’s in stable, so there’s no way back from edge to stable.

The only time where you can safely jump from edge back to stable is immediately after a new release hits stable as at that one specific time, they’re both equal and it’s therefore not a downgrade.

So in your case, it should be safe to switch to stable on Monday after we push LXD 3.15 to stable (assuming no delays due to last minute issues).

I performed the downgrade from edge to stable about a week ago and got the same issue (empty container list, no configuration).
I performed the recovery steps found in the documentation and wrote about it in some detail at

Can you shed some light into this, why ‘I had’?

@stgraber I successfully updated from edge to 3.15 with

snap switch --channel candidate lxd 
snap refresh

Now everything looks fine.

Then I did

apt remove --purge lxd lxd-client liblxc1 lxcfs

as recommended on

Should I install something from snap now? How to be sure everything is correct?

# ps -ef | grep lxcfs
root      2036     1  0 05:07 ?        00:00:00 lxcfs /var/snap/lxd/common/var/lib/lxcfs -p /var/snap/lxd/common/

# file /var/snap/lxd/common/var/lib/lxcfs
/var/snap/lxd/common/var/lib/lxcfs: broken symbolic link to /var/snap/lxd/common/shmounts/lxcfs

# lxcfs --version
-bash: lxcfs: command not found

Is this ok?

Also (not sure if I should lxd.migrate but looks not ok)

# lxd.migrate
=> Connecting to source server
error: Unable to connect to the source LXD: Get http://unix.socket/1.0: dial unix /var/lib/lxd/unix.socket: connect: no such file or directory

lxd.migrate can only be used prior to removing the deb version of LXD, so assuming you didn’t have any data prior to switching to the snap, you don’t need to do anything with that.

lxcfs not being an available command is perfectly normal, it’s a service and is hidden away in the LXD snap, so that should work just fine.

Is this still the case now with 4.6/edge and 4.0/stable?
When do you expect to push 4.6 to stable?

latest/stable is currently 4.6.
4.0/stable is at 4.0.3 and we’re hoping to push a 4.0.4 next week.

1 Like

If you are asking whether 4.6/stable or 4.6/edge will eventually get tested enough so that it gets sent to 4.0/stable, then the answer no. The 4.0.x line of LXD is feature-frozen, hence you either stick to the 4.0/stable line, or jump on the development line which is currently at LXD 4.6. Within the development line, you can switch to the stable-development versions, such as 4.5/stable or 4.6/stable.

1 Like