1. 参数
[root@jorelSpace ~]# virsh help snapshot
Snapshot (help keyword 'snapshot'):
snapshot-create Create a snapshot from XML
snapshot-create-as Create a snapshot from a set of args
snapshot-current Get or set the current snapshot
snapshot-delete Delete a domain snapshot
snapshot-dumpxml Dump XML for a domain snapshot
snapshot-edit edit XML for a snapshot
snapshot-info snapshot information
snapshot-list List snapshots for a domain
snapshot-parent Get the name of the parent of a snapshot
snapshot-revert Revert a domain to a snapshot
2. 创建快照
k8s-master1:虚拟机名
init:快照名
virsh snapshot-create-as k8s-master1 init
3. 查看快照
[root@jorelSpace ~]# virsh snapshot-list k8s-master1
Name Creation Time State
---------------------------------------------
init 2023-12-16 23:30:14 +0800 running
test 2023-12-16 23:36:25 +0800 running
4. 删除快照
virsh snapshot-delete k8s-master1 test
5. 恢复快照
virsh snapshot-revert k8s-master1 init
6. 快照位置
/var/lib/libvirt/qemu/snapshot
7. 快照信息(xml)
virsh snapshot-current test