<div dir="ltr"><div class="gmail_default" style="font-size:small">What would it be the right tar parameters to compress and decompress all the rootfs, including devices and special files?<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 4, 2015 at 11:58 AM, Bostjan Skufca <span dir="ltr"><<a href="mailto:bostjan@a2o.si" target="_blank">bostjan@a2o.si</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Depends if you need consistent copy and how much downtime you can tolerate.<div><br></div><div>If inconsistent copy is enough, then you can run rsync over storage of running container (on host, not in container) and be done with it.</div><div><br></div><div>Rsync:</div><div>I find rsync useful and fast, providing that:</div><div>- whole container filesystem metadata fits into memory</div><div>- not too much data changes between subsequent rsync runs</div><div><br></div><div>So, my simplified procedure is:</div><div>1: rsync #1 - does most of the work, takes time, but can be run on running container</div><div>2: rsync #2 - to see how much files have changed since initial run (gives good estimate of upcoming downtime)</div><div>3: lxc-stop -n container (on host 1)</div><div>4: rsync #3</div><div>5: lxc-start -n container (on host 2)</div><div><br></div><div>This procedure gives me about 10 seconds of downtime for containers with small filesystems (up to 50GB).</div><div><br></div><div>Block device migration:</div><div>Rsync is fast if it operates on not-too-many-files. If you are getting long rsync runs because of amount of small files, then you might be better off migrating whole block device. You can go about it with LVM or btrfs snapshots too. I do not usually use this.</div><div><br></div><div><br></div><div>LXC vs LXD:</div><div>LXC in generally single-host-centred, so you have to do things manually.</div><div>LXD on the other hand supports operations on multiple hosts, but others are more qualified to summarize what is currently possible (creating LXD host associations between on-premises and cloud-provider hosts etc.)<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>b.</div><div><br></div><div><br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 4 December 2015 at 17:32, Saint Michael <span dir="ltr"><<a href="mailto:venefax@gmail.com" target="_blank">venefax@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">I was going t ask the same question.<br></div><div class="gmail_default" style="font-size:small">It is a very important one. I am moving containers via rsync, but it takes tooo long.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 4, 2015 at 11:03 AM, Eax Melanhovich <span dir="ltr"><<a href="mailto:afiskon@devzen.ru" target="_blank">afiskon@devzen.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello.<br>
<br>
Lets say I have some container. I would like to run something like:<br>
<br>
lxc-backup -n test-container my-backup.tgz<br>
<br>
Then move backup somewhere (say, to Amazon S3). Then say I would like<br>
to restore my container or create its copy on different machine. So I<br>
need something like:<br>
<br>
lxc-restore -n copy-of-container my-backup.tgz<br>
<br>
I discovered lxc-snapshot, but it doesn't do exactly what I need.<br>
<br>
So what is the right way of backuping and restoring linux containers?<span><font color="#888888"><br>
<span><font color="#888888"><br>
--<br>
Best regards,<br>
Eax Melanhovich<br>
<a href="http://eax.me/" rel="noreferrer" target="_blank">http://eax.me/</a><br>
_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a></font></span></font></span></blockquote></div><br></div>
<br>_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br></blockquote></div><br></div>