Table of Contents |
---|
Introduction
You must finish the LXC and LXC with Advanced Networking before starting this article.
...
Code Block | ||
---|---|---|
| ||
lxc list +-------+---------+------+------+------------+-----------+ | NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | +-------+---------+------+------+------------+-----------+ | web01 | STOPPED | | | PERSISTENT | 0 | +-------+---------+------+------+------------+-----------+ |
...
Semi-Live Approach
...
Taking Snapshots
Snapshots are a great way to backup a container before upgrading or changing any files that will break a container.
Code Block | ||
---|---|---|
| ||
lxc snapshot container01 snapshotname01 |
Using lxc list will show that your container now has a snapshot.
Code Block | ||
---|---|---|
| ||
lxc list
+-------------+---------+------+------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+-------------+---------+------+------+------------+-----------+
| container01 | STOPPED | | | PERSISTENT | 1 |
+-------------+---------+------+------+------------+-----------+ |
The snapshot name can be viewed using the lxc info command
Code Block | ||
---|---|---|
| ||
lxc info container01
Name: container01
Remote: https://192.168.0.109:8443
Architecture: x86_64
...
Snapshots:
snapshotname01 (taken at 2017/02/02 15:33 UTC) (stateless) |
To restore a snapshot
Code Block | ||
---|---|---|
| ||
lxc restore container01 snapshotname01 |
Renaming a snapshot
Moving Containers
With copy, the new container is identical in every way except no snapshots and volatile keys (ie MAC address and hostnames) will be regenerated.
...