Snapshots of virtual machines

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 :
Here Insert Picture Description
create a snapshot
Here Insert Picture Description
manually import the snapshot
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
results are as follows:
Here Insert Picture Description
Here Insert Picture Description
the difference between a snapshot and mastering the
snapshot lot smaller than the master
Here Insert Picture Description
Here Insert Picture Description
script to create a snapshot (no manual import)
test as follows:
(1)

vim  snap.sh       编辑一个sh文件

Here Insert Picture Description
(2) which is written in the file;
Here Insert Picture Description
(3) Test:
Here Insert Picture Description
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/weixin_43592835/article/details/89518735