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 1550022

Summary: Migration can't be performed again after tunnelled migration with copy storage fails.
Product: Red Hat Enterprise Linux 7 Reporter: Fangge Jin <fjin>
Component: qemu-kvm-rhevAssignee: Dr. David Alan Gilbert <dgilbert>
Status: CLOSED ERRATA QA Contact: Gu Nini <ngu>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.5CC: chayang, dzheng, hhuang, jdenemar, jen, juzhang, kchamart, lvivier, michen, mrezanin, peterx, qizhu, quintela, virt-maint, xfu, yafu
Target Milestone: alpha   
Target Release: 7.6   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.12.0-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-01 11:06:51 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:

Description Fangge Jin 2018-02-28 10:33:54 UTC
Description of problem:
Migration can't be performed again after tunnelled migration with copy storage fails.

Version-Release number of selected component:
libvirt-3.9.0-13.el7.x86_64
qemu-kvm-rhev-2.10.0-21.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Start a guest with local storage

2. Migrate it with --tunnelled --copy-storage-all, fails
# virsh migrate foo qemu+ssh://intel-i72600-03.qe.lab.eng.nay.redhat.com/system  --live --verbose  --copy-storage-all --p2p --tunnelled
error: internal error: unable to execute QEMU command 'migrate': QEMU compiled without old-style (blk/-b, inc/-i) block migration

3. Migrate it with --copy-storage-all, still fails
# virsh migrate foo qemu+ssh://intel-i72600-03.qe.lab.eng.nay.redhat.com/system  --live --verbose  --copy-storage-all 
Migration: [100 %]error: internal error: unable to execute QEMU command 'migrate-set-capabilities': QEMU compiled without old-style (blk/-b, inc/-i) block migration

4. Migrate it without --copy-storage-all, still fails
# virsh migrate foo qemu+ssh://intel-i72600-03.qe.lab.eng.nay.redhat.com/system  --live --verbose 
error: internal error: unable to execute QEMU command 'migrate-set-capabilities': QEMU compiled without old-style (blk/-b, inc/-i) block migration

5. Save guest, the command hangs .
# virsh managedsave foo

# virsh list
 Id    Name                           State
----------------------------------------------------
 19    foo                            paused

# virsh qemu-monitor-command foo --cmd '{"execute":"query-status"}'
{"return":{"status":"finish-migrate","singlestep":false,"running":false},"id":"libvirt-59"}

# virsh domjobinfo foo
Job type:         Unbounded   
Operation:        Save        
Time elapsed:     0            ms


6. Destroy and start guest again
# virsh destroy foo
# virsh start foo

7.Do migration with --copy-storage-all, succeed:
virsh migrate foo qemu+ssh://intel-i72600-03.qe.lab.eng.nay.redhat.com/system  --live --verbose  --copy-storage-all
Migration: [100 %]


Actual results:
As steps

Expected results:
1. Step2: Tunnelled migration with copy storage should succeed
2. Step3~5: after one migration fails, the following migrations should not be affected

Comment 2 Jiri Denemark 2018-02-28 11:35:33 UTC
Could you please provide libvirtd's debug logs and QEMU logs from both sides of migration (see https://wiki.libvirt.org/page/DebugLogs)?

Comment 3 Dr. David Alan Gilbert 2018-02-28 11:40:33 UTC
yep, can repeat it here:

[root@virtlab402 qemu]# virsh migrate blockmigtest qemu+ssh://ibpair/system --live --verbose --copy-storage-all --p2p --tunnelled
error: internal error: unable to execute QEMU command 'migrate-set-capabilities': QEMU compiled without old-style (blk/-b, inc/-i) block migration

[root@virtlab402 qemu]# virsh migrate blockmigtest qemu+ssh://ibpair/system --live --verbose --copy-storage-all 
Migration: [ 99 %]error: internal error: unable to execute QEMU command 'migrate-set-capabilities': QEMU compiled without old-style (blk/-b, inc/-i) block migration

Comment 4 Dr. David Alan Gilbert 2018-02-28 13:30:59 UTC
Yes, I can confirm this on upstrem as well:

(qemu) migrate -d -b  "exec:cat > /dev/null"
QEMU compiled without old-style (blk/-b, inc/-i) block migration
Use drive_mirror+NBD instead.
(qemu) migrate_set_capability xbzrle off
QEMU compiled without old-style (blk/-b, inc/-i) block migration
Use drive_mirror+NBD instead.
(qemu) migrate -d  "exec:cat > /dev/null"
(qemu) migrate_set_capability xbzrle off
QEMU compiled without old-style (blk/-b, inc/-i) block migration
Use drive_mirror+NBD instead.
(qemu) 


I think we're missing/screwed-up the call to block_cleanup_parameters

Comment 5 Dr. David Alan Gilbert 2018-02-28 16:50:11 UTC
Posted upstream:

  [PATCH] migration: Fix block failure cases

Comment 7 Dr. David Alan Gilbert 2018-03-07 16:53:58 UTC
Instead of my patch, Peter Xu's 'migration: fix applying wrong capabilities' is a better fix here.

Comment 12 Gu Nini 2018-05-08 05:19:16 UTC
With the same steps in the bug description, reproduced the bug on qemu-kvm-rhev-2.10.0-21.el7.x86_64, and verified the bug on qemu-kvm-rhev-2.12.0-1.el7.x86_64.

Comment 13 errata-xmlrpc 2018-11-01 11:06:51 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/RHBA-2018:3443