Ask Your Question

Instance is not taking correct DNS servers

asked 2015-02-24 15:29:53 -0600

Prakash Sompura gravatar image
I am trying to create an instance as:
nova boot --flavor SL6.1-1-4-20 --image sl61-4-20 --nic net-id=c3e1ab70-a8ed-4f08-bc35-5f3b120f291f,v4-fixed-ip= --user-data ./ --availability-zone nova

My network is:
mysql> use nova
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select label,vlan,cidr,netmask,bridge,bridge_interface,gateway,dns1,dns2 from networks where label='L01';
| label | vlan | cidr        | netmask       | bridge | bridge_interface | gateway  | dns1      | dns2      |
| L01   |  V01 | | | br106  | eth2.105         | | | |
1 row in set (0.00 sec)

On my controller host I have in /etc/nova/nova.conf :
dns_server =,
use_network_dns_servers = true
dhcp_domain =

Instance is also created with correct IP. However after instance is created I see /etc/resolve.conf as:
;generated by /sbin/dhclient-script
search novalocal

Where as it should be:

Due to incorrect DNS resolution shell script I want to run as user data is not running.

What am I missing?
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-03-06 17:50:34 -0600

If you edit the image before uploading to Glance you can look in /etc/cloud/cloud.cfg and configure cloud-init to act however you want it to. I would use guestfish to customize the initial cloud config if this is to be a custom image

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-02-24 15:29:53 -0600

Seen: 1,176 times

Last updated: Mar 06 '15