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.
Description of the problem:
libvirt reserve the port setting in the guest xml when vnc_auto_unix_socket takes effect, it will make migration failed when the target host has the same port used by another guest.
How producible
100%
Version:
libvirt-2.0.0-4.el7.x86_64
Steps to reproduce:
1.Enable vnc_auto_unix_socket in the qemu.conf and restart libvirtd service:
#cat /etc/libvirt/qemu.conf
...
vnc_auto_unix_socket=1
...
#systemctl restart libvirtd.service
2.Start a guest with vnc setting as follows:
#virsh edit mig1
...
<graphics type='vnc' port='5900' autoport='no'>
<listen type='address'/>
</graphics>
...
3.The live xml of guest mig1:
#virsh dumpxml mig1
...
<graphics type='vnc' socket='/var/lib/libvirt/qemu/domain-572-mig1/vnc.sock'>
<listen type='socket' socket='/var/lib/libvirt/qemu/domain-572-mig1/vnc.sock'/>
</graphics>
...
4. Check the port usage on the host, find that 5900 is not used:
#netstat -tunlp
5.Start another guest mig2 with vnc setting as step2:
#virsh start mig2
error: Failed to start domain mig2
error: internal error: Failed to reserve port 5900
Actual results:
libvirt reserve port for the guest even the vnc_auto_unix_socket take effect and the guest using socket listen type.
Expected results:
libvirt should not reserve port when the vnc_auto_unix_socket take effect.
Additional info:
1.It will make migration failed when the target host has the same port used by another guest.
Upstream commit:
commit f0551b9bc4ec1c379c72dbf3f1ea7daa80b18ba9
Author: Pavel Hrdina <phrdina>
Date: Sat Aug 13 21:29:38 2016 +0200
qemu_process: graphics: setup listen types before ports are reserved/allocated
Reproduce this bug on build libvirt-2.0.0-10.el7.x86_64
Verify PASS on build libvirt-3.1.0-2.el7.x86_64.
Steps are same as description, the second guest can start up successfully.
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
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
Description of the problem: libvirt reserve the port setting in the guest xml when vnc_auto_unix_socket takes effect, it will make migration failed when the target host has the same port used by another guest. How producible 100% Version: libvirt-2.0.0-4.el7.x86_64 Steps to reproduce: 1.Enable vnc_auto_unix_socket in the qemu.conf and restart libvirtd service: #cat /etc/libvirt/qemu.conf ... vnc_auto_unix_socket=1 ... #systemctl restart libvirtd.service 2.Start a guest with vnc setting as follows: #virsh edit mig1 ... <graphics type='vnc' port='5900' autoport='no'> <listen type='address'/> </graphics> ... 3.The live xml of guest mig1: #virsh dumpxml mig1 ... <graphics type='vnc' socket='/var/lib/libvirt/qemu/domain-572-mig1/vnc.sock'> <listen type='socket' socket='/var/lib/libvirt/qemu/domain-572-mig1/vnc.sock'/> </graphics> ... 4. Check the port usage on the host, find that 5900 is not used: #netstat -tunlp 5.Start another guest mig2 with vnc setting as step2: #virsh start mig2 error: Failed to start domain mig2 error: internal error: Failed to reserve port 5900 Actual results: libvirt reserve port for the guest even the vnc_auto_unix_socket take effect and the guest using socket listen type. Expected results: libvirt should not reserve port when the vnc_auto_unix_socket take effect. Additional info: 1.It will make migration failed when the target host has the same port used by another guest.