Saturday, December 10, 2016

Install OpenStack Mitaka under Virtualbox

First, let's get VirtualBox and set up our VirtualBox machine:

Give it at least 6 GB RAM, having a 64-bit processor
Then create 3 networks:
NatNetwork(for connection with the external world) with address: 10.0.2.0/24, to support DHCP
and allow port forwarding which we will use to connect to the internal Virtual Machine (VM)s:
name:ssh, protocol: TCP, host IP: 10.0.2.15, host port 22, guest IP: 127.0.0.1, guest port:2022
this way you can use ssh or putty to connect to 127.0.0.1:2022 and access the internal Virtual machines.
Next, create 2 other host-only networks with the following details(for communication and data transfer):
ip:10.50.0.1
mask:255.255.255.0
and
ip:10.254.254.1
mask:255.255.255.0
both with DHCP disabled

SSH access:
If you experience problems connecting to the Virtual Machine, you can try to disable and stop the firewall:
sudo systemctl disable firewalld
sudo systemctl stop firewalld
add an exception for SSH access in the firewall
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
check the selinux configuration
sudo nano /etc/selinux/config
check the open ports on your network with:
1. find all the networks you would like to inspect:
ip a |more
2. Install and use Nmap to portscan those networks:
sudo yum install nmap
scan the open ports on the virtual machines:
nmap 10.0.2.*
nmap 10.254.254.*

Install CentOS host system
Download CentOS minimal ISO and boot up the machine via VirtualBox.
Once logged in in the VM, edit the sudoers file and place your account there:  sudo cat /etc/sudoers
(instead of always typing sudo in front of the commands, you can write: sudo -i and continue working)
sudo dhclient - to make DHCP give access to the Virtual machines to outside(Internet) IP addresses
then edit /etc/resolv.conf sudo nano /etc/resolv.conf and add google nameserver 8.8.8.8 to be able to fetch internet websites from VM.

Configure the three network interfaces using information such as IP addresses from above :
cd /etc/sysconfig/network-scripts/
sudo nano ifcfg-enp0s3
sudo ifdown enp0s3
sudo ifup enp0s3
(repeat the process for enp0s9 and enp0s8)
check if the configuration is correct
ip a

Preparing installation
We need to install additional packages:
sudo yum install wget tcpdump curl
install network synchronizing time server
sudo yum install ntp
set the hostname of our virtual machine:
sudo hostnamectl set-hostname myopenstack.com
stop and disable network interference from Network Manager:
sudo systemctl stop NetworkManager.service
sudo systemctl disable NetworkManager.service


Upgrade to the latest available kernel to ensure better performance on virtualization and integration with VirtualBox:
enable elrepo kernel repository
yum --enablerepo=elrepo-kernel install kernel-ml
install ncurses library:
sudo  yum install gcc ncurses ncurses-devel
sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
sudo rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
install fastestmirror to get closest repository:
sudo yum install yum-plugin-fastestmirror
install the kernel:
sudo yum --enablerepo=elrepo-kernel install kernel-ml
Reboot the system to make new kernel effectively loading
sudo reboot
check the kernel version
uname -a

Installing OpenStack Mitaka
get the RDO-release:
sudo yum install http://rdo.fedorapeople.org/rdo-release.rpm
then install the RPM package: sudo yum install openstack-packstack
Generate answers file for easier installation configuration of OpenStack
sudo packstack --gen-answers-file=.answers.cfg
install OpenStack using the answer-file:
sudo packstack --answer-file=.answers.cfg
Upgrade the openstack distribution as well as all other CentOS packages
sudo yum upgrade

Enter OpenStack dashboard using browser
(in Windows you can install xming server - to allow access from outside to OpenStack via ssh graphical screen )

install xauth authorization
sudo yum install xauth
sudo yum groupinstall fonts
*start the graphical terminal xterm
export DISPLAY=:0.0
start firefox and open up OpenStack dashboard
firefox 10.254.254.100/dashboard

Congratulations, you can now start using OpenStack :)
Enjoy!

Subscribe To My Channel for updates