Linux
--
Questions
--
Followers
Top Experts
lxc publish CONTAINER_NAME --alias my-lxd
lxc image export my-lxd .
then move tarball to my new server (ubuntu 18.04.3 default lxc (version 3.0.3installation using zfs )
lxc image import bxxxx.tar.gz --alias my-lxd
then i try to create a new-lxd-name with command
lxc init my-lxd new-lxd-name
UNIQUE constraint failed: storage_volumes.storage_po
HELP
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Looking at LXD go code for export/import, it's highly unlikely this will ever work or will ever be fixed to work... because...
1) Trying take an export image of a ZFS container references machine unique ZFS data which only lives on source machine.
So exports will work + imports will fail... at least... that's my read...
2) Instead of an export/import, get your new/target container working using EXT4 or ZFS or whatever.
3) Then stop your old/source container + new/target container.
4) Then just rsync over all the files required from old/source container -> new/target. This includes /var/lib/mysql, /var/log/mysql (if bin logging is used), /etc/apache2/* + /etc/php/* + /etc/letsencrypt/* + any other files of interest.
5) On new/target container, ensure all your file ownership is correct.
6) Start your new/target container + all should be well.
Note: In my situation, I clone/copy/move containers, many containers/day, so all these LXD commands must work for me.
I've learned by many lost hours, if you're doing clone/copy/move frequently, stick with EXT4 as your backing store.
You'll do this via an init sequence of...
lxd init --auto --storage-backend=dir
lxc network attach-profile lxdbr0 default eno1
Open a https://discuss.linuxcontainers.org, asking for potential work arounds.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
If you're requirement is fastest container I/O + LXD commands working 100% of the time...
Yes.
You'll do this by setting up EXT4 machine level file systems, then use the lxd init sequence above.
2) You can mix filesystems, like BTRFS at machine level, then ZFS for containers. Doing this incurs a massive speed penalty, as every filesystem operation must be mapped back + forth between files systems.
3) is it possible to move old lxd on zfs to other server with btrfs file system?
Yes.
You'll setup a machine running BTRFS, then do your lxd init specifying BTRFS.
And, you may find you run into a completely new set of problems, not as bad as ZFS, just sometimes a few second EXT4 command will devolve into hours of working around some problem.
4) If I/O speed must be maximized + your time must be optimized... stick with EXT4.
i move it to my lxd on laptop with btrfs file system and op it running then import it and the same move to new server
with zfs for lxd. it's op and running.
???
but problem (issue) is solved now.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
In other words, going from ZFS -> non-ZFS, the LXD go code may reset/remove all ZFS cruft.
Glad you got this working!
1) You never "move LXD".
2) You do "move LXD containers", one at a time.
3) The way I do this is to setup a new Ubuntu + LXD machine + running on top of ext4. Then "lxc copy" (never lxc move) a container from one machine to another. After a copy has worked, then I do an lxc delete on original container.
The reason for the extra step is because if "lxc move" fails, there are edge conditions where you can end up with your original container deleted + your new container broken.
Better, to me, to always do a copy + test new container + delete old container.
Just to be sure all's well.
Linux
--
Questions
--
Followers
Top Experts
Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.