VirtualBox Basics Getting Started The following are the conventional methods of deploying OpenStack on Virtual Box for the sake of a test/sandbox or just to try out OpenStack on commodity hardware. 1. DevStack 2. Vagrant But DevStack and Vagrant bring in some level of automated deployment as running the scripts will get your VirtualBox Instance configured as the required OpenStack deployment. We will be manually deploying OpenStack on VirtualBox Instance to get better view of how OpenStack works. Prerequisite: Well, its a daunting task to just cover all of OpenStack’s concepts let alone Virtualization and Networking. So some basic idea/knowledge on Virtualization, Networking and Linux is required. Even though I will try to keep the level as low as possible for making it easy for Linux Newbies as well as experts. These Virtual Machines and Virtual Networks will be given equal privilege as a physical machine on a physical network. Just for those who would want to do a deeper research or study, for more information you may refer the following links OpenStack:OpenStack Official Documentation (docs.openstack.org) Networking:Computer Networks (5th Edition) by Andrew S. Tanenbaum VirtualBox:Virtual Box Manual (http://www.virtualbox.org/manual/UserManual.html) Requirements : Operating Systems - I recommend Ubuntu Server 12.04 LTS, Ubuntu Server 13.10 or Debian Wheezy Note :Ubuntu 12.10 is not supporting OpenStack Grizzly Packages. Ubuntu team has decided not to package Grizzly Packages for Ubuntu 12.10. Recommended Requirements. VT Enabled PC: Intel ix or Amd QuadCore 4GB Ram: DDR2/DDR3 Minimum Requirements. Non-VT PC's: Intel Core 2 Duo or Amd Dual Core 2GB Ram: DDR2/DDR3 If you don't know whether your processor is VT enabled, you could check it by installing cpu checker $sudo apt-get install cpu-checker$sudo kvm-ok If your device does not support VT it will show INFO:Your CPU does not support KVM extensions KVM acceleration can NOT be used You will still be able to use Virtual Box but the instances will be very slow. There are many ways to configure your OpenStack Setup, we will be deploying OpenStack Multi Node using OVS as the Network Plugin and QEMU/ KVM as the hypervisor. Host Only Connections: Host only connections provide an Internal network between your host and the Virtual Machine instances up and running on your host machine.This network is not traceable by other networks. You may even use Bridged connection if you have a router/switch. I am assuming the worst case (one IP without any router), so that it is simple to get the required networks running without the hassle of IP tables. The following are the host only connections that you will be setting up later on : vboxnet0 - OpenStack Management Network - Host static IP 10.10.10.1 vboxnet1 - VM Conf.Network - Host Static IP 10.20.20.1 vboxnet2 - VM External Network Access (Host Machine) Network Diagram :
Network Diagram
Vboxnet0, Vboxnet1, Vboxnet2 - are virtual networks setup up by virtual box with your host machine. This is the way your host can communicate with the virtual machines. These networks are in turn used by virtual box VM’s for OpenStack networks, so that OpenStack’s services can communicate with each other. Setup Your VM Environment Before you can start configuring your Environment you need to download some of the following stuff: Oracle Virtual Box Note:You cannot set up a amd64 VM on a x86 machine. Ubuntu 12.04 Server or Ubuntu 13.04 Server Note:You need a x86 image for VM's if kvm-ok fails, even though you are on amd64 machine. Note: Even Though I'm using Ubuntu as Host, the same is applicable to Windows, Mac and other Linux Hosts. If you have i5 or i7 2nd gen processor you can have VT technology inside VM's provided by VmWare. This means that your OpenStack nodes(Which are in turn VM's) will give positive result on KVM-OK. (I call it - Nesting of type-2 Hypervisors). Rest of the configurations remain same except for the UI and few other trivial differences. Configure Virtual Networks This section of the guide will help you setup your networks for your Virtual Machine. Launch Virtual Box Click on File>Preferences present on the menu bar of Virtual Box. Select the Network tab. On the right side you will see an option to add Host-Only networks.
Create Host Only Networks
Create three Host-Only Network Connections. As shown above. Edit the Host-Only Connections to have the following settings. Vboxnet0 Option Value IPv4 Address: 10.10.10.1 IPv4 Network Mask: 255.255.255.0 IPv6 Address: Can be Left Blank IPv6 Network Mask Length : Can be Left Blank
Vboxnet0
Vboxnet1 Option Value IPv4 Address: 10.20.20.1 IPv4 Network Mask: 255.255.255.0 IPv6 Address: Can be Left Blank IPv6 Network Mask Length : Can be Left Blank
Vboxnet1
Vboxnet2 Option Value IPv4 Address: 192.168.100.1 IPv4 Network Mask: 255.255.255.0 IPv6 Address: Can be Left Blank IPv6 Network Mask Length : Can be Left Blank
Image: Vboxnet2
Install SSH and FTP You may benefit by installing SSH and FTP so that you could use your remote shell to login into the machine and use your terminal which is more convenient that using the Virtual Machines tty through the Virtual Box's UI. You get a few added comforts like copy - paste commands into the remote terminal which is not possible directly on VM. FTP is for transferring files to and fro ... you can also use SFTP or install FTPD on both HOST and VM's. Installation of SSH and FTP with its configuration is out of scope of this GUIDE and I may put it up but it depends upon my free time. If someone wants to contribute to this - please do so. Note:Please set up the Networks from inside the VM before trying to SSH and FTP into the machines. I would suggest setting it up at once just after the installation of the Server on VM's is over. Install Your VM's Instances During Installation of The Operating Systems you will be asked for Custom Software to Install , if you are confused or not sure about this, just skip this step by pressing Enter Key without selecting any of the given Options. Warning - Please do not install any of the other packages except for which are mentioned below unless you know what you are doing. There is a good chance that you may end up getting unwanted errors, package conflicts ... due to the same. Control Node: Create a new virtual machine. Select Ubuntu Server
Create New Virtual Machine
Select appropriate RAM, minimum 512 MB of RAM for Control Node. Rest all can be default settings. The hard disk size can be 8GB as default. Configure the networks (Ignore the IP Address for now, you will set it up from inside the VM) Network Adapter Host-Only Adapter Name IP Address eth0 Vboxnet0 10.10.10.51 eth1 Vboxnet2 10.20.20.51 eth2 NAT DHCP Adapter 1 (Vboxnet0)
Adapter1 - Vboxnet0
Adapter 2 (Vboxnet2)
Adapter2 - Vboxnet2
Adapter 3 (NAT)
Adapter3 - NAT
Now Install Ubuntu Server 12.04 or 13.04 on this machine. Note :Install SSH server when asked for Custom Software to Install. Rest of the packages are not required and may come in the way of OpenStack packages - like DNS servers etc. (not necessary). Unless you know what you are doing. Network Node: Create a new Virtual Machine, Minimum RAM is 512MB. Rest all can be left default. Minimum HDD space 8GB.
Create New Virtual Machine
Configure the networks (Ignore the IP Address for now, you will set it up from inside the VM) Network Adapter Host-Only Adapter Name IP Address eth0 Vboxnet0 10.10.10.52 eth1 Vboxnet1 10.20.20.52 eth2 Vboxnet2 192.168.100.51 eth3 NAT DHCP Adapter 1 (Vboxnet0)
Adapter 1 - Vboxnet0
Adapter 2 (Vboxnet1)
Adapter2 - Vboxnet1
Adapter 3 (Vboxnet2)
Adapter3 - Vboxnet2
Adapter 4 (NAT)
Adapter4 - NAT
Now Install Ubuntu Server 12.04 or 13.04 on this machine. Note :Install SSH server when asked for Custom Software to Install. Rest of the packages are not required and may come in the way of OpenStack packages - like DNS servers etc. (not necessary). Unless you know what you are doing. Compute Node: Create a new virtual machine, give it atleast 1,000 MB RAM. Rest all can be left as defaults. Give atleast 8GB HDD.
Create New Virtual Machine
Configure the networks (Ignore the IP Address for now, you will set it up from inside the VM) Network Adapter Host-Only Adapter Name IP Address eth0 Vboxnet0 10.10.10.53 eth1 Vboxnet1 10.20.20.53 eth2 NAT DHCP Adapter 1 (Vboxnet0)
Adapter1 - Vboxnet0
Adapter 2 (Vboxnet1)
Adapter2 - Vboxnet1
Adapter 3 (NAT)
Adapter3 - NAT
Now Install Ubuntu Server 12.04 or 13.04 on this machine. Note :Install SSH server when asked for Custom Software to Install. Rest of the packages are not required and may come in the way of OpenStack packages - like DNS servers etc. (not necessary). Unless you know what you are doing. Warnings/Advice : Well there are a few warnings that I must give you out of experience due to common habits that most people may have : Sometimes shutting down your Virtual Machine may lead to malfunctioning of OpenStack Services. Try not to direct shutdown your 3. In case your VM's don't get internet. From your VM Instance, Use ping command to see whether Internet is on. $ping www.google.com If its not connected, restart networking service- $sudo service networking restart $ping www.google.com If this doesn't work, you need to check your network settings from Virtual Box, you may have left something or misconfigured it. This should reconnect your network about 99% of the times. If you are really unlucky you must be having some other problems or your Internet connection itself is not functioning. Note :There are known bugs with the ping under NAT. Although the latest versions of Virtual Box have better performance, sometimes ping may not work even if your Network is connected to internet. Congrats, you are ready with the infrastructure for deploying OpenStack. Just make sure that you have installed Ubuntu Server on the above setup Virtual Box Instances. In the next section we will go through deploying OpenStack using the above created Virtual Box instances.