RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1106416 - No internal snapshot should be created when guest xml with snapshot='no'
Summary: No internal snapshot should be created when guest xml with snapshot='no'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Han Han
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-09 09:48 UTC by Shanzhi Yu
Modified: 2017-08-02 01:25 UTC (History)
8 users (show)

Fixed In Version: libvirt-2.5.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 17:06:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Verification script (1.53 KB, application/x-shellscript)
2017-03-09 07:05 UTC, Han Han
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1430642 0 unspecified CLOSED [RFE] virt-install: add snapshot attribute for disk 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHEA-2017:1846 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2017-08-01 18:02:50 UTC

Internal Links: 1430642

Description Shanzhi Yu 2014-06-09 09:48:49 UTC
Description of problem:

No internal snapshot should be created when guest xml with snapshot='no'

Version-Release number of selected component (if applicable):

libvirt-1.1.1-29.el7.x86_64

How reproducible:

100%

Steps to Reproduce:

1.define an guest with snapshot='no' in xml 

#virsh dumpxml rhel6|grep disk -A 3
    <disk type='file' device='disk' snapshot='no'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/kvm-rhel6.5-x86_64-qcow2.img'/>
      <target dev='vda' bus='virtio'/>
..

2. keep guest shut off status and do internal disk snapshot

# virsh snapshot-create-as rhel6 s1 
Domain snapshot s1 created

# virsh snapshot-dumpxml rhel6 s1 
<domainsnapshot>
  <name>s1</name>
  <state>shutoff</state>
  <creationTime>1402301229</creationTime>
  <memory snapshot='no'/>
  <disks>
    <disk name='vda' snapshot='no'/>
  </disks>
  <domain type='kvm'>
    <name>rhel6</name>
..
</domainsnapshot>

# qemu-img info /var/lib/libvirt/images/kvm-rhel6.5-x86_64-qcow2.img
image: /var/lib/libvirt/images/kvm-rhel6.5-x86_64-qcow2.img
file format: qcow2
virtual size: 3.9G (4194304000 bytes)
disk size: 2.7G
cluster_size: 65536
Snapshot list:
ID        TAG                 VM SIZE                DATE       VM CLOCK
1         s1                        0 2014-06-09 16:07:09   00:00:00.000
Format specific information:
    compat: 0.10



Actual results:


Expected results:

No snapshot should be created in step 2

Additional info:

Comment 3 Eric Blake 2015-07-28 15:39:40 UTC
Peter may have already fixed this; if not, it should be an easy analysis and fix.

Comment 4 Peter Krempa 2015-09-11 19:12:44 UTC
Internal snapshots are still created with with the old monitor API that does not support skipping certain disks for internal snapshot. We will need to implement the support for blockdev-snapshot-internal-sync to achieve this functionality.

Comment 7 Peter Krempa 2016-10-10 03:27:05 UTC
This was already fixed a while ago:

commit 91b7e06865d8f630f2ac9e07435ba92520248af4
Author: Peter Krempa <pkrempa>
Date:   Tue May 20 14:22:25 2014 +0200

    qemu: snapshot: Forbid empty snapshots
    
    If neither disks nor memory are selected for snapshot we'd record
    metadata in case of external snapshot and do a disk snapshot in case of
    external disk snapshot. Forbid this as it doesn't make much sense.

additionally, commit:

commit 03b4da131a95e4cc83cfdfcf21a701ba3ca04a5e
Author: Peter Krempa <pkrempa>
Date:   Tue May 20 14:04:23 2014 +0200

    qemu: snapshot: Forbid partial internal snapshots
    
    qemu's savevm command does a snapshot of all non readonly disks of a VM.
    Libvirt though allowed disabling snapshot for certain disk of a VM.

disallows partial internal snapshots since it's not currently possible.

Comment 9 Han Han 2017-03-09 05:46:51 UTC
Verified on libvirt-3.1.0-2.el7.x86_64:
1. Prepare an inactive guest with snapshot='no':
+ virsh dumpxml BZ1106416
+ awk '/<disk/,/<\/disk/'
    <disk type='file' device='disk' snapshot='no'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/BZ1106416.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>

2. Try to create internal snapshot when VM is inactive:
+ virsh snapshot-create-as BZ1106416 s1
error: unsupported configuration: nothing selected for snapshot

+ virsh dumpxml BZ1106416
+ awk '/<disk/,/<\/disk/'
    <disk type='file' device='disk' snapshot='no'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/BZ1106416.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>

3. Try to create internal snapshot when VM is active:
+ virsh start BZ1106416
Domain BZ1106416 started

+ virsh snapshot-create-as BZ1106416 s1
error: unsupported configuration: internal snapshots and checkpoints require all disks to be selected for snapshot

+ virsh dumpxml BZ1106416
+ awk '/<disk/,/<\/disk/'
    <disk type='file' device='disk' snapshot='no'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/BZ1106416.qcow2'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>

The result is expected.

4. Set disk as readonly mode, rerun as step1~3. Get the same result when creating internal snapshot.
Bug verified.

Comment 10 Han Han 2017-03-09 07:05:26 UTC
Created attachment 1261448 [details]
Verification script

Comment 11 errata-xmlrpc 2017-08-01 17:06:41 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:1846

Comment 12 errata-xmlrpc 2017-08-01 23:48:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:1846

Comment 13 errata-xmlrpc 2017-08-02 01:25:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:1846


Note You need to log in before you can comment on or make changes to this bug.