← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1661007] Re: Use hosts without domain hostname change hostname to localdomain

 

[Expired for cloud-init because there has been no activity for 60 days.]

** Changed in: cloud-init
       Status: Incomplete => Expired

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1661007

Title:
  Use hosts without domain hostname change hostname to localdomain

Status in cloud-init:
  Expired

Bug description:
  Use hosts without domain hostname change hostname to localdomain

  With Centos/Redhat 7 and cloud-init 0.7.5:

  When we create a new server with simple hostname:
  myhostname

  And start it, cloud init changes the hostname to:
  myhostname.localdomain

  But this is incorrect, the default installation of Centos/RedHat of /etc/hosts:
  127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
  ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

  And network interfaces not work correctly
  ping myhostname.localdomain
  PING localhost (127.0.0.1) 56(84) bytes of data.
  64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.031 ms
  64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.052 ms

  If we not change this hostname:
  ping myhostname
  PING myhostname (10.0.1.188) 56(84) bytes of data.
  64 bytes from myhostname (10.0.1.188): icmp_seq=1 ttl=64 time=0.031 ms

  You can add a possibility for not to change hostname to
  hostname.localdomain?

  By now, we change this manually, but is hard to manage in OS images if new package available and update:
  https://launchpad.net/cloud-init/trunk/0.7.5/+download/cloud-init-0.7.5.tar.gz

  # Remove cloud-init default domainname localdomain
  sed -i -e 's/localdomain//g' /usr/lib/python2.7/site-packages/cloudinit/sources/__init__.py
  rm -f /usr/lib/python2.7/site-packages/cloudinit/sources/__init__.py[co]

  
  Other related problem:
  In Centos 7 we have hostnamectl --static, hostnamectl -transient, hostnamectl --pretty
  When cloud-init changes the hostname, only changes static name.
  Case:
  - Create servers and start it
  - Install replicaset mongodb (by name), and configure it
  - Reboot machines
  Then, replicaset is breaked.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1661007/+subscriptions


References