Openstack Juno – Multihost Networking

This blog is part of my series on Openstack Juno.

In this blog, I will cover adding a compute host to the Openstack Devstack cluster and connect the 2 hosts using either vxlan or gre encapsulation.
Lets first do the stacking on the controller host using the steps mentioned in my previous blog.
Lets look at the hypervisor list. As expected, we see only 1 host.

$ nova hypervisor-list
+----+-------------------------+
| ID | Hypervisor hostname     |
+----+-------------------------+
| 1  | sreeubuntu14-VirtualBox |
+----+-------------------------+

Lets look at the networks created by default:

$ neutron net-list
+--------------------------------------+---------+----------------------------------------------------+
| id                                   | name    | subnets                                            |
+--------------------------------------+---------+----------------------------------------------------+
| 3dbdc3cb-b882-4cdb-9738-fa31f7cc208d | private | e8bd34d0-8bff-4349-bc92-9d0bdb328bc8 10.0.0.0/24   |
| 96909875-acf0-4bba-9632-3c9038bf1462 | public  | 696f4954-1061-4de4-9894-665c3063da87 172.24.4.0/24 |
+--------------------------------------+---------+----------------------------------------------------+
$ neutron subnet-list
+--------------------------------------+----------------+---------------+------------------------------------------------+
| id                                   | name           | cidr          | allocation_pools                               |
+--------------------------------------+----------------+---------------+------------------------------------------------+
| 696f4954-1061-4de4-9894-665c3063da87 | public-subnet  | 172.24.4.0/24 | {"start": "172.24.4.2", "end": "172.24.4.254"} |
| e8bd34d0-8bff-4349-bc92-9d0bdb328bc8 | private-subnet | 10.0.0.0/24   | {"start": "10.0.0.2", "end": "10.0.0.254"}     |
+--------------------------------------+----------------+---------------+------------------------------------------------+

Create a compute instance using the exact same steps as mentioned in my previous blog. The only difference will be in the “local.conf” file that needs to be used for the compute instance.

wget https://github.com/smakam/openstack/raw/master/juno/local.conf.compute
mv local.conf.compute local.conf
-- Edit IP to your eth1 host-only IP address --
./stack.sh

Now, lets look at the hypervisor list in the controller list. We can see that the compute host is part of the openstack cluster.

$ nova hypervisor-list
+----+--------------------------+
| ID | Hypervisor hostname      |
+----+--------------------------+
| 1  | sreeubuntu14-VirtualBox  |
| 2  | sreeubuntu14-VirtualBox1 |
+----+--------------------------+

Following ovs output shows the vxlan tunnel created between the controller and compute host. “192.168.56.101” is the ip address of eth1 interface on the controller host and “192.168.56.102” is the ip address of eth1 interface on the compute host.

controller:
Bridge br-tun
        Port br-tun
            Interface br-tun
                type: internal
        Port patch-int
            Interface patch-int
                type: patch
                options: {peer=patch-tun}
        Port "vxlan-c0a83866"
            Interface "vxlan-c0a83866"
                type: vxlan
                options: {df_default="true", in_key=flow, local_ip="192.168.56.101", out_key=flow, remote_ip="192.168.56.102"}
				
compute:
Bridge br-tun
        Port br-tun
            Interface br-tun
                type: internal
        Port "vxlan-c0a83865"
            Interface "vxlan-c0a83865"
                type: vxlan
                options: {df_default="true", in_key=flow, local_ip="192.168.56.102", out_key=flow, remote_ip="192.168.56.101"}
        Port patch-int
            Interface patch-int
                type: patch
                options: {peer=patch-tun}

Now, lets create 4 nano Cirros VMs.

$ nova boot --flavor m1.nano --image cirros-0.3.2-x86_64-uec --security-groups default --key-name heattest --max-count 4 cirrostest

Nova scheduler will distribute the 4 instances across the 2 hosts that are part of the cluster. Below, we see that 2 VMs are running on each host.

$ nova list --host sreeubuntu14-VirtualBox
+--------------------------------------+-------------------------------------------------+--------+------------+-------------+------------------+
| ID                                   | Name                                            | Status | Task State | Power State | Networks         |
+--------------------------------------+-------------------------------------------------+--------+------------+-------------+------------------+
| 26c97ffc-6a15-48cc-aeb0-94b2d2290877 | cirrostest-26c97ffc-6a15-48cc-aeb0-94b2d2290877 | ACTIVE | -          | Running     | private=10.0.0.8 |
| ab0fe9fa-6ea4-489d-b726-3a423aece5e7 | cirrostest-ab0fe9fa-6ea4-489d-b726-3a423aece5e7 | ACTIVE | -          | Running     | private=10.0.0.9 |
+--------------------------------------+-------------------------------------------------+--------+------------+-------------+------------------+
smakam14@sreeubuntu14-VirtualBox:~/devstack$ nova list --host sreeubuntu14-VirtualBox1
+--------------------------------------+-------------------------------------------------+--------+------------+-------------+------------------+
| ID                                   | Name                                            | Status | Task State | Power State | Networks         |
+--------------------------------------+-------------------------------------------------+--------+------------+-------------+------------------+
| 4113c3aa-6e02-4a4f-944e-e389de616eea | cirrostest-4113c3aa-6e02-4a4f-944e-e389de616eea | ACTIVE | -          | Running     | private=10.0.0.7 |
| 8b7c06bc-8c99-46c7-ad6c-9262c2d002d4 | cirrostest-8b7c06bc-8c99-46c7-ad6c-9262c2d002d4 | ACTIVE | -          | Running     | private=10.0.0.6 |
+--------------------------------------+-------------------------------------------------+--------+------------+-------------+------------------+

Lets try to login to 1 of the VMs in host1 and ping to another VM in host2. As we can see below, ping is successful.

$ ssh -i ~/Downloads/heattest.pem cirros@10.0.0.8
$ ping -c1 10.0.0.6
PING 10.0.0.6 (10.0.0.6): 56 data bytes
64 bytes from 10.0.0.6: seq=0 ttl=64 time=15.487 ms

--- 10.0.0.6 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 15.487/15.487/15.487 ms

Packets between the 2 VMs are encapsulated using the vxlan encapsulation. To use a different encapsulation scheme like gre, it is needed to modify the local.conf file in both the controller and compute host and set Q_ML2_TENANT_NETWORK_TYPE to gre. After this, stacking needs to be redone.
Following is the Openvswitch output with encapsulation type set to gre.

controller:
 Bridge br-tun
        Port patch-int
            Interface patch-int
                type: patch
                options: {peer=patch-tun}
        Port "gre-c0a83866"
            Interface "gre-c0a83866"
                type: gre
                options: {df_default="true", in_key=flow, local_ip="192.168.56.101", out_key=flow, remote_ip="192.168.56.102"}
        Port br-tun
            Interface br-tun
                type: internal

compute:
 Bridge br-tun
        Port patch-int
            Interface patch-int
                type: patch
                options: {peer=patch-tun}
        Port br-tun
            Interface br-tun
                type: internal
        Port "gre-c0a83865"
            Interface "gre-c0a83865"
                type: gre
                options: {df_default="true", in_key=flow, local_ip="192.168.56.102", out_key=flow, remote_ip="192.168.56.101"}

I was not able to get vlan mode of connectivity working between the 2 hosts.

Networking Demo:

References:

One thought on “Openstack Juno – Multihost Networking

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s