[lxc-users] LXD move container to another pool ?
Fajar A. Nugraha
list at fajar.net
Fri Aug 10 03:27:00 UTC 2018
On Thu, Aug 9, 2018 at 7:57 PM, Pierre Couderc <pierre at couderc.eu> wrote:
>
> On 08/09/2018 11:30 AM, Fajar A. Nugraha wrote:
>
>
> Basically you'd just need to copy /var/lib/lxd and whatever storage
> backend you use (I use zfs), and then copy them back later. Since I also
> put /var/lib/lxd on zfs (this is a custom setup), I simply need to
> export-import my pool.
>
>
> /var/lib/lxc alone, nothing about /var/lxc ?
>
>
>
Are you using lxc1 (e.g. lxc-create commands) or lxd?
When lxd is installed as package (e.g. installed as apt on ubuntu), you
only need /var/lib/lxd and its storage pool (which will be mounted
on /var/lib/lxd/storage-pools/...).
Here's what I'm using:
- I start AWS spot instance
- I have a custom ubuntu template, with lxd installed but not started. It
thus has an empty /var/lib/lxd, with no storage pools and network.
- I have a separate EBS disk, used by a zfs pool 'data'. I then have
'data/lib/lxd' which I mount as '/var/lib/lxd', and 'data/lxd' which is
registered as lxd storage pool 'default'.
- I create containers (using that default pool)
- if that spot instance is terminated (thus the "root"/OS disk is lost), I
can simply create a new spot instance again, and attach the 'data' pool
there. I will then have access to all my containers.
Is that similar to what you need?
Note that lxc1 and lxd from snap uses different directories than lxd from
package.
--
Fajar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20180810/5cd795e1/attachment.html>
More information about the lxc-users
mailing list