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 1371749 - virsh migrate --copy-storage-all genrates a qcow2v2 image on target even if qcow2v3 image is used on source
Summary: virsh migrate --copy-storage-all genrates a qcow2v2 image on target even if q...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: zhe peng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-31 02:28 UTC by Yang Yang
Modified: 2017-04-25 08:48 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-04-25 08:48:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Yang Yang 2016-08-31 02:28:44 UTC
Description of problem:
I have a running vm using qcow2v3 image on source host. I migrate vm
with copy-storage-all flag. After migration, libvirt generates a qcow2v2 image
on target host.

Version-Release number of selected component (if applicable):
on both source and target:
libvirt-2.0.0-6.el7.x86_64
qemu-kvm-rhev-2.6.0-22.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. start vm with qcow2v3 image on source

# qemu-img info /var/lib/libvirt/images/RHEL-7.3-latest.qcow2
image: /var/lib/libvirt/images/RHEL-7.3-latest.qcow2
file format: qcow2
virtual size: 5.0G (5368709120 bytes)
disk size: 1.3G
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16

<disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' io='threads' ioeventfd='on' event_idx='off' detect_zeroes='on'/>
      <source file='/var/lib/libvirt/images/RHEL-7.3-latest.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
    </disk>

# virsh start vm-mig
Domain vm-mig started

2. migrate vm with copy-storage-all flag
# virsh migrate vm-mig qemu+ssh://hp-dl385g7-05.lab.eng.pek2.redhat.com/system --verbose --live --unsafe --copy-storage-all
root.eng.pek2.redhat.com's password:
Migration: [100 %]

3. check image on target
# qemu-img info /var/lib/libvirt/images/RHEL-7.3-latest.qcow2
image: /var/lib/libvirt/images/RHEL-7.3-latest.qcow2
file format: qcow2
virtual size: 5.0G (5368709120 bytes)
disk size: 5.0G
cluster_size: 65536
Format specific information:
    compat: 0.10
    refcount bits: 16


Actual result:
virsh migrate --copy-storage-all genrates a qcow2v2 image on target even if qcow2v3 image is used on source

Expected result:
Images on both source and target should keep identical

Additional info:
Addressed libvirtd.log on target host:

2016-08-30 04:43:03.597+0000: 1744: debug : qemuMigrationPrecreateStorage:1687 : Looking up disk target 'vda' (capacity=5368709120)
2016-08-30 04:43:03.598+0000: 1744: debug : qemuMigrationPrecreateStorage:1712 : Proceeding with disk source /var/lib/libvirt/images/RHEL-7.3-latest.qcow2
2016-08-30 04:43:03.598+0000: 1744: debug : qemuMigrationPrecreateDisk:1553 : Precreate disk type=file
2016-08-30 04:43:03.598+0000: 1744: info : virObjectNew:202 : OBJECT_NEW: obj=0x7f7be000e420 classname=virStoragePool
2016-08-30 04:43:03.598+0000: 1744: info : virObjectRef:296 : OBJECT_REF: obj=0x7f7bdc001870
2016-08-30 04:43:03.598+0000: 1744: debug : virStorageVolLookupByName:1293 : pool=0x7f7be000e420, name=RHEL-7.3-latest.qcow2
2016-08-30 04:43:03.598+0000: 1744: debug : storageVolLookupByName:1528 : Storage volume not found: no storage vol with matching name 'RHEL-7.3-latest.qcow2'
2016-08-30 04:43:03.598+0000: 1744: debug : virStorageVolCreateXML:1466 : pool=0x7f7be000e420, xmlDesc=<volume>
  <name>RHEL-7.3-latest.qcow2</name>
  <capacity>5368709120</capacity>
  <target>
    <format type='qcow2'/>
  </target>
</volume>
, flags=1
2016-08-30 04:43:03.624+0000: 1744: debug : virCommandRunAsync:2429 : About to run /usr/local/bin/qemu-img create -f qcow2 -o preallocation=metadata,compat=0.10 /var/lib/libvirt/images/RHEL-7.3-latest.qcow2 5242880K
2016-08-30 04:43:03.626+0000: 1744: debug : virFileClose:102 : Closed fd 26
2016-08-30 04:43:03.626+0000: 1744: debug : virFileClose:102 : Closed fd 29
2016-08-30 04:43:03.627+0000: 1744: debug : virFileClose:102 : Closed fd 31
2016-08-30 04:43:03.627+0000: 1744: debug : virCommandRunAsync:2432 : Command result 0, with PID 14872
2016-08-30 04:43:03.760+0000: 1744: debug : virCommandRun:2280 : Result status 0, stdout: 'Formatting '/var/lib/libvirt/images/RHEL-7.3-latest.qcow2', fmt=qcow2 size=5368709120 compat=0.10 encryption=off cluster_size=65536 preallocation=metadata lazy_refcounts=off refcount_bits=16
' stderr: '2016-08-30 04:43:03.633+0000: 14872: debug : virFileClose:102 : Closed fd 29
2016-08-30 04:43:03.633+0000: 14872: debug : virFileClose:102 : Closed fd 31
2016-08-30 04:43:03.633+0000: 14872: debug : virFileClose:102 : Closed fd 26
'
2016-08-30 04:43:03.760+0000: 1744: debug : virFileClose:102 : Closed fd 27
2016-08-30 04:43:03.760+0000: 1744: debug : virFileClose:102 : Closed fd 30
2016-08-30 04:43:03.762+0000: 1744: debug : virStorageFileGetMetadataInternal:937 : path=/var/lib/libvirt/images/RHEL-7.3-latest.qcow2, buf=0x7f7be0017ac0, len=33280, meta->format=14
2016-08-30 04:43:03.762+0000: 1744: info : storageVolCreateXML:1996 : Creating volume 'RHEL-7.3-latest.qcow2' in storage pool 'default'
2016-08-30 04:43:03.762+0000: 1744: info : virObjectUnref:259 : OBJECT_UNREF: obj=0x7f7be00177c0
2016-08-30 04:43:03.762+0000: 1744: info : virObjectUnref:261 : OBJECT_DISPOSE: obj=0x7f7be00177c0
2016-08-30 04:43:03.762+0000: 1744: debug : virStorageVolDispose:589 : release vol 0x7f7be00177c0 RHEL-7.3-latest.qcow2

Comment 3 Michal Privoznik 2017-04-12 08:30:31 UTC
Now that I'm thinking about this, is this really a problem? I mean, with storage migration the whole backing chain is flattened, so different compat version is the least problem. Therefore I'm inclined to close this. Any objections?

Comment 4 Michal Privoznik 2017-04-25 08:48:36 UTC
Okay. I'm closing this one. If somebody feel otherwise, please feel free to reopen and state why this matters.


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