kvm虚拟机无法删除快照

kvm virtual machine cannot delete a snapshot

我想给win7虚拟机扩容,提示有快照无法扩容,但是快照不能删除

[root@jwf home]# qemu-img resize win7.qcow2 +30G
qemu-img: Can't resize an image which has snapshots
qemu-img: This image does not support resize
[root@jwf home]#

使用qemu-img命令查看快照信息

[root@jwf home]# qemu-img info win7.qcow2
image: win7.qcow2
file format: qcow2
virtual size: 40G (42949672960 bytes)
disk size: 64G
cluster_size: 65536
Snapshot list:
ID        TAG                 VM SIZE                DATE       VM CLOCK
1         clean                     0 2019-10-18 14:41:10   00:00:00.000
Format specific information:
    compat: 1.1
    lazy refcounts: true

但是使用virsh命令看不到快照信息

[root@jwf home]# virsh snapshot-list win7
 Name                 Creation Time             State
------------------------------------------------------------

[root@jwf home]#

无法删除快照

[root@jwf home]# virsh snapshot-delete --domain win7 --snapshotname clean
error: Domain snapshot not found: no domain snapshot with matching name 'clean'
error: Domain snapshot not found: no domain snapshot with matching name 'clean'

[root@jwf home]# virsh snapshot-delete --domain win7 --snapshotname 1
error: Domain snapshot not found: no domain snapshot with matching name '1'
error: Domain snapshot not found: no domain snapshot with matching name '1'

virt-manager中没有显示快照信息。enter image description here

这个虚拟机是我导入的,没有快照配置文件

[root@jwf home]#
[root@jwf home]# ls /var/lib/libvirt/qemu/snapshot/win7/
[root@jwf home]#

有时 virsh 和 qemu 看到的东西不同。这偶尔是因为他们中的一个人是盲人,而不太常见的是因为他们中的一个人出现了幻觉。在这种情况下,我相信 virsh 是盲目的。试试这个:

qemu-img info disk_image
qemu-img snapshot -d snapshot_id disk_image
qemu-img info disk_image