Bug 1254580 - Hostname is changed to localhost after RHEV-H 7 reboot
Summary: Hostname is changed to localhost after RHEV-H 7 reboot
Keywords:
Status: CLOSED EOL
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-node
Version: 3.5.4
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: ---
Assignee: Douglas Schilling Landgraf
QA Contact: Ying Cui
URL:
Whiteboard:
: 1254425 (view as bug list)
Depends On:
Blocks: 1232338 1322781 1352452 1354596
TreeView+ depends on / blocked
 
Reported: 2015-08-18 12:48 UTC by Ying Cui
Modified: 2022-04-16 09:02 UTC (History)
18 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1322781 (view as bug list)
Environment:
Last Closed: 2016-06-09 12:16:32 UTC
oVirt Team: Node
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
rhevh_var_log (122.83 KB, application/x-bzip)
2015-08-18 12:50 UTC, Ying Cui
no flags Details
sosreport from node (5.42 MB, application/x-xz)
2015-08-18 12:51 UTC, Ying Cui
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1232338 1 high CLOSED [BLOCKED] - consume fix for bug 1241712 - [was: RHEV-H 7 - The hostname is lost somewhere in the process (also prevents... 2023-09-14 03:00:44 UTC
Red Hat Issue Tracker RHV-45714 0 None None None 2022-04-16 09:02:30 UTC
oVirt gerrit 52879 0 master MERGED init: Fix the HOSTNAME check 2016-01-29 16:46:53 UTC
oVirt gerrit 55429 0 ovirt-3.6 MERGED init: Fix the HOSTNAME check 2016-03-30 17:48:12 UTC

Internal Links: 1232338

Description Ying Cui 2015-08-18 12:48:24 UTC
Description of problem:
Hostname is changed to localhost after RHEV-H reboot.

**This issue can cause VMs on RHEV-H migration failed, impact Hosted Engine migration to another host**


Version-Release number of selected component (if applicable):
# rpm -qa ovirt-node vdsm kernel
vdsm-4.16.24-2.el7ev.x86_64
kernel-3.10.0-229.11.1.el7.x86_64
ovirt-node-3.2.3-18.el7.noarch
# cat /etc/rhev-hypervisor-release 
Red Hat Enterprise Virtualization Hypervisor release 7.1 (20150813.0.el7ev)

How reproducible:
100%


Steps to Reproduce:
1. Installed rhevh.
   set hostname: dhcp-11-107.nay.redhat.com
2. Reboot RHEV-H
3. After reboot, login RHEV-H 
4. check the hostname

Actual results:
the hostname is changed to localhost.

Expected results:
Do not change hostname on rhevh after reboot rhevh with HE.

Additional info:
# after reboot rhevh
1. 
# hostname --all-fqdn
dhcp-11-107.nay.redhat.com 

2. 
# hostname
localhost

3. /var/log/message
<snip>
Aug 18 11:00:54 dhcp-11-167 systemd[1]: systemd 208 running in system mode. (+PAM +LIBWRAP +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ)
Aug 18 11:00:54 dhcp-11-167 systemd[1]: Running in initial RAM disk.
Aug 18 11:00:54 dhcp-11-167 systemd[1]: No hostname configured.
Aug 18 11:00:54 dhcp-11-167 systemd[1]: Set hostname to <localhost>.
Aug 18 11:00:54 dhcp-11-167 systemd[1]: Initializing machine ID from random generator.
Aug 18 11:00:54 dhcp-11-167 systemd[1]: Starting -.slice.
Aug 18 11:00:54 dhcp-11-167 systemd[1]: Created slice -.slice.
</snip>

Comment 1 Ying Cui 2015-08-18 12:49:28 UTC
Expected results:
Do not change hostname on rhevh after reboot rhevh.

Comment 2 Ying Cui 2015-08-18 12:50:52 UTC
Created attachment 1064306 [details]
rhevh_var_log

Comment 3 Ying Cui 2015-08-18 12:51:52 UTC
Created attachment 1064307 [details]
sosreport from node

Comment 4 Douglas Schilling Landgraf 2015-08-18 14:55:43 UTC
Hi Ying,

(In reply to Ying Cui from comment #0)
> Description of problem:
> Hostname is changed to localhost after RHEV-H reboot.
> 
> **This issue can cause VMs on RHEV-H migration failed, impact Hosted Engine
> migration to another host**
> 
> 
> Version-Release number of selected component (if applicable):
> # rpm -qa ovirt-node vdsm kernel
> vdsm-4.16.24-2.el7ev.x86_64
> kernel-3.10.0-229.11.1.el7.x86_64
> ovirt-node-3.2.3-18.el7.noarch
> # cat /etc/rhev-hypervisor-release 
> Red Hat Enterprise Virtualization Hypervisor release 7.1 (20150813.0.el7ev)
> 
> How reproducible:
> 100%
> 
> 
> Steps to Reproduce:
> 1. Installed rhevh.
>    set hostname: dhcp-11-107.nay.redhat.com
> 2. Reboot RHEV-H
> 3. After reboot, login RHEV-H 
> 4. check the hostname
> 
> Actual results:
> the hostname is changed to localhost.
> 
> Expected results:
> Do not change hostname on rhevh after reboot rhevh with HE.
> 
> Additional info:
> # after reboot rhevh
> 1. 
> # hostname --all-fqdn
> dhcp-11-107.nay.redhat.com 
> 
> 2. 
> # hostname
> localhost
> 
> 3. /var/log/message
> <snip>
> Aug 18 11:00:54 dhcp-11-167 systemd[1]: systemd 208 running in system mode.
> (+PAM +LIBWRAP +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL
> +XZ)
> Aug 18 11:00:54 dhcp-11-167 systemd[1]: Running in initial RAM disk.
> Aug 18 11:00:54 dhcp-11-167 systemd[1]: No hostname configured.
> Aug 18 11:00:54 dhcp-11-167 systemd[1]: Set hostname to <localhost>.
> Aug 18 11:00:54 dhcp-11-167 systemd[1]: Initializing machine ID from random
> generator.
> Aug 18 11:00:54 dhcp-11-167 systemd[1]: Starting -.slice.
> Aug 18 11:00:54 dhcp-11-167 systemd[1]: Created slice -.slice.
> </snip>

I couldn't reproduce it using rhev-h20150813.0.el7ev but in master I saw it happening (Patch attached).

My steps:

- Install manually  rhev-h20150813.0.el7ev
- Setup hostname via TUI
- Reboot the node
* Hostname is OK

or 

- Install manually  rhev-h20150813.0.el7ev
- Setup hostname via TUI
- Setup Network (DHCP or Static IP)
- Reboot the node
* Hostname is OK

Probably, I am missing some part of your reproducer. Could you please review the steps above? Are you using real machine or virtual machine for this test?

Thanks!

Comment 5 Douglas Schilling Landgraf 2015-08-18 20:05:32 UTC
*** Bug 1254425 has been marked as a duplicate of this bug. ***

Comment 6 Ying Cui 2015-08-19 02:25:58 UTC
Douglas, after I extend testing on this bug, here need to add more info to reproduce this bug.
 
> - Install manually  rhev-h20150813.0.el7ev
> - Setup hostname via TUI
> - Setup Network (DHCP or Static IP)

I set fqdn hostname automatically during setuping network via dhcp.
I did not set hostname manually.

Steps to Reproduce:
1. Installed rhevh.
2. Setup network via dhcp
3. After network setup, the hostname is set automatically.
   hostname: dhcp-11-107.nay.redhat.com
4. Reboot RHEV-H
5. After reboot, login RHEV-H 
6. check the hostname


> - Reboot the node
> * Hostname is OK
> 
> Probably, I am missing some part of your reproducer. Could you please review
> the steps above? Are you using real machine or virtual machine for this test?

I tested this issue on one Dell machine and two HP machines, all are real machines. Thanks.

Comment 7 Ying Cui 2015-08-19 09:04:21 UTC
lower the severity to high, actually we can set hostname manually to avoid this issue happen.

Comment 8 Douglas Schilling Landgraf 2015-08-19 23:46:54 UTC
(In reply to Ying Cui from comment #6)
> Douglas, after I extend testing on this bug, here need to add more info to
> reproduce this bug.
>  
> > - Install manually  rhev-h20150813.0.el7ev
> > - Setup hostname via TUI
> > - Setup Network (DHCP or Static IP)
> 
> I set fqdn hostname automatically during setuping network via dhcp.
> I did not set hostname manually.
> 
> Steps to Reproduce:
> 1. Installed rhevh.
> 2. Setup network via dhcp
> 3. After network setup, the hostname is set automatically.
>    hostname: dhcp-11-107.nay.redhat.com
> 4. Reboot RHEV-H
> 5. After reboot, login RHEV-H 
> 6. check the hostname
> 
> 
> > - Reboot the node
> > * Hostname is OK
> > 
> > Probably, I am missing some part of your reproducer. Could you please review
> > the steps above? Are you using real machine or virtual machine for this test?
> 
> I tested this issue on one Dell machine and two HP machines, all are real
> machines. Thanks.

Thanks for the clarification. I was able to reproduce it. I will be investigating this report. It's different from the one I have found in master.

Comment 10 Fabian Deutsch 2015-10-07 12:44:09 UTC
Moving this to 3.6 for now, as we don#t have any more insights, except that it is also related to the DHCP setup in the network.

Comment 11 Fabian Deutsch 2015-10-11 19:58:43 UTC

*** This bug has been marked as a duplicate of bug 1232338 ***

Comment 12 Ying Cui 2015-12-14 14:11:07 UTC
(In reply to Fabian Deutsch from comment #11)
> 
> *** This bug has been marked as a duplicate of bug 1232338 ***

Fabian, we need to reconsider this bug.

In this bug, the hostname getting from dhcp is changed to localhost after rhevh el7 reboot, don't register host to rhevm yet. And 100% reproduced, consider the valid fix should be in node side.

In bug 1232338, see the bug description, the hostname is broken after several time host reboot.

Comment 14 Fabian Deutsch 2016-01-21 10:48:18 UTC
Is this the issue described in bug 1241712?

Comment 17 Ying Cui 2016-01-22 05:56:15 UTC
(In reply to Fabian Deutsch from comment #14)
> Is this the issue described in bug 1241712?

From the bug 1241712 description, it is very like this bug.
But I can NOT reproduce this issue on RHEL 7.2, I only can reproduce it on RHEV-H 7.x.

Comment 18 Nikolai Sednev 2016-01-25 13:41:39 UTC
Works for me on Red Hat Enterprise Virtualization Hypervisor (Beta) release 7.2 (20160113.0.el7ev), following these steps:
1. Installed rhevh.
   set hostname: dhcp-11-107.nay.redhat.com
2. Reboot RHEV-H
3. After reboot, login RHEV-H 
4. check the hostname

Comment 23 Fabian Deutsch 2016-01-29 09:53:57 UTC
Findings from a run where I added set -x to ovirt-init-script:

Jan 29 09:42:23 localhost ovirt-init-functions.sh[1501]: + '[' -f /etc/sysconfig/network ']'
Jan 29 09:42:23 localhost ovirt-init-functions.sh[1501]: + . /etc/sysconfig/network
Jan 29 09:42:23 localhost ovirt-init-functions.sh[1501]: ++ NETWORKING=yes
Jan 29 09:42:23 localhost ovirt-init-functions.sh[1501]: ++ NETWORKING_IPV6=no
Jan 29 09:42:23 localhost ovirt-init-functions.sh[1501]: + '[' -n localhost ']'
Jan 29 09:42:23 localhost ovirt-init-functions.sh[1501]: + hostname localhost

This shows that in the init-script HOSTNAME is set to 'localhost' in the env of the script, but it's not set in the /etc/sysconfig/network file.

Comment 25 Mike McCune 2016-03-28 22:30:10 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 26 Jiri Belka 2016-03-29 14:38:34 UTC
fyi, this causes following:

libvirtError: internal error: Attempt to migrate guest to the same host localhost
Thread-430::DEBUG::2016-03-29 13:49:12,911::__init__::206::jsonrpc.Notification::(emit) Sending event {"params": {"a7df4022-42c5-47b6-aba2-189c47f9fef7": {"status": "Migration Source"}, "notify_time": 4298245620}, "jsonrpc": "2.0", "method": "|virt|VM_status|a7df4022-42c5-47b6-aba2-189c47f9fef7"}
Thread-430::ERROR::2016-03-29 13:49:12,912::migration::309::virt.vm::(run) vmId=`a7df4022-42c5-47b6-aba2-189c47f9fef7`::Failed to migrate
Traceback (most recent call last):
  File "/usr/share/vdsm/virt/migration.py", line 297, in run
    self._startUnderlyingMigration(time.time())
  File "/usr/share/vdsm/virt/migration.py", line 363, in _startUnderlyingMigration
    self._perform_migration(duri, muri)
  File "/usr/share/vdsm/virt/migration.py", line 402, in _perform_migration
    self._vm._dom.migrateToURI3(duri, params, flags)
  File "/usr/share/vdsm/virt/virdomain.py", line 68, in f
    ret = attr(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line 124, in wrapper
    ret = f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/vdsm/utils.py", line 1313, in wrapper
    return func(inst, *args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 1836, in migrateToURI3
    if ret == -1: raise libvirtError ('virDomainMigrateToURI3() failed', dom=self)
libvirtError: internal error: Attempt to migrate guest to the same host localhost

Comment 28 Fabian Deutsch 2016-06-09 12:16:32 UTC
This issue will not be fixed with an eventually attached in RHEV 4.0. Instead this bug is getting fixed by the new functionality in Cockpit.

Comment 29 Huijuan Zhao 2016-07-05 12:22:13 UTC
Encounter this bug on rhev-hypervisor6-6.8-20160630.2.iso, added this bug to:
Bug 1352452 - [Tracker] Track RHEV-H 6.8 bugs


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