bcwaldon / vagrant_devstack

Vagrant project that sets up a devstack environment
82 stars 23 forks source link

Neutron support #16

Closed sc68cal closed 10 years ago

sc68cal commented 10 years ago

Paired with a localrc, enables you to use Neutron with this vagrant recipe.

sc68cal commented 10 years ago

This branch also changes the cookbooks/devstack repo over to my fork, since I do some stuff via chef to set up eth2 properly.

sc68cal commented 10 years ago

This needs a bit more work, since the routes table in the VM doesn't route the traffic properly for floating ips

sc68cal commented 10 years ago

OK - since you can't provision a network adapter on the Vagrant side without assigning the IP address, I have to do some post-creation cleanup, by deleting the route created for eth2 on boot on the guest side, so that the br-ex route takes precedence, via sc68cal/chef-devstack@7cd7a5688182275dc293864f8b081bc3012ad6ae

vagrant@precise64:~$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.0.2.2        0.0.0.0         UG    0      0        0 eth0
default         10.0.2.2        0.0.0.0         UG    100    0        0 eth0
10.0.0.0        192.168.27.2    255.255.255.0   UG    0      0        0 eth2
10.0.2.0        *               255.255.255.0   U     0      0        0 eth0
192.168.27.0    *               255.255.255.0   U     0      0        0 br-ex
192.168.33.0    *               255.255.255.0   U     0      0        0 eth1
192.168.122.0   *               255.255.255.0   U     0      0        0 virbr0
sc68cal commented 10 years ago
vagrant@precise64:~$ nova list
+--------------------------------------+------+--------+------------+-------------+--------------------------------+
| ID                                   | Name | Status | Task State | Power State | Networks                       |
+--------------------------------------+------+--------+------------+-------------+--------------------------------+
| 47209389-cc8d-47a5-9897-92b2af7880c9 | test | ACTIVE | None       | Running     | private=10.0.0.3, 192.168.27.3 |
+--------------------------------------+------+--------+------------+-------------+--------------------------------+
vagrant@precise64:~$ ssh -v cirros@192.168.27.3
OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 192.168.27.3 [192.168.27.3] port 22.
debug1: Connection established.
debug1: identity file /home/vagrant/.ssh/id_rsa type -1
debug1: identity file /home/vagrant/.ssh/id_rsa-cert type -1
debug1: identity file /home/vagrant/.ssh/id_dsa type -1
debug1: identity file /home/vagrant/.ssh/id_dsa-cert type -1
debug1: identity file /home/vagrant/.ssh/id_ecdsa type -1
debug1: identity file /home/vagrant/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version dropbear_2012.55
debug1: no match: dropbear_2012.55
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Server host key: RSA 78:24:d3:de:d3:8d:96:88:22:bd:93:3a:1f:82:0c:29
The authenticity of host '192.168.27.3 (192.168.27.3)' can't be established.
RSA key fingerprint is 78:24:d3:de:d3:8d:96:88:22:bd:93:3a:1f:82:0c:29.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.27.3' (RSA) to the list of known hosts.
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/vagrant/.ssh/id_rsa
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/vagrant/.ssh/id_dsa
debug1: Trying private key: /home/vagrant/.ssh/id_ecdsa
debug1: Next authentication method: password
cirros@192.168.27.3's password:
debug1: Authentication succeeded (password).
Authenticated to 192.168.27.3 ([192.168.27.3]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LC_ALL = en_US
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_CTYPE = en_US.UTF-8
$ ifconfig
eth0      Link encap:Ethernet  HWaddr FA:16:3E:C3:7D:AC
          inet addr:10.0.0.3  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::f816:3eff:fec3:7dac/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:63 errors:0 dropped:0 overruns:0 frame:0
          TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10064 (9.8 KiB)  TX bytes:6988 (6.8 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

$ exit
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to 192.168.27.3 closed.
Transferred: sent 3464, received 3184 bytes, in 7.6 seconds
Bytes per second: sent 457.0, received 420.1
debug1: Exit status 0
bcwaldon commented 10 years ago

@sc68cal It's not exactly clear how to move forward here. Is this ready for review?

sc68cal commented 10 years ago

@bcwaldon Doing some slight tidying up on the cookbooks/devstack side - will be updating this branch shortly.

sc68cal commented 10 years ago

Ready for merge

sc68cal commented 10 years ago

I ended up deleting the IP address from eth2 after it's added to the OVS br-ex bridge in sc68cal/chef-devstack@5d2dff32db47cbf903f7a816372bcfca785eee36 - that way the floating IPs work correctly when you try and access a floating IP from outside VirtualBox. Not 100% sure why it works, but it does. Virtualbox networking + the gateway that Neutron creates makes things act a bit funky.