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.
+++ This bug was initially created as a clone of Bug #1918673 +++
Description of problem:
guest's hostname can not be resolved by the libvirt_nss module
Version-Release number of selected component (if applicable):
libvirt-7.0.0-1.module+el8.4.0+9464+3e71831a.x86_64
How reproducible:
100%
Steps to Reproduce:
1. install the libvirt-nss package
# rpm -q libvirt-nss
libvirt-nss-7.0.0-1.module+el8.4.0+9464+3e71831a.x86_64
2. Edit the nsswitch.conf file to be with:
hosts: files libvirt dns myhostname
3. start a vm connected to the default network:
# virsh net-dumpxml default
<network>
<name>default</name>
<uuid>5f596afb-cbbd-4cb9-baab-be585536d844</uuid>
<forward mode='nat'>
<nat>
<port start='1024' end='65535'/>
</nat>
</forward>
<bridge name='virbr0' stp='on' delay='0'/>
<mac address='52:54:00:37:1c:18'/>
<ip address='192.168.124.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.124.2' end='192.168.124.254'/>
</dhcp>
</ip>
</network>
# virsh start test
4. login the guest and configure the hostname:
# hostnamectl set-hostname guest_test
# hostname
guest_test
reboot the guest
# reboot
5. after the guest boot successfully, check on host for the guest's hostname by net-dhcp-leases, it can not get the hostname:
# virsh domifaddr test
Name MAC address Protocol Address
-------------------------------------------------------------------------------
vnet6 52:54:00:f3:f5:ee ipv4 192.168.124.17/24
# virsh net-dhcp-leases default
Expiry Time MAC address Protocol IP address Hostname Client ID or DUID
------------------------------------------------------------------------------------------------------------
2021-01-21 05:49:18 52:54:00:f3:f5:ee ipv4 192.168.124.17/24 - 01:52:54:00:f3:f5:ee
Actual results:
guest's hostname can not be resolved by the libvirt_nss module
Expected results:
there should be hostname showed in the net-dhcp-leases output
Additional info:
same issue exists on libvirt-6.10.0-1.module+el8.4.0+8898+a84e86e1.x86_64,
but it can not be reproduced on libvirt-6.6.0-12.module+el8.3.1+9458+e57b3fac.x86_64
Reproduced with:
libvirt-nss-7.0.0-4.el9.s390x
I tested with 'libvirt_guest' module, ie.
2'. Edit the nsswitch.conf file to be with:
hosts: files libvirt_guest dns myhostname
(In reply to smitterl from comment #1)
> Reproduced with:
> libvirt-nss-7.0.0-4.el9.s390x
>
> I tested with 'libvirt_guest' module, ie.
>
> 2'. Edit the nsswitch.conf file to be with:
> hosts: files libvirt_guest dns myhostname
Please, ignore the comment about 'libvirt_guest' module. I got confused.
I can reproduce all the steps using 'libvirt' module with the version libvirt-nss-7.0.0-4.el9.s390x.
This has been solved for RHEL AV 8.4, so expecting this to be fixed with next rebase for RHEL9, bz1918673
Notes:
With 7.0.0-4 ssh-login using libvirt_guest also seems to not be working, I suspect this is for the same reason.
Sebastian, I'm not sure how this was fixed (I don't see any fix in git log since libvirt-6.6.0), but I'm glad to hear that it's working again. I've put more details into bug 1918673#2.
Comment 4yalzhang@redhat.com
2021-04-19 08:07:57 UTC
Same with bug 1918673#c3, it fails because of the improper hostname set on the vm. Close as "NOTABUG".