[Bug 838280] [NEW] Cloud-init overwriting hostname given to kernel on baremetal

Andres Rodriguez andreserl at ubuntu-pe.org
Wed Aug 31 17:59:56 UTC 2011


Public bug reported:

When PXE'ing, the hostname for the system is set via a kernel parameter.
However, once installation has finished, and cloud-init starts doing is
configuration based on a determined meta-data/user-data file it changes
the hostname to ubuntuhost without respecting what was given to the
kernel.

The kernel config for PXE is as follows:


default linux
prompt 0
timeout 1
label linux
        kernel /images/oneiric-x86_64/linux
        ipappend 2
        append initrd=/images/oneiric-x86_64/initrd.gz  locale=  netcfg/dhcp_timeout=120 console=ttyS0,9600n8 locale=en_US text netcfg/choose_interface=eth0 DEBCONF_DEBUG=developer priority=critical  auto url=http://A.B.C.D/cblr/svc/op/ks/system/hostname.domain.com hostname=hostname.domain.com domain=local.lan suite=oneiric


The user data includes:

#cloud-config
apt-update: true
apt-upgrade: true
apt_sources:
- {source: 'ppa:ensemble/ppa'}
machine-data: {ensemble-zookeeper-hosts: 'localhost:2181', machine-id: '0'}
packages: [bzr, tmux, python-setuptools, python-twisted, python-argparse, python-txaws,
  python-zookeeper, bzr, default-jre-headless, zookeeper, zookeeperd]
runcmd: [export ENSEMBLE_INSTANCE_ID=MTMxNDMwNzI0OS40ODkyODE2MzAuODE5ODY, sudo apt-get
    install -y python-txzookeeper, sudo mkdir -p /usr/lib/ensemble, 'cd /usr/lib/ensemble
    && sudo /usr/bin/bzr co lp:~fwereade/ensemble/cobbler-complete-fixes ensemble',
  cd /usr/lib/ensemble/ensemble && sudo python setup.py develop, sudo mkdir -p /var/lib/ensemble,
  sudo mkdir -p /var/log/ensemble, 'ensemble-admin initialize --instance-id=$ENSEMBLE_INSTANCE_ID
    --admin-identity="admin:W/v3qx7AN7yfII/tSptndJ7lvhU="', 'ENSEMBLE_MACHINE_ID=0
    ENSEMBLE_ZOOKEEPER=localhost:2181 python -m ensemble.agents.machine -n --logfile=/var/log/ensemble/machine-agent.log
--pidfile=/var/run/ensemble/machine-agent.pid', 'ENSEMBLE_ZOOKEEPER=localhost:2181
    python -m ensemble.agents.provision -n --logfile=/var/log/ensemble/provision-agent.log
    --pidfile=/var/run/ensemble/provision-agent.pid']
ssh_authorized_keys: ['ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4kMKjQFUDiWir9LJlfWmhg7570p/3akbGvJf9SXhHeiYSkK+bGtY+UcS6Bq+UZZ32qvfjv1nZ3OzLI8eK6YkHC2oT7bihqAe80c/ObJEsAGlmfEf+2uKP+B3uW8eQm61Q35aNIx/zuInoOPV5wyieA348LThKcAkQq5w4PbOyy6tfuKwnbdhUYvMUEDVc/wFvFgNES5D5Dg+0QngS9gP7UWZrraYuh+19jtYk9gdnYUj2IPiFlDG7OCJt/Y6voWPKEVNAi1OkvwqWNRcoHAHClkMdtZQZm91mSH64vKP5djjMJgg3MsyF9HYVSXrvd0EGRF1/1BW0sYDF0WZ26F8z
    ubuntu at blabla

I had to manually add the following for cloud-init to correctly set the
hostname:

manage_etc_hosts: True
hostname: <hostname>

** Affects: cloud-init (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to cloud-init in Ubuntu.
https://bugs.launchpad.net/bugs/838280

Title:
  Cloud-init overwriting hostname given to kernel on baremetal

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



More information about the Ubuntu-server-bugs mailing list