Ask Your Question
0

Instance is not taking correct DNS servers

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

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=10.5.0.140 --user-data ./sl61-4-20.sh --availability-zone nova os-61-test.sd.my-domain.com

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 | 10.5.0.0/24 | 255.255.255.0 | br106  | eth2.105         | 10.5.0.1 | 10.66.8.2 | 10.66.8.3 |
+-------+------+-------------+---------------+--------+------------------+----------+-----------+-----------+
1 row in set (0.00 sec)

On my controller host I have in /etc/nova/nova.conf :
dns_server = 10.66.8.2,10.66.8.3
use_network_dns_servers = true
dhcp_domain = sd.my-domain.com

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
nameserver 10.5.0.3

Where as it should be:
search sd.my-domain.com
nameserver 10.66.8.2
nameserver 10.66.8.3 

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
0

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

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

http://cloudinit.readthedocs.org/en/l... http://docs.openstack.org/image-guide...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 947 times

Last updated: Mar 06 '15