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 1025699 - libvirtd doesn't use a port from the migration range for NBD migration
Summary: libvirtd doesn't use a port from the migration range for NBD migration
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-01 10:32 UTC by Ján Tomko
Modified: 2014-06-18 00:58 UTC (History)
5 users (show)

Fixed In Version: libvirt-1.1.1-12.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 11:56:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ján Tomko 2013-11-01 10:32:43 UTC
Description of problem:
When doing a migration via NBD, libvirtd on the destination chooses a port from the display range (>5900) instead of the migration range (defaults to 49152-49215)

Version-Release number of selected component (if applicable):
libvirt-1.1.1-10.el7

How reproducible:
100%

Steps to Reproduce:
1. Configure the firewall on the destination to reject incoming connections to the graphics port range, but accept connections the migration range.
2. migrate a domain with --copy-storage-all:
virsh migrate --live --copy-storage-all domain qemu+ssh://destination/system

(Alternatively, enable debug logs and look for the NBD port in the migration cookie: <nbd port='49153'/>)

Actual results:
error: internal error: unable to execute QEMU command 'drive-mirror': Failed to connect to socket: Permission denied

Expected results:
Domain migrates.

Additional info:
Upstream patch posted:
https://www.redhat.com/archives/libvir-list/2013-October/msg01319.html

Comment 1 Ján Tomko 2013-11-01 11:09:47 UTC
Now pushed upstream:
commit 3e1e16aa8d4238241a1806cb9bdb3b9ad60db777
Author:     Ján Tomko <jtomko>
AuthorDate: 2013-10-31 13:19:29 +0100
Commit:     Ján Tomko <jtomko>
CommitDate: 2013-11-01 12:07:12 +0100

    Use a port from the migration range for NBD as well
    
    Instead of using a port from the remote display range.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1025699

git describe: v1.1.4-rc2-1-g3e1e16a

Comment 4 zhenfeng wang 2013-11-12 11:15:35 UTC
Verify this bug on libvirt-1.1.1-12.el7, first i can reproduce this bug on libvirt-1.1.1-10.el7, the reproduce steps as the follwoing

1.Start a guest on source host which image is on local disk(without shared with target host)

source# virsh list 
 Id    Name                           State
----------------------------------------------------
 15    rhel7                          running

2.Create a empty image on target host with the same size, directory and name as in source host

target# qemu-img create /IMAGE_DIR/guest.img IMAGE_SIZE

3. Configure the firewall on the destination to reject incoming connections to the graphics port range, but accept connections the migration range
target# iptables -A INPUT  -d localhost -p tcp --dport 49215:65535 -j DROP
target# iptables -A INPUT  -d localhost -p tcp --dport 5900:49151 -j DROP
target# iptables -A INPUT  -d localhost -p tcp --dport 49152:49215 -j ACCEPT

target# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
DROP       tcp  --  anywhere                                  tcp dpts:49215:65535
DROP       tcp  --  anywhere                                  tcp dpts:rfb:49151
ACCEPT     tcp  --  anywhere                                  tcp dpts:49152:49215

4.Migrate the guest to the target, will fail to migrate the guest to the target
source# virsh migrate --live rhel7 --copy-storage-all qemu+ssh://$targetip/system --verbose
error: internal error: unable to execute QEMU command 'drive-mirror': Failed to connect to socket: Connection timed out

check the nbd debug logs in the target host, find the nbd server chooses a port from the display range (>5900) instead of the migration range
2013-11-12 09:44:31.651+0000: 12125: debug : qemuMonitorNBDServerStart:3740 : mon=0x7f8268002ed0 host=:: port=5901

Verify this bug with libvirt-1.1.1-12.el7, the verify steps as the following

steps 
1~3 were the same with the reproduce steps
4.Migrate the guest to the target, will successfully migrate the guest to the target
source# virsh migrate --live rhel7 --copy-storage-all qemu+ssh://$targetip/system --verbose
Migration: [100 %]

5.check the guest info in the target 
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 2     rhel7                          running

ps aux|grep kvm
qemu     14139 29.4  0.9 2674096 310820 ?      Sl   18:10   0:20 /usr/libexec/qemu-kvm -name rhel7 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 1024 - - - 
-incoming tcp:[::]:49152 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 

check the libvirtd.log in the target
2013-11-12 09:40:56.494+0000: 11548: debug : qemuMonitorNBDServerStart:3740 : mon=0x7f526400e030 host=:: port=49153

According to the upper steps , this bug can be moved verifed

Comment 5 Ludek Smid 2014-06-13 11:56:42 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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