Ask Your Question
0

devstack networking for standalone virtualbox VM - can't ping to/from instances

asked 2014-01-29 16:47:25 -0500

snowch gravatar image

I have a vagrant virtualbox image that is installed with CentOS 6.4 (desktop version).

The machine has a single NIC created by default by vagrant:

Network Type:  NAT
Host IP:       10.0.2.2 / 255.255.255.0
Guest IP:      10.0.2.15 / 255.255.255.0

The NIC is use by vagrant to communicate with the guest, and also to provide the guest with internet access.

I've set the NIC to promisc:

vb.customize ["modifyvm", :id, "--nicpromisc1", "allow-all"]

The devstack setup is straightforward:

sudo yum install -y git
git clone git://github.com/openstack-dev/devstack.git

cd devstack
./stack.sh

I then:

  1. proceeded to create a new instance, which was successful.
  2. added ICMP all to the security group.
  3. added a floating IP address.

However, I can't ping to/from instance the private/public interfaces.

Questions:

  • What is missing with my setup?
  • Do I need to add another network card to this standalone guest vm for devstack to work properly?
edit retag flag offensive close merge delete

Comments

Hope your instance has IP address of external network as well. 10.0.2.2 must be the internal network IP address. You must be trying to reach from your box to VM. Your box is in different network. So you need to assign the external IP address to your vms. Then it will surely work.

dheeru gravatar imagedheeru ( 2014-01-29 21:10:04 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-05-15 16:09:22 -0500

melwitt gravatar image

I'm going to answer this old question in case it might help another person finding it in searches. I ran into the same issue recently with a barebones DevStack nova-network single-machine setup.

The short answer is: yes, you need to add another network card to the guest VM to be able to ping your OpenStack instances.

In my case, when I checked the console log of the unpingable instance using nova console-log I found it was obtaining an IP address from the integrated DHCP server in VirtualBox [1] instead of from the dnsmasq service started by nova-network, for example:

Starting network...
udhcpc (v1.20.1) started
Sending discover...
Sending select for 10.0.0.2...
Lease of 10.0.2.16 obtained, lease time 86400

In /var/log/syslog I could see that dnsmasq was responding with 10.0.0.2 but the instance anyway got an IP 10.0.2.X on the NAT network. There was a race with dnsmasq and most of the time, the integrated DHCP server won and the instance got an IP not associated with the OpenStack network.

The fix was to add another network interface in VirtualBox, Host-only and attached to a network with DHCP disabled. Then, DevStack must be configured to use the non-NAT interface only. For example, my second network card was eth1 and I had chosen IP 10.0.10.10 (I used config.vm.network "private_network", ip: "10.0.10.10" in my VagrantFile) for my Host-only network in VirtualBox:

[[local|localrc]]
HOST_IP=10.0.10.10
FLAT_INTERFACE=eth1

Ran stack.sh, when it was done I booted VMs and I could see the bridge br100 was created by nova-network to be attached only to eth1, not eth0 (the NAT network interface) and the VMs were accessible.

[1] https://www.virtualbox.org/manual/ch0...

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: 2014-01-29 16:47:25 -0500

Seen: 2,338 times

Last updated: May 15 '15