Gone are the days when you need 3 or more nodes to do a test setup of Openstack. All you need is a single node. I call it “All-In-one” node. Let me explain you “HOW”.
To install Openstack in single node all you need is one NIC.
“Note that the NIC will be used for accessing the Operating System (Ubuntu), the services (API endpoints), the dashboard (Horizon) and for “exposing” VMs when you associate a floating IP address to them.”
Do we need to configure NIC before installing Openstack. YES, we do. Follow few simple steps to get your NIC configured. Before you configure NIC, lets assume
- you want to install Havana with Neutron (not nova-network)
- your installation is really a single node; i.e. you are not going to add compute nodes in the future
The first thing to do is to configure the network at Operating System level.
Step 1: You need to add an OpenVSwitch bridge for linking VM’s, assigning individual IP’s and exposing the VMs for external world to connect.Use the below command to add OpenVSwitch:
$ sudo ovs-vsctl add-br br-ex
Step 2: Now configure the network at OS level.
The following is an example of how you can configure the network using /etc/network/interfaces:
|auto loiface lo inet loopback
iface eth1 inet manual
up ip address add 0/0 dev $IFACE
up ip link set $IFACE up
up ifconfig $IFACE promisc
up ifconfig $IFACE multicast
down ip link set $IFACE down
iface br-ex inet static
up ifconfig $IFACE promisc
a) The first entry configures the loopback interface: no explanation is needed.
b) The second entry “starts” the interface whenever you switch on the PC. It’s worth noticing that you do not assign any IP address to such an interface and this is needed because this interface will ‘capture’ all the traffic on the physical network it is connected to. The ‘captured’ traffic will be forwarded to all the virtual devices connected to the interfaces and one of such devices is br-ex.
c) The third entry configures br-ex, an OpenVSwitch bridge that will serve for the following purposes:
- give access to the services (API endpoints) and Horizon
- give access to the PC’s Operating System (ubuntu)
- give access to VMs in the cloud when they are associated to a floating IP address
After setting up the configuration file, all you need is to reboot the PC and not just network restart as sometimes the configuration files doesn’t get updated in the kernel. Once the reboot is completed, you need to access the console locally rather than remotely. As there is no IP address assigned yet.
After accessing through the local console, you should see that you have three interfaces (ifconfig command):
|Lo Link encap:Local Loopbackinet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:91931 errors:0 dropped:0 overruns:0 frame:0
TX packets:91931 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:19815734 (19.8 MB) TX bytes:19815734 (19.8 MB)
eth1 Link encap:Ethernet HWaddr 00:1a:4b:dd:44:5e
inet6 addr: fe80::21a:4bff:fedd:445e/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:3370 errors:0 dropped:2 overruns:0 frame:0
TX packets:427 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:432117 (432.1 KB) TX bytes:60022 (60.0 KB)
br-ex Link encap:Ethernet HWaddr 00:1a:4b:dd:44:5e
inet addr:10.15.5.92 Bcast:10.15.5.255 Mask:255.255.255.0
inet6 addr: fe80::9051:56ff:fe8d:568d/64 Scope:Link
UP BROADCAST RUNNING PROMISC MTU:1500 Metric:1
RX packets:3238 errors:0 dropped:8 overruns:0 frame:0
TX packets:415 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:383674 (383.6 KB) TX bytes:56880 (56.8 KB)
Note: You are still not in a position to connect via remotely. Please execute the below command to assign an IP address to enable remote connectivity and internet connection.
$ sudo ovs-vsctl add-port br-ex eth1
At this point you should be able to access the PC from “outside” using the IP address assigned to br-ex. Please note that the connection survives till next reboot. You have to run the above command again once rebooted to establish the connection again.
Now you can start installing OpenStack following the doc from openstack official website.
When you install Neutron, you need to ensure the floating IP address assigned should be in the same subnet.
Refer example give below
- when you create the “external network”, the floating IP addresses need to be on the same network where br-ex is (e.g. if the node is on 10.15.5.0/24, the floating IP address need to be on 10.15.5.0/24 as well).
Note : You cannot proceed with remote OpenStack installation while using one NIC.
Hope this is was useful. Would be interested to hear your inputs/feedback.
visit us @ http://www.cloudenablers.com