Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 913410

Summary: Issues with migrating using copy-storage-all and --copy-storage-inc
Product: Red Hat Enterprise Linux 6 Reporter: hongming <honzhang>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 6.4CC: acathrow, cwei, dyuan, jdenemar, mzhan
Target Milestone: rcKeywords: Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-04 20:58:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
debug log for issue b
none
error in guest
none
debug log for source and target host none

Description hongming 2013-02-21 08:26:43 UTC
Description of problem:
There are some issues with migrating using copy-storage-all and --copy-storage-inc.
a) copy-storage-all and  copy-storage-inc should be mutually exclusive 
b) when cancel the migration with ctrl+c during --copy-storage-xxx migration, then migration again will cause domain destroyed
c) copy-storage-inc flag can work for migrating a guest with raw disk and without backing file.

Version-Release number of selected component (if applicable):
libvirt-0.10.2-18.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.355.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
a) 

# virsh start rhel64
Domain rhel64 started


# virsh migrate --verbose --live --persistent rhel64 qemu+ssh://10.66.6.168/system --copy-storage-all --copy-storage-inc
root.6.168's password:
Migration: [100 %] 


b)

# virsh start rhel6.3
Domain rhel6.3 started

# virsh migrate --verbose --live --persistent rhel6.3 qemu+ssh://10.66.6.76/system --copy-storage-inc
root.6.76's password: 
Migration: [  9 %]^Cerror: operation aborted: migration job: canceled by client

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 28    rhel6.3                        running


# virsh migrate --verbose --live --persistent rhel6.3 qemu+ssh://10.66.6.76/system --copy-storage-inc
root.6.76's password: 
error: Unable to read from monitor: Connection reset by peer

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     rhel6.3                        shut off

c)
# virsh start rhel63-new
Domain rhel63-new started

# virsh dumpxml rhel63-new |grep "source file"
      <source file='/var/lib/libvirt/images/rhel63-new.img'/>

# qemu-img info /var/lib/libvirt/images/rhel63-new.img
image: /var/lib/libvirt/images/rhel63-new.img
file format: raw
virtual size: 8.0G (8589934592 bytes)
disk size: 8.0G

# virsh migrate --verbose --live --persistent rhel63-new qemu+ssh://10.66.6.76/system --copy-storage-inc
root.6.76's password: 
Migration: [100 %]

  
Actual results:
as above 

Expected results:
a)copy-storage-all and  copy-storage-inc should be mutually exclusive
b)domain works fine
c)check disk format and backing file.

Additional info:

Comment 1 hongming 2013-02-21 08:35:12 UTC
Created attachment 700393 [details]
debug log for issue b

debug log for issue b attached

Comment 2 Michal Privoznik 2013-02-26 16:38:31 UTC
For issue a) I've proposed patch upstream:

https://www.redhat.com/archives/libvir-list/2013-February/msg01481.html

For issue b) I think it's actually qemu bug:

2013-02-21 08:13:24.962+0000: 9552: error : qemuMonitorIORead:513 : Unable to read from monitor: Connection reset by peer
2013-02-21 08:13:24.962+0000: 9552: debug : qemuMonitorIO:646 : Error on monitor Unable to read from monitor: Connection reset by peer
2013-02-21 08:13:24.962+0000: 9552: debug : virEventPollUpdateHandle:146 : EVENT_POLL_UPDATE_HANDLE: watch=40 events=12
2013-02-21 08:13:24.962+0000: 9552: debug : virEventPollInterruptLocked:697 : Skip interrupt, 1 -747411360
2013-02-21 08:13:24.962+0000: 9552: debug : virObjectUnref:135 : OBJECT_UNREF: obj=0x7f4ab801a640
2013-02-21 08:13:24.962+0000: 9552: debug : qemuMonitorIO:680 : Triggering error callback
2013-02-21 08:13:24.962+0000: 9552: debug : qemuProcessHandleMonitorError:342 : Received error on 0x7f4ab810bae0 'rhel6.3'

Qemu simply dies right after 'migrate' command is isued to it.

For issue c) I don't think this acutally is a problem - if your data has been copied I don't see any problem in using incremental mode.

Comment 3 hongming 2013-02-27 06:37:23 UTC
For issue c , There are the following problems about it.

1) The guest image doesn't has the shared base image (backing file)

# qemu-img info /var/lib/libvirt/images/rhel63-new.img
image: /var/lib/libvirt/images/rhel63-new.img
file format: raw
virtual size: 8.0G (8589934592 bytes)
disk size: 8.0G
  
2) The format of guest image is raw. If a image has backing file , its format should be qcow2.

for example 
# qemu-img create -f raw -o backing_file=/var/base.img /var/images/increment.img
Unknown option 'backing_file'
Invalid options for file format 'raw'.

qemu-img create -f qcow2 -o backing_file=/var/base.img /var/increment.img
Formatting '/var/increment.img', fmt=qcow2 size=8589934592 backing_file='/var/base.img' encryption=off cluster_size=65536


There isn't any precondition for migration with copy-storage-inc.

--copy-storage-inc  migration with non-shared storage with incremental copy (same base image shared between source and destination)


3)Although libvirt display migration is successfully finished, it is actually failed to migrate.

On source host 

qemu-img info /var/lib/libvirt/images/rhel63-new.img
image: /var/lib/libvirt/images/rhel63-new.img
file format: raw
virtual size: 8.0G (8589934592 bytes)
disk size: 8.0G


On target host 
After migration is finished . check the guest img .
 
# qemu-img info /var/lib/libvirt/images/rhel63-new.img
image: /var/lib/libvirt/images/rhel63-new.img
file format: qcow2
virtual size: 8.0G (8589934592 bytes)
disk size: 140K
cluster_size: 65536

Login guest. the attached error occurs.

Comment 4 hongming 2013-02-27 06:41:20 UTC
Created attachment 703283 [details]
error in guest

Comment 5 hongming 2013-02-27 07:30:25 UTC
For issue b , File the following bug to qemu-kvm
Bug 916067 - when cancel the migration with ctrl+c during block migration(full disk copy or incremental disk copy), then migration again will cause domain destroyed

Comment 6 Michal Privoznik 2013-03-01 08:05:47 UTC
(In reply to comment #3)
> For issue c , There are the following problems about it.
> 
> 1) The guest image doesn't has the shared base image (backing file)
> 
> # qemu-img info /var/lib/libvirt/images/rhel63-new.img
> image: /var/lib/libvirt/images/rhel63-new.img
> file format: raw
> virtual size: 8.0G (8589934592 bytes)
> disk size: 8.0G
>   
> 2) The format of guest image is raw. If a image has backing file , its
> format should be qcow2.
> 
> for example 
> # qemu-img create -f raw -o backing_file=/var/base.img
> /var/images/increment.img
> Unknown option 'backing_file'
> Invalid options for file format 'raw'.
> 
> qemu-img create -f qcow2 -o backing_file=/var/base.img /var/increment.img
> Formatting '/var/increment.img', fmt=qcow2 size=8589934592
> backing_file='/var/base.img' encryption=off cluster_size=65536
> 
> 
> There isn't any precondition for migration with copy-storage-inc.
> 
> --copy-storage-inc  migration with non-shared storage with incremental copy
> (same base image shared between source and destination)
> 
> 
> 3)Although libvirt display migration is successfully finished, it is
> actually failed to migrate.
> 
> On source host 
> 
> qemu-img info /var/lib/libvirt/images/rhel63-new.img
> image: /var/lib/libvirt/images/rhel63-new.img
> file format: raw
> virtual size: 8.0G (8589934592 bytes)
> disk size: 8.0G
> 
> 
> On target host 
> After migration is finished . check the guest img .
>  
> # qemu-img info /var/lib/libvirt/images/rhel63-new.img
> image: /var/lib/libvirt/images/rhel63-new.img
> file format: qcow2
> virtual size: 8.0G (8589934592 bytes)
> disk size: 140K
> cluster_size: 65536
> 
> Login guest. the attached error occurs.

Can yo attach libvirt debug logs from both source and destination? You know one of the assumption is you have pre-created storage manually, right?

Comment 7 hongming 2013-03-01 08:51:09 UTC
Yes , If don't pre-created storage manulally , the migration can't start.

For issue c . Add more detailed steps. And attached debug log.

On source host

# virsh start rhel63-new
Domain rhel63-new started

# virsh dumpxml rhel63-new|grep "source file"
      <source file='/var/lib/libvirt/images/rhel63-new.img'/>

# qemu-img info /var/lib/libvirt/images/rhel63-new.img
image: /var/lib/libvirt/images/rhel63-new.img
file format: raw
virtual size: 8.0G (8589934592 bytes)
disk size: 8.0G

# virsh migrate --verbose --live --persistent rhel63-new qemu+ssh://10.66.6.76/system 
root.6.76's password: 
Migration: [100 %]
===============================================================================
On target host
Before migration start 

# qemu-img create -f qcow2 rhel63-new.img 8G
Formatting 'rhel63-new.img', fmt=qcow2 size=8589934592 encryption=off cluster_size=65536 


After migration
# virsh list 
 Id    Name                           State
----------------------------------------------------
 18    rhel63-new                     running

Comment 8 hongming 2013-03-01 08:58:37 UTC
Created attachment 704090 [details]
debug log for source and target host

Comment 9 hongming 2013-03-01 09:02:13 UTC
Sorry, about migration step should be the following . I made a type when do cope -paste.

# virsh migrate --verbose --live --persistent rhel63-new qemu+ssh://10.66.6.76/system --copy-storage-inc
root.6.76's password: 
Migration: [100 %]

Comment 10 Michal Privoznik 2013-03-04 10:54:06 UTC
From the log I'd say it's not a libvirt issue. I mean, qemu is supposed to fall back to full copy even if you start migration with incremental one. In fact, that's the only reasonable thing to do when we are not allowed to mark only a subset of disks which we want to migrate. So, in case where you have both raw and qcow2 images, qemu should copy qcow2 incrementally and do a full copy on raw. Or in your case - just do a full copy. If it is not working - I'd say it's a qemu bug. NB in upstream we have reworked this to support NBD migration which is turned on every time we detect qemu supports it.

Comment 12 Jiri Denemark 2013-07-08 14:29:20 UTC
We decided not to rebase libvirt in RHEL 6.5 to avoid stability issues
we faced in 6.4. This bug has already been trivially fixed upstream but
it is not considered important enough to be backported to RHEL 6.5.

Thus I'm pushing this bug to RHEL 6.6 (and setting Upstream keyword to
indicate we have patches upstream) for now. If you don't agree with
this resolution, please, give us reasons which you think are strong
enough for us to reevaluate the decision not to backport patches for
this bug.

Comment 15 RHEL Program Management 2014-04-04 20:58:49 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.