Bug 1282927 - Default entry in /etc/hostname is 'localhost.localdomain.localdomain' opposed to 'localhost.localdomain'
Summary: Default entry in /etc/hostname is 'localhost.localdomain.localdomain' opposed...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.5.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.5.0
Assignee: Nick Carboni
QA Contact: Jeff Teehan
URL:
Whiteboard:
Depends On:
Blocks: RHCS-CFME
TreeView+ depends on / blocked
 
Reported: 2015-11-17 19:50 UTC by John Matthews
Modified: 2015-12-08 13:48 UTC (History)
9 users (show)

Fixed In Version: 5.5.0.12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-08 13:48:14 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1278904 0 high CLOSED credential RHEV hosts fail 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHSA-2015:2551 0 normal SHIPPED_LIVE Moderate: CFME 5.5.0 bug fixes and enhancement update 2015-12-08 17:58:09 UTC

Internal Links: 1278904

Description John Matthews 2015-11-17 19:50:07 UTC
Description of problem:

During RHCS integration testing we ran into BZ 1278904
We were unable to validate SSH credentials for a RHEV Hypervisor Host
Root cause was the hostname on the VM was not resolvable so ssh was failing.
hostname was not resolvable because the entry in /etc/hostname was incorrect.


This line was failing:
https://github.com/ManageIQ/manageiq/blame/master/gems/pending/util/MiqSshUtilV2.rb#L258

Version-Release number of selected component (if applicable):

cfme-rhevm-5.5.0.9-2.x86_64.rhevm.ova

How reproducible:

Everytime

Steps to Reproduce:
1. Launch VM and verify file
2. This impacts ability to ssh to a remote host.
   Was unable to validate ssh credentials for a RHEV Host.


Actual results:

# cat /etc/hostname
localhost.localdomain.localdomain


Expected results:

# cat /etc/hostname
localhost.localdomain


Additional info:

Comment 3 Nick Carboni 2015-11-17 20:54:43 UTC
What version of RHEV was the appliance deployed on?

Comment 4 John Matthews 2015-11-17 20:57:32 UTC
Was seen with RHEV 3.5.5-0.1.el6ev

Comment 5 Nick Carboni 2015-11-18 17:04:54 UTC
So it looks like cloudinit was doing something by default to change the hostname. As a first pass I was able to find a workaround on RHEV (3.4) where you can set the hostname at deploy time via the "Advanced Options -> Initial Run -> VM Hostname" box in the "New Virtual Machine" dialog, but this may not be a complete fix because this issue might also exist on other hypervisors.

Also, I was able to configure cloudinit to never change the hostname, which fixed this issue, but also rendered the input referenced above at deploy time useless (it now has no effect); because of this I'm going to try to avoid this option for now.

I'm still looking into setting a default hostname using cloudinit configuration so we can have the best of both worlds, but that may take a bit longer. If I find a way to do that, is there a desired default host name?  Is "localhost.localdomain" what we would want? I'm assuming setting the hostname is one of the first things most people will be doing after they deploy anyway right?

Comment 8 CFME Bot 2015-11-19 19:42:54 UTC
New commit detected on ManageIQ/manageiq-appliance/master:
https://github.com/ManageIQ/manageiq-appliance/commit/1926c54093577c1c0542eea14dd80b086b9438ce

commit 1926c54093577c1c0542eea14dd80b086b9438ce
Author:     Nick Carboni <ncarboni>
AuthorDate: Tue Nov 17 16:02:44 2015 -0500
Commit:     Nick Carboni <ncarboni>
CommitDate: Thu Nov 19 13:50:01 2015 -0500

    Remove cloud-init's ability to change the appliance hostname
    
    The altered hostname was not included in /etc/hosts
    causing us to not be able to resolve it when attempting
    to run `MiqSockUtil.getFullyQualifiedDomainName`
    
    The decision was made to disallow cloud-init from
    changing the hostname at all as to not conflict with our
    existing methods of changing the hostname using the
    appliance_console.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1282927
    https://bugzilla.redhat.com/show_bug.cgi?id=1278904

 COPY/etc/cloud/cloud.cfg.d/miq_cloud.cfg | 2 ++
 1 file changed, 2 insertions(+)

Comment 11 Jeff Teehan 2015-11-30 18:27:39 UTC
Looks right.  Tested on 5.5.0.12

For a menu, please type: appliance_console
[root@10-16-6-73 ~]# cat /etc/hostname 
localhost.localdomain
[root@10-16-6-73 ~]#

Comment 13 errata-xmlrpc 2015-12-08 13:48:14 UTC
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/RHSA-2015:2551


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