Virtual machine snapshots, is to create a new virtual machine to a virtual machine as a template.
We can for this virtual machine will perform a series of operations, neither destroy the original virtual machine, and if accidentally broke a snapshot of the virtual machine, you can also create a new snapshot based on the original virtual machine, you can also re set the virtual machine. Sample sizes snapshot of the master disc, which also provides a great convenience.
So how do you create a snapshot, there are two ways to create a snapshot.
Command to create a snapshot (need to manually import)
First you need to have a virtual machine already installed
master: a snapshot of the hard disk file
execution qemu-ing create command test.qcow2 as a master, creating a snapshot file node1.qcow2
qemu-img create -f 类型 -b 母盘路径名称 快照路径名称
qemu-img create -f qcow2 -b /var/lib/libvirt/images/test.qcow2
/var/lib/libvirt/images/node1.qcow2 specific operation is as follows (real machine operation inside):
See existing virtual hard disk :
create a snapshot
manually import the snapshot
results are as follows:
the difference between a snapshot and mastering the
snapshot lot smaller than the master
script to create a snapshot (no manual import)
test as follows:
(1)
vim snap.sh 编辑一个sh文件
(2) which is written in the file;
(3) Test: