127.0.1.1 hostname not being filled out in etc/hosts

Asked by Bryan P

I'm not entirely sure if this is an issue with nova or my uec image but whenever I launch an instance of UEC 10.04 LTS it doesn't add the 127.0.1.1 to the list hosts in etc/hosts . This causes a lot of error messages because it tries to resolve its hostname, but it isn't in the list, and its not in DNS either. I'm using FlatManager. I know I can add it in manually, but I'd like to automate it so I don't have to.

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
Bryan P
Solved:
Last query:
Last reply:
Revision history for this message
Bryan P (bryanpaluch) said :
#1

I figured it out. It had to do with the version of UEC I was using. It was ignoring the template set up in /etc/cloud/templates for hosts file. For the UEC images you have to pass

#cloud-config
manage_etc_hosts: True

in a file to using euca2ools eg:

root@NovaController:~/cloud-config# more cloud.cfg
#cloud-config
manage_etc_hosts: True
root@NovaController:~/cloud-config# euca-run-instances ami-0000000c -k mykey -t m1.medium -f cloud.cfg

note this only works in UEC that have later versions of cloud-init