I want to avoid wasting the state of my present app working on LXD earlier than I push new Python-based app. How do I create snapshots with lxc command for LXD based mostly Linux container?
Introduction – LXD Linux system container supervisor. It provides a person expertise corresponding to digital machines however utilizing Linux containers as a substitute. There isn’t a VM like overheads. This web page reveals learn how to make snapshots with LXD and restore them if the necessity arises.
Process to create snapshots with lxc for LXD
To make a snapshot for LXD, run: lxc snapshot containerName Create a snapshot named backup01 for Linux container named www1 utilizing the lxc command: lxc snapshot www1 backup01Restore LXD container named www2 from snapshots named snap2, on Linux: lxc restore www2 snap2
Allow us to see examples and utilization in derails.
Learn how to create the LXD snapshot utilizing lxc
The syntax is:
lxc snapshot container snapshot-name
Subsequent, create the LXD snapshot:
$ lxc snapshot utls-newsletter snap-04-jan-2019
Confirm snapsots or see information about snapshots:
$ lxc information utls-newsletter
Linux create snapshots with lxc command for LXD
Normally, I cease container earlier than taking snapshots:
lxc cease www42
lxc snapshot www42 snap01
lxc begin www42
Learn how to restore the LXD snapshot utilizing lxc
The syntax is:
lxc restore container snapshot-name
Restore the LXD snapshot:
lxc restore www42 snap01
Learn how to delete the LXD snapshot utilizing lxc command
Once more the syntax is:
lxc delete container/snapshot-name}
To drive person affirmation go the -i choice:
lxc delete container/snapshot-name} -i
Say you need to delete the LXD snapshot named snap-04-jan-2019 for utls-newsletter container, run:
$ lxc delete utls-newsletter/snap-04-jan-2019 -i
$ lxc delete utls-newsletter/snap-04-jan-2019
Linux delete the LXD snapshot utilizing lxc command
Use the next instructions to create, delete and restore snapshots for the LXD working on Linux.
lxc commandDescription for LXDExample(s)lxc snapshot container snapshotCreate a snapshotlxc snapshot www-c1 snap01lxc restore container snapshotRestore the snapshotlxc restore www-c1 snap01lxc information containerGet the container info together with snapshot infolxc www-c1lxc delete container/snapshotDelete the snapshotlxc delete www-c1/snap01