Ask Your Question
2

Problem attaching a second interface into a VM

asked 2014-08-12 09:40:03 -0500

openrnd gravatar image

updated 2014-08-12 11:22:55 -0500

smaffulli gravatar image

Hi,

I am using Openstack Icehouse, single node RDO installation on CentOS 6.5 (packstack --allinone). I have a problem attaching a second interface into a VM.

[root@localhost ~(keystone_admin)]# nova interface-attach cpanel

runs without any error in logs, and neutron "port-list" show the new IP/port. However eth1 created in 'cpanel'(server ID) VM does not have any IP address associated with it. Manually assigning the IP address does not work.

Now, eth0 ip (which is already working) = 10.0.0.7 eth1 ip (new interface, manually assigned ip) = 10.0.0.127

Pinging from inside the network namespace works for eth0 , but eth1 ip fails.

[root@localhost ~(keystone_admin)]# ip netns exec qrouter-b95573f7-5a37-4b44-b094-0ccb2d33ab15 ping 10.0.0.7
PING 10.0.0.7 (10.0.0.7) 56(84) bytes of data.
64 bytes from 10.0.0.7: icmp_seq=1 ttl=64 time=0.948 ms
64 bytes from 10.0.0.7: icmp_seq=2 ttl=64 time=0.509 ms
64 bytes from 10.0.0.7: icmp_seq=3 ttl=64 time=0.503 ms
64 bytes from 10.0.0.7: icmp_seq=4 ttl=64 time=0.544 ms
^C
--- 10.0.0.7 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3020ms
rtt min/avg/max/mdev = 0.503/0.626/0.948/0.186 ms


[root@localhost ~(keystone_admin)]# ip netns exec qrouter-b95573f7-5a37-4b44-b094-0ccb2d33ab15 ping 10.0.0.127
PING 10.0.0.127 (10.0.0.127) 56(84) bytes of data.
From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
From 10.0.0.1 icmp_seq=4 Destination Host Unreachable
^C
--- 10.0.0.127 ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3007ms

Kindly assist.

edit retag flag offensive close merge delete

Comments

Don't you have to link that interface with some (sub)network?

T u l gravatar imageT u l ( 2014-08-12 14:55:59 -0500 )edit
1

@T u l, Even if I specify network with --net-id in "nova interface-attach" it still don't assign an IP to the created interface. It fails to work even if I manually assign the same ip which is associated with that port (as per 'nuetron port-list')

openrnd gravatar imageopenrnd ( 2014-08-12 22:10:39 -0500 )edit

Have you had a chance to try on a more recent release? Is this problem still occurring?

rbowen gravatar imagerbowen ( 2015-03-05 11:08:36 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-03-05 12:13:43 -0500

larsks gravatar image

updated 2015-03-05 12:14:33 -0500

Nova does not assign ip addresses to your interfaces; nova configures a DHCP server with information about assigned ip addresses, and then it is up to your instance to query the DHCP server and perform the necessary system configuration to apply the received address to an interface.

If you add an interface to your instance, you will probably need to take some manual steps in order to get the system to query the dhcp server for an address for that interface. For example, using the Cirros image, I can attach an interface from my net0 network:

$ nova interface-attach cirros net0

Inside the Cirros instance, I now have an eth1 device:

$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether fa:16:3e:17:60:9e brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.17/24 brd 10.0.0.255 scope global eth0
    inet6 fe80::f816:3eff:fe17:609e/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether fa:16:3e:57:18:fa brd ff:ff:ff:ff:ff:ff

But as you can see, there is no IP address, even though Nova has allocated one for the interface:

$ nova list
+-----...+-------------+--------------------------------------------+
| ID  ...| Power State | Networks                                   |
+-----...+-------------+--------------------------------------------+
| 6d89...| Running     | net0=10.0.0.17, 10.0.0.18, 192.168.200.211 |
+-----...+-------------+--------------------------------------------+

If I want to configure the system to bring this interface up automatically, I would add the following to my /etc/network/interfaces file:

auto eth1
iface eth1 inet dhcp

And then run:

ifup eth1

And now I can see an address associated with the new interface:

# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether fa:16:3e:17:60:9e brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.17/24 brd 10.0.0.255 scope global eth0
    inet6 fe80::f816:3eff:fe17:609e/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether fa:16:3e:57:18:fa brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.18/24 brd 10.0.0.255 scope global eth1
    inet6 fe80::f816:3eff:fe57:18fa/64 scope link 
       valid_lft forever preferred_lft forever
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

3 followers

Stats

Asked: 2014-08-12 09:40:03 -0500

Seen: 1,482 times

Last updated: Mar 05 '15