Instance is not getting a static IP

Asked by Nilanjan Roy

Hi,

I have installed openstack grizzly with quantum as the networking. I have one controller and one compute node.
The controller has all the quantum services running (openvswitch,l3,dhcp,metadata). I have created two networks (VLAN) one NET1 with a dhcp enabled subnet and one NET2 with a dhcp disabled subnet.
So - NET1 -> subnet1 192.168.1.0/24 , dhcp_enabled=True
NET2-> subnet2 192.168.2.0/24,dhcp_enabled=false
Now my intention is to create a fedora instance which will be having two NICs - one in each network. To accomplish this I have created a port in NET2's subnet2 using following command

quantum port-create --fixed_ip subnet_id=<subnet2 ID>,ip_address=192.168.2.10 --name=<port name> <NET2's ID>
and stored the port id in port_id variable.

Then I started the one instance with following command

nova boot --image <image_id> --flavor 2 --nic net-id=<NET1 ID> --nic port-id=<port id > <vm name>

After the booting process the instance has two NICs - eth0 and eth1. eth0 got the dhcp IP but eth1 did not get the fixed IP. In dashboard it shows both the IPs 192.168.1.3 and 192.168.2.10.

I am not sure why eth1 is not getting an IP. Can anybody help on this regard?

Question information

Language:
English Edit question
Status:
Solved
For:
neutron Edit question
Assignee:
No assignee Edit question
Solved by:
Akihiro Motoki
Solved:
Last query:
Last reply:
Revision history for this message
ZhiQiang Fan (aji-zqfan) said :
#1

i'm not familar with fedora os, but for ubuntu os, the problem is same, and in my case the /etc/network/interfaces file not active the eth1, so you can check your os nic setting, if eth1 is not avtive, then active it and restart the network.

Revision history for this message
Best Akihiro Motoki (amotoki) said :
#2

The reason that eth1 is not getting an IP is because DHCP is disable for subnet2.

"port-create" assigned an IP address for the quantum port at the database level.
This means the port has a right to use the assigned IP address.

The same thing applied to Dashboard. Dashboard show what IP addresses are assigned at the database on Quantum (or Nova).
It does not check if the IP address is configured inside VMs.

Revision history for this message
Nilanjan Roy (nilanjan-r) said :
#3

Hi Akhiro,

Thanks for your inputs. It is working now after enabling DHCP for subnet2. That solves my query.

Revision history for this message
Nilanjan Roy (nilanjan-r) said :
#4

Thanks Akihiro Motoki, that solved my question.