[lxc-users] lxc snapshot

Serge Hallyn serge.hallyn at ubuntu.com
Wed Jun 10 14:13:52 UTC 2015


Quoting Mark Constable (markc at renta.net):
> Is there a tutorial or blog post about using lxc snapshot anywhere?
> 
> ~ lxc version
> 0.10
> 
> ~ lxc list
> +------------+---------+---------------+------+-----------+-----------+
> |    NAME    |  STATE  |     IPV4      | IPV6 | EPHEMERAL | SNAPSHOTS |
> +------------+---------+---------------+------+-----------+-----------+
> | sysadm     | RUNNING | 192.168.0.3   |      | NO        | 0         |
> | ubuntu.lxc | RUNNING | 192.168.0.216 |      | NO        | 1         |
> +------------+---------+---------------+------+-----------+-----------+
> 
> ~ lxc snapshot ubuntu.lxc ubuntu_101.lxc

If you do 'lxc list ubuntu.lxc' it should show you the snapshot list,
as should 'lxc info ubuntu.lxc'.  When you ask for >1 container in
list output, then it only shows you the snapshot count as shown above.

> The snapshot does not show up in the above lxc list and I'm not sure how I
> would go about starting it... presuming one can treat a snapshot just like

You should be able to do 'lxc launch ubuntu.lxc/snap0 restored1' to
launch a new container called restored1 based on ubuntu.lxc/snap0.

> the parent container (maybe I misunderstand the purpose of a snapshot.)

You can't start it as though it was a container, but you can create
new container copies of it, and you will be able to publish them as
an image (when lxc publish is implemented)

> ~ lxc info ubuntu.lxc
> Name: ubuntu.lxc
> Status: RUNNING
> Init: 22167
> Ips:
>   eth0:  IPV4   192.168.0.216
>   lo:    IPV4   127.0.0.1
>   lo:    IPV6   ::1
> Snapshots:
>   ubuntu.lxc/ubuntu_101.lxc
> 
> Questions:
> 
> - can I use a snapshot like the parent container?
> - if so how to start and stop it?
> - if not what is the best method to create 100's of containers?
> 
> _______________________________________________
> 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