[lxc-users] Move container to another storage pool

Spike spike at drba.org
Tue May 9 14:56:52 UTC 2017

I do the same thing altho I call it backups, moving containers from one
pool (local) to another (remote, bk server). Simplest way is to do it with
snapshots + send/reveice. because my pools are named the same I don't need
to change anything in my configuration, but in your case you'd have to
update the profiles that are referring "lxd" to refer "lxdpool" and any
other reference (can't think of another off the top of my head, other than
maybe containers you configured individually). That's it as far as I know.
Of course containers will need to be stopped during the operation or at
least restarted to pick up the new pool. So basically something like
(assuming you have a dataset called lxd.img) :

- stop containers
- zfs snapshot -r pool/lxd.img at movinglxd
- zfs send -R lxd.img at movinglxd | zfs receive pool/lxdpool
- lxd profile edit default (change reference to lxdpool)
- start containers

Hope that helps,


On Mon, May 8, 2017 at 10:43 AM Torben Janssen <torben at torben.cc> wrote:

> Hi All,
> I started using containers with a ZFS image file for storage on the root
> partition.
> Now I want to move the containers to another storage pool I just added
> as the partition is nearly full.
> $ lxc storage list
> +---------+--------+----------------------------+---------+
> |  NAME   | DRIVER |           SOURCE           | USED BY |
> +---------+--------+----------------------------+---------+
> | lxd     | zfs    | /var/lib/lxd/disks/lxd.img | 19      |
> +---------+--------+----------------------------+---------+
> | lxdpool | zfs    | pool/volume_lxd            | 0       |
> +---------+--------+----------------------------+---------+
> I want to move some containers from the image (lxd.img) to the new ZFS
> volume (volume_lxd) but I cannot find any information how to do this.
> How can I move a container from one storage pool to another?
> thanks,
> Torben
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170509/19ccd8c6/attachment.html>

More information about the lxc-users mailing list