← Back to team overview

yahoo-eng-team team mailing list archive

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

 

Public bug reported:

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]

** Affects: cloud-init
     Importance: Undecided
         Status: New


** Tags: change cloud-init hostname localdomain

-- 
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:
  New

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]

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


Follow ups