Comment 5 for bug 514492

Revision history for this message
Scott Moser (smoser) wrote :

I don't really understand how a reboot *changed* the hostname. I'm aware that karmic images will set the hostname to the value of found in instance metadata on every boot, but I would have thought that would be persistent (although annoyingly arbitrary).

On EBS instances, I could see this change taking place, or possibly if you're using elastic IPs. There are no official Ubuntu EBS images for karmic though.

The EBS issue actually makes me think that what we have in Lucid is still not ideal, as cloud-init will write the value of the first boot to /etc/hostname and then never touch it again. On a stop-instances/start-instances cycle, this would result in incorrect hostname on the second boot. It might make sense to re-set hostname /etc/hostname contained the previous value (ie, was unchanged by a user). The end result would be that if a user wanted a persistent hostname they could write a *different* value to /etc/hostname and it would stick. The other option would be to just leave it as is in lucid, and if the 'hostname' changes, then a user needs to change it (this is similar to how "regular" installs work, its set once at install, if it changes user is in charge).

Regarding fixing this in karmic/hardy, I will see if its something that could easily be done. ec2-init is slightly different than cloud-init in this area.