Ask Your Question
0

VM can't get fixed IP after it's booted if the network's DHCP is disabled

asked 2015-03-05 04:14:00 -0500

Maple Wang gravatar image

I want to create the internal network in the neutron, and the DHCP is disabled in this network, then boot the VM with fixed IP in this network, unfortunately, the VM can't get the this fixed IP also can't get default gateway from network. Please see the detail below:

1 create the network stp-ext-net

neutron net-create stp-ext-net

neutron subnet-create stp-ext-net --name stp-ext-subnet --gateway=10.170.28.65 10.170.28.64/28 --disable-dhcp

2 boot the VM with fixed IP in stp-ext-net

nova boot --flavor 2 --image a22d837b-56af-45ee-90a1-234060bea1dd --nic net-id=adba9259-1194-4391-a7fb-25f584f596a7,v4-fixed-ip=10.170.28.69 centos-RPC

3 but in the VM, eth0 doesn't get the IP, the route table also is empty

Besides, i have another finding that if the DHCP is not disable, then everything work fine. so I want to ask that enabling DHCP is necessary for network even if i just want to assign IP manually when I boot it?

best regards.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-03-05 05:35:25 -0500

dbaxps gravatar image

updated 2015-03-05 06:54:42 -0500

Via my experience VM fails to run cloud-init , if it fails obtain private IP from dnsmasq ( RDO Juno ).
I guess it's just has been designed this way. I just launched Ubuntu 14.04 VM , see

* Starting Mount network filesystems[74G[ OK ]
 * Starting enable remaining boot-time encrypted block devices[74G[ OK ]
 * Starting configure network device[74G[ OK ]
cloud-init-nonet[9.65]: static networking is now up
 * Stopping Mount network filesystems[74G[ OK ]
Cloud-init v. 0.7.5 running 'init' at Thu, 05 Mar 2015 12:48:04 +0000. Up 10.28 seconds.
ci-info: +++++++++++++++++++++++++Net device info+++++++++++++++++++++++++
ci-info: +--------+------+-----------+---------------+-------------------+
ci-info: | Device |  Up  |  Address  |      Mask     |     Hw-Address    |
ci-info: +--------+------+-----------+---------------+-------------------+
ci-info: |   lo   | True | 127.0.0.1 |   255.0.0.0   |         .         |
ci-info: |  eth0  | True | 40.0.0.17 | 255.255.255.0 | fa:16:3e:1f:b9:10 |
ci-info: +--------+------+-----------+---------------+-------------------+
ci-info: ++++++++++++++++++++++++++++++Route info++++++++++++++++++++++++++++++
ci-info: +-------+-------------+----------+---------------+-----------+-------+
ci-info: | Route | Destination | Gateway  |    Genmask    | Interface | Flags |
ci-info: +-------+-------------+----------+---------------+-----------+-------+
ci-info: |   0   |   0.0.0.0   | 40.0.0.1 |    0.0.0.0    |    eth0   |   UG  |
ci-info: |   1   |   40.0.0.0  | 0.0.0.0  | 255.255.255.0 |    eth0   |   U   |
ci-info: +-------+-------------+----------+---------------+-----------+-------+
Generating public/private rsa key pair.
Your identification has been saved in /etc/ssh/ssh_host_rsa_key.
Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub.
The key fingerprint is:
12:8a:f2:fc:a7:8b:96:ff:9d:ad:e3:e9:ae:4c:27:4c root@ubuntu14
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|      .          |
|   . . .         |
|. . . E S        |
| +   o .         |
|  o.  + .        |
|  oo o.+.+       |
| ...==+=Oo.      |
+-----------------+
Generating public/private dsa key pair.
Your identification has been saved in /etc/ssh/ssh_host_dsa_key.
Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub.
The key fingerprint is:
bf:54:45:59:3d:00:34:27:57:58:79:4b:ff:75:60:95 root@ubuntu14
The key's randomart image is:
+--[ DSA 1024]----+
|          .=.+***|
|            =o+Eo|
|             .o.=|
|             . .+|
|        S   .   +|
|         . .    .|
|          o      |
|         . .     |
|          .      |
+-----------------+
Generating public/private ecdsa key pair.
Your identification has been saved in /etc/ssh/ssh_host_ecdsa_key.
Your public key has been saved in /etc/ssh/ssh_host_ecdsa_key.pub.
The key fingerprint is:
82:27:76:0a:28:4c:38:07:21:68:c3:61:79:43:59:ae root@ubuntu14
The key's randomart image is:
+--[ECDSA  256]---+
|*++.o.           |
|=* +.            |
|+.+ ..           |
|o+  ..           |
|o..E+ + S        |
|.  o = .         |
|    .            |
|                 |
|                 |
+-----------------+
 * Starting Signal sysvinit that local filesystems are mounted[74G[ OK ]
 * Starting configure network device security[74G[ OK ]
 * Stopping Mount filesystems on boot[74G[ OK ]
 * Starting flush early job output to logs[74G[ OK ]
 * Stopping Failsafe Boot Delay[74G[ OK ]
 * Starting System V initialisation compatibility[74G[ OK ]
 * Starting D-Bus system message bus[74G[ OK ]
 * Stopping flush early job output to logs[74G[ OK ]
 * Starting configure virtual network devices[74G[ OK ]
 * Starting SystemD login management service[74G[ OK ]
 * Starting Seed the pseudo random number generator on first boot[74G[ OK ]
 * Stopping Seed the pseudo random number generator on first boot[74G[ OK ]
 * Starting Bridge file events into upstart[74G[ OK ]
 * Starting early crypto disks...       [80G * Starting system logging daemon[74G[ OK ]
 [74G[ OK ]
 * Starting Handle applying cloud-config[74G[ OK ]
Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd ...
(more)
edit flag offensive delete link more

Comments

so even I assign fixed IP to my VM, it still need to get it from dnsmasq? If that's true, then I can understand why it happens. And thanks for your help. by the way, how can you get the log from cloud-init?

Maple Wang gravatar imageMaple Wang ( 2015-03-29 21:51:04 -0500 )edit

I got log via Horizon : Instances-> Overview | Log | Console | Action Log |
I just switched to "Log", usually people select "Console"

dbaxps gravatar imagedbaxps ( 2015-03-30 00:58:05 -0500 )edit

thanks for instruction

Maple Wang gravatar imageMaple Wang ( 2015-04-01 06:41:45 -0500 )edit

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-03-05 04:14:00 -0500

Seen: 1,299 times

Last updated: Mar 05 '15