[lxc-users] lxc archive / lxc restore command?

Tomasz Chmielewski mangoo at wpkg.org
Thu Apr 13 12:37:36 UTC 2017


It might work, but looks like an overkill to me.

Essentially, I want to do:

- full container backup - then restore it, perhaps somewhere else, at 
some point in the future

Can I simply copy /var/lib/lxd/containers/MYCONTAINER to a different 
server an expect it to work? I think it won't work, as lxd maintains its 
database, and if I just copy the container, it won't modify the 
database.


- archive the container and use it in a physically different network

Meaning, one LXD server not able to access the other in any way.



I know I can just create a new container on the destination, stop it, 
then replace "rootfs" with the one from the source system. But it also 
doesn't look "nice enough".


And, we loose any container settings set with all above approaches.


Tomasz Chmielewski
https://lxadm.com





On 2017-04-13 21:28, Ron Kelley wrote:
> What about “lxc publish”?  That should allow you to publish your
> container as an image to your local repository.  Then, you can
> probably use the “lxc image” command to pull it from your repository
> and start it.
> 
> 
> 
> 
>> On Apr 13, 2017, at 8:22 AM, Tomasz Chmielewski <mangoo at wpkg.org> 
>> wrote:
>> 
>> Is there such a thing like "lxc archive / lxc restore"? Or perhaps 
>> "lxc export / lxc import"?
>> 
>> 
>> I have a container called "mycontainer". I would like to "archive" it, 
>> and save to backup.
>> 
>> Then, perhaps a month later, I would like to restore it, on a 
>> different LXD server.
>> 
>> 
>> Right now, the closest command I see there is is "lxc copy".
>> 
>> Unfortunately it requires:
>> 
>> - the copying part needs to be done "now"
>> 
>> - at least one server needs to be able to manage the other server (lxc 
>> remote)
>> 
>> 
>> In other words - how to best achieve:
>> 
>> - tar a selected container
>> 
>> - copy it via SSH somewhere
>> 
>> - restore at some later point in time somewhere else, on a different, 
>> unrelated LXD server
>> 
>> 
>> 
>> Tomasz Chmielewski
>> https://lxadm.com
>> _______________________________________________
>> lxc-users mailing list
>> lxc-users at lists.linuxcontainers.org
>> http://lists.linuxcontainers.org/listinfo/lxc-users
> 
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users


More information about the lxc-users mailing list