[root@kvm /opt]# virsh start web01
Domain web01 started
[root@kvm /opt]# virsh console web01
Connected to domain web01
Escape character is ^]
CentOS Linux 7 (Core)
Kernel 3.10.0-957.el7.x86_64 on an x86_64
kvm login: root
Password:
Last login: Thu Jul 30 04:57:19 from 10.0.0.1
[root@kvm ~]#
[root@kvm ~]# ls /
bin data etc lib media opt root sbin sys usr
boot dev home lib64 mnt proc run srv tmp var
[root@kvm ~]# rm -rf /*
[root@kvm ~]# ls
-bash: /bin/ls: No such file or directory
3.恢复快照
#查看虚拟机快照列表
[root@kvm /opt]# virsh snapshot-list web01
Name Creation Time State
------------------------------------------------------------
1596093787 2020-07-30 15:23:07 +0800 running
1596114702 2020-07-30 21:11:42 +0800 shutoff
#恢复快照
[root@kvm /opt]# virsh snapshot-revert web01 1596114702
4.测试
[root@kvm /opt]# virsh start web01
Domain web01 started
[root@kvm /opt]# virsh console web01
Connected to domain web01
Escape character is ^]
CentOS Linux 7 (Core)
Kernel 3.10.0-957.el7.x86_64 on an x86_64
kvm login: root
Password:
Last login: Thu Jul 30 04:57:19 from 10.0.0.1
[root@kvm ~]# ls
anaconda-ks.cfg
[root@kvm ~]# ls /
bin data etc lib media opt root sbin sys usr
boot dev home lib64 mnt proc run srv tmp var
5.删除快照
[root@kvm /opt]# virsh snapshot-list web01
Name Creation Time State
------------------------------------------------------------
1596093787 2020-07-30 15:23:07 +0800 running
1596114702 2020-07-30 21:11:42 +0800 shutoff
[root@kvm /opt]# virsh snapshot-delete web01 1596093787
Domain snapshot 1596093787 deleted
[root@kvm /opt]# virsh snapshot-list web01
Name Creation Time State
------------------------------------------------------------
1596114702 2020-07-30 21:11:42 +0800 shutoff
[root@kvm /opt]# ll /var/lib/libvirt/qemu/snapshot/web01/
total 8
-rw------- 1 root root 4855 Jul 30 21:24 1596114702.xml
I have read your article carefully and I agree with you very much. This has provided a great help for my thesis writing, and I will seriously improve it. However, I don't know much about a certain place. Can you help me?