Bug 2173142
| Summary: | [snapshot] cannot delete snapshot when one of the disk's snapshot mode is 'manual' | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | yisun |
| Component: | libvirt | Assignee: | Pavel Hrdina <phrdina> |
| libvirt sub component: | General | QA Contact: | yisun |
| Status: | VERIFIED --- | Docs Contact: | |
| Severity: | medium | ||
| Priority: | medium | CC: | dzheng, jdenemar, lmen, pkrempa, virt-maint, ymankad |
| Version: | 9.2 | Keywords: | AutomationTriaged, Triaged |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-9.2.0-1.el9 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | Bug | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | 9.2.0 |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1519002 | ||
|
Description
yisun
2023-02-24 07:59:41 UTC
Upstream commit:
commit 22a07239f5ea3d3ccd8a057cf83dcc09d6b7b0f0
Author: Pavel Hrdina <phrdina>
Date: Wed Mar 1 12:51:21 2023 +0100
qemu_snapshot: properly ignore disks with manual snapshot
Preverified with:libvirt-9.2.0-1.el9.x86_64
[root@lenovo-sr630-14 ~]# virsh start vm1
Domain 'vm1' started
[root@lenovo-sr630-14 ~]# virsh domblklist vm1
Target Source
--------------------------------------------------------
vda /var/lib/libvirt/images/jeos-27-x86_64.qcow2
vdb /var/lib/libvirt/images/vdb.qcow2
[root@lenovo-sr630-14 ~]# vim snap.xml
<domainsnapshot>
<description>Snapshot test</description>
<name>snap1</name>
<memory snapshot='external' file='/tmp/mem.dump'/>
<disks>
<disk name='vda' snapshot='manual'/>
<disk name='vdb' snapshot='external'/>
</disks>
</domainsnapshot>
[root@lenovo-sr630-14 ~]# virsh snapshot-create vm1 snap.xml
Domain snapshot snap1 created from 'snap.xml'
[root@lenovo-sr630-14 ~]# virsh domstate vm1
paused
[root@lenovo-sr630-14 ~]# virsh domblklist vm1
Target Source
--------------------------------------------------------
vda /var/lib/libvirt/images/jeos-27-x86_64.qcow2
vdb /var/lib/libvirt/images/vdb.snap1
[root@lenovo-sr630-14 ~]# virsh dumpxml vm1 --xpath //disk
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/var/lib/libvirt/images/jeos-27-x86_64.qcow2" index="2"/>
<backingStore/>
<target dev="vda" bus="virtio"/>
<alias name="virtio-disk0"/>
<address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
</disk>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/var/lib/libvirt/images/vdb.snap1" index="3"/>
<backingStore type="file" index="1">
<format type="qcow2"/>
<source file="/var/lib/libvirt/images/vdb.qcow2"/>
<backingStore/>
</backingStore>
<target dev="vdb" bus="virtio"/>
<alias name="virtio-disk1"/>
<address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>
</disk>
[root@lenovo-sr630-14 ~]# virsh snapshot-delete vm1 snap1
error: Failed to delete snapshot snap1
error: internal error: unable to execute QEMU command 'block-commit': Block node is read-only
[root@lenovo-sr630-14 ~]# virsh resume vm1
Domain 'vm1' resumed
[root@lenovo-sr630-14 ~]# virsh snapshot-delete vm1 snap1
Domain snapshot snap1 deleted
[root@lenovo-sr630-14 ~]# virsh domblklist vm1
Target Source
--------------------------------------------------------
vda /var/lib/libvirt/images/jeos-27-x86_64.qcow2
vdb /var/lib/libvirt/images/vdb.qcow2
[root@lenovo-sr630-14 ~]# virsh dumpxml vm1 --xpath //disk
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/var/lib/libvirt/images/jeos-27-x86_64.qcow2" index="2"/>
<backingStore/>
<target dev="vda" bus="virtio"/>
<alias name="virtio-disk0"/>
<address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
</disk>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/var/lib/libvirt/images/vdb.qcow2" index="1"/>
<backingStore/>
<target dev="vdb" bus="virtio"/>
<alias name="virtio-disk1"/>
<address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>
</disk>
test with libvirt-9.3.0-2.el9.x86_64 and result is PASS |