Spending nearly 14
years in core telecom, I was surrounded by terms as RNC, MME, VoLTE, IMS,
Bearers, CDRs etc.. I was totally disconnected with terms as Linux, Ubuntu,
Sudo, Python, REST etc…
But as Cloud is coming to Telecom, it was essential for me to
upgrade my skill to maintain my marketability.
So I entered into world of Openstack. I am sharing my first experience in deploying
Devstack on by old Pantium Laptop with 60 GB harddisk and 3GB RAM.
About DEVSTACK
From https://wiki.openstack.org/wiki/DevStack
, “ DevStack's mission is to provide and
maintain tools used for the installation of the central OpenStack services from
source (git repository master, or specific branches) suitable for development
and operational testing. DevStack is an opinionated script to quickly create an
OpenStack development environment……” ..
So what I understand is Devstack is development framework
for Openstack. If you want hands-on experience in Openstack, install Devstack
in laptop and do some hands-on exercises.
What confused me is word opinionated
script.. So when in doubt --- > Google.. One has to
be avid Google searchers to learn
coding.
After reading few blogs (God
bless those authors !!), I found that software can be opinionated or
un-opinionated. Opinionated software have defined workflows/execution steps,
e.g Devstack has defined installation steps 1) install git 2) git clone Devstack
3) configure localRc 4) run stack.sh..
If you stick to these steps, your life will be easy
otherwise, you will face roadblocks in Devstack deployment.
Infra Requirements
1) Need Ubuntu
12.04 or newer ( devstack works with other Oss as well)
2) Need 3GB
(minimum ) or more(8 GB is cool ) RAM
3) We need 10
GB of storage
4) If Devstack
is installed on VM, Oracle virtual box
is good option ( at least 3 GB of RAM for VM)
Linux requirements
1) User need
Sudo( Sudo is superuser with admin rights)
authority to deploy Devstack
2) Internet connectivity
and Proxies should allow downloading of Ubuntu’s git-client
and websites as git.openstack.org and pypl.python.org
websites ( if proxy setting are troubling, use Unset Proxy command)
Detailed
Workflow
1)
Start Ubuntu ( on standalone node or VM)
2)
Open Terminal( If you are totally new to Ubuntu, find
Terminal in Search option)
3) Log into Terminal
4) Write following commands:
a. Sudo apt-get update –y
We
use Sudo because we need admin right to install/update packages. APT stands for
Advanced packaging tool.. Our command updates index of installed Ubuntu package.
b. Sudo apt-get install git - >>We are installing Git client from Ubuntu website
About GIT
Version control systems allow to keep track changes, revert to previous
stages, and branch to create alternate versions of files and directories.Git is
one of the most populate version control system, developped by Linus Torvalds.
Many projects maintain their files in a git repository, and sites like GitHub
and Bitbucket for sharing and contributing code. We need to install Git clint
to use Git repository.
We download (git clone) Devstack files from https://github.com/openstack
-dev/devstack.git and we want icehouse branch.
Type command: git clone
‘https://github.com/openstack-dev/devstack.git’ –b stable/icehouse
6) Configure LocalRC
Once copying (cloning) is done, we need to visit
localRC file.
We make
local configurations such as timezone, Wifi access point, user password.. etc. while
installing windows/Ubuntu. Similarly
Devstack gives user option to configure certain Local parameters stored in
Local.Conf file. If we don’t do any config change, defaults values will be
taken. Its good to know about. Local.conf
file as we might need to change floating IP ranges, module passwords.. and many
more things.
I
used CP command but learnt that CP is mostly used to copy file. CP command did not worked to open LocalRC file.
Finally I found Nano command. Nano Command will trigger text editor. I used “Nano Local.Conf” to edit Local.conf file. Nano editor will open.
7)
Change
the local.conf file.
I added two lines to store log file and capture
screen session, for study purpose.
Type command at end of file:
LOGFILE =/opt/vadan/logs/stack.sh.log # logging file location
USE_SCREEN=True
8) Run ./ Stack.sh
Type :
./ stack.sh (under devstack directory)
Now we are ready to run ./stack.sh. It installs and configures various combinations of Ceilometer, Cinder, Glance, Heat, Horizon, Keystone, Nova, Neutron, and Swift. Its like .exe file. It. Successful run of Stack.sh means devstack is deployed.
Developer can make any changes in Openstack modules (ceilometer, Cider, Nova..etc) and run Stack.sh. Successful run of stack.sh will deploy Devstack with updated code. Stack.sh will ask for password for database and other modules.
9) Bump 1:
Oslo.Middleware Error
During stack.sh run, I encountered Oslo
MiddleWare Requirement Error.
I had no clue about this error. I learnt that Oslo code produce set of python
libraries. I assumed that may be my editing of Local.Conf file is not good. So
decided to use local.conf default values.
I deleted my comments from step 7) and re-ran
stack.sh.
10) Bump 2: Permission Error
After
correcting local.conf file, my Oslo error went away. But I landed up in another
Permission error. Mysql permission issue.
My account (vadan) did not had permission to deploy Mysql dB.
After i googling I found (God bless Bloggers) that, I need to add my name under Sudoer’s List. And add No Password command.Type Visudo in editor..
Visudo will open following
screen. I added following commands in Visudo screen,
#under User Privilege
specification:
vadan ALL=(ALL:ALL)
ALL # This is to give all previledges to user vadan
# includedir
/etc/sudoers.d
vadan ALL=(ALL)
NOPASSWD:ALL # This is to remove passwords restrictions
11)
Successful
Stack.sh
Finally Stack.sh ran successfully J
J J J It ended
with providing IP address of Horizon dashboard.
12)
Launching
Horizon Dashboard
I logged
into Horizon from Firefox by using IP address, user name and password,
mentioned at Stack.sh, to access horizon Dashboard. If you are using VM, than
use Firefox of VM, not from host
13)
Launch
Exercise.sh
I ran
exercise.sh.We can see the one Virtual Machine spawned in Horizon.
Deploying Devstack on personal laptop was wonderful experience. It has connected to world of Cloud management and orchestration. Happy Stacking :)
No comments:
Post a Comment