Bug 1254580 - Hostname is changed to localhost after RHEV-H 7 reboot
Hostname is changed to localhost after RHEV-H 7 reboot
Status: CLOSED DEFERRED
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-node (Show other bugs)
3.5.4
Unspecified Unspecified
medium Severity high
: ovirt-4.0.0-rc
: ---
Assigned To: Douglas Schilling Landgraf
Ying Cui
: Reopened, ZStream
: 1254425 (view as bug list)
Depends On:
Blocks: 1232338 1322781 1352452 1354596
  Show dependency treegraph
 
Reported: 2015-08-18 08:48 EDT by Ying Cui
Modified: 2016-07-17 21:05 EDT (History)
18 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1322781 (view as bug list)
Environment:
Last Closed: 2016-06-09 08:16:32 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Node
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 52879 master MERGED init: Fix the HOSTNAME check 2016-01-29 11:46 EST
oVirt gerrit 55429 ovirt-3.6 MERGED init: Fix the HOSTNAME check 2016-03-30 13:48 EDT

  None (edit)
Description Ying Cui 2015-08-18 08:48:24 EDT
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 08:49:28 EDT
Expected results:
Do not change hostname on rhevh after reboot rhevh.
Comment 2 Ying Cui 2015-08-18 08:50:52 EDT
Created attachment 1064306 [details]
rhevh_var_log
Comment 3 Ying Cui 2015-08-18 08:51:52 EDT
Created attachment 1064307 [details]
sosreport from node
Comment 4 Douglas Schilling Landgraf 2015-08-18 10:55:43 EDT
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 16:05:32 EDT
*** Bug 1254425 has been marked as a duplicate of this bug. ***
Comment 6 Ying Cui 2015-08-18 22:25:58 EDT
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 05:04:21 EDT
lower the severity to high, actually we can set hostname manually to avoid this issue happen.
Comment 8 Douglas Schilling Landgraf 2015-08-19 19:46:54 EDT
(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 08:44:09 EDT
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 15:58:43 EDT

*** This bug has been marked as a duplicate of bug 1232338 ***
Comment 12 Ying Cui 2015-12-14 09:11:07 EST
(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 05:48:18 EST
Is this the issue described in bug 1241712?
Comment 17 Ying Cui 2016-01-22 00:56:15 EST
(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 08:41:39 EST
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 04:53:57 EST
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 18:30:10 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 26 Jiri Belka 2016-03-29 10:38:34 EDT
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 08:16:32 EDT
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 08:22:13 EDT
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.