System migration

Hi all,
i have to do some hardware maintenance to my main x86 pc which is running lxd on voidlinux.
I would migrate temporarily all the containers to a raspberry pi4 running debian and I would take as well the opportinity to switch definitevely to incus before move the system back to the current hardware and operative system
What are the best practices in such scenario?

My regards

Why are you wanting to move them off and back on?

I can’t think of a way that you could meaningfully do that: the x86 containers will contain x86 binaries, which by default won’t run on a raspberry pi (ARM/aarch64).

In principle you could use qemu on the pi to emulate x86 hardware, e.g. build an x86 virtual machine and install lxd inside, or install multiarch support inside each container individually. But in practice it would be dog slow, most likely unusably so.

To run native containers on the pi you could build entirely new containers from scratch, reinstall all your applications and copy across all the configs and data. That would be pointless expenditure of effort if you’re moving back to x86.

If you’re only using system packages, and any custom code is interpreted (e.g. written in python or perl or shell scripting), then you could install both amd64 and aarch64 versions of all OS packages side by side inside your containers (multiarch), and everything would run at full speed - but it would double the OS storage used by each container.

Personally, I think you would be better simply to shut down your containers temporarily while you do maintenance on the PC. If there are any critical services, then you could replicate them on the pi (i.e. build fresh containers on it and run them both side by side with the PC) - this will give you redundancy in future too.

Switching to incus is quickly and safely done in-place using “lxd-to-incus” as already observed.

As I thought the migration is not easy and at the moment i can’t dedicate other time to it.

I spent hours trying to rebuild the whole system from scratch on a Raspberry because I’m not so skilled and because I crashed into two faulty sd cards, the new ones (since i bought two of them) which do not support ext4 filesytem, the old one which suddenly died, so i don’t trust anymore the RPI very much.

My current system works well with some bearable random freeze or reboot. I’ll keep it until it doesn’t work anymore.

Many thanks