CLD 64-91

Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

Aim : To demonstrate installation and Configuration of Open stack Private cloud.

Requirements :

1) PC with VirtualBox with Ubuntu installation

Or Ubuntu Linux Installed PC

2) Openstack

Theory : OpenStack

OpenStack is an open-source platform, which offers powerful virtual servers and required
services for cloud computing. It is mostly deployed as Infrastructure-as-a-service (IaaS), which
aims to provide hardware tools and components for processing, storage, and networking
resources throughout a data center.
OpenStack can be understood as a software platform that uses pooled virtual resources to build
and manage clouds, both public and private ones.
By default, OpenStack offers a couple of cloud-related services like networking, storage, image
services, identity, etc., and can be clubbed with a few more to get a customized cloud
optimization to support the cloud-native apps.
Benefits of OpenStack
 OpenStack is most importantly an open-source environment that gives complete control
over cloud computation. Most of the platforms available in the market, which helps in
virtualization and cloud computation, are all expensive and licensed.
 OpenStack can be installed free of cost and can be customized with the required services
to suit the need. Hence many corporations own their own version of OpenStack.
 Moreover, it can be scaled to any extent possible, making the jobs of the server admins
easier.
 The OpenStack API is made robust and more flexible with improvements contributed by
many developers across the world. This also ensures good community support.
 Many big-shot companies in the IT world like Huawei, Intel, Red Hat have adopted
OpenStack on their cloud management.
Many cloud platforms have integrated OpenStack in their cloud toolkit by default. The
OpenStack backend is ever-growing with many companies joining in every day
Terminologies in OpenStack
The important terminologies that are repeatedly used in the rest of the module are discussed
below in brief. These terminologies are important components of OpenStack architecture.
By default, OpenStack has many different moving parts. Besides, because of the open-source
nature of OpenStack, many developers can contribute to the addition of new components for the
personalized application. But to clarify, the OpenStack community has declared around 9
components to be an integral part of OpenStack. They are:
 Nova: This is the fundamental computing engine of OpenStack. It manages a large
number of Virtual machines and other instances, which handle computing tasks.
 Swift: Swift is the storage system of OpenStack. It is used to store objects and files.
Instead of referring to the file and objects through the path, developers can instead refer
to them through a unique identifier, which points to a file or piece of information and
thereby allow OpenStack to manage where to store the files. This reduces the effort of the
developers to understand and worry about storage distribution. This also ensures that the
data is being backed up, if in case of any failure of the machine or network loss.
 Cinder: Cinder is known as the block storage component of OpenStack. This functions
in a way, analogous to the traditional ways of locating and accessing specific locations on
a disk or a drive.
 Neutron: As the name suggests, Neutron is the component that enables networking in
OpenStack. It ensures that each component within the OpenStack is well connected with
other components, to establish good communication amongst them.
 Horizon: Horizon is the dashboard of the OpenStack system. It provides all the
possibilities for the system administrators to access and manage the cloud. This is the
first component that everyone “sees” upon starting to use the OpenStack. Developers will
be able to access and deal with all the components through the Application Programming
Interface (API) also, while Horizon is the only place through which the system admins
will be interacting with the OpenStack architecture.
 Keystone: Keystone is the component that provides identity services for all users. It
basically contains a central list of all the users of the OpenStack cloud, mapped to the
accessible services of the OpenStack. It provides a way for multiple accesses by allowing
the developers to map their existing user access methods to the Keystone.
 Glance: Glance provides the image services in OpenStack, where images refer to the
virtual copies of the hard disks. Glance helps in allocating these images to be used as
templates while assigning new virtual machine instances.
 Ceilometer: Ceilometer provides telemetry services to its users. It performs a close
regulation of each user's cloud components' usage and provides a bill for the services
used. Think of Ceilometer as a component to meter the usage and report the same to
individual users.
 Heat: Heat is that component of the OpenStack that allows developers to store the
requirements of a cloud application in a file so that all the resources necessary for a
program are available at hand. It thus provides an infrastructure to manage a cloud
application. It is an orchestration instrument of OpenStack.

Getting started with OpenStack


OpenStack, being an open-source engine, there are many ways in which you gain a trial
experience using OpenStack. Two main ways through which you can experience the OpenStack
environment easily are given below:
 Sign up for a public cloud
Try the OpenStack Public cloud infrastructure available across the world by participating in
public cloud programs from OpenStack. Use the link to have a glimpse of the OpenStack Public
Cloud Passport Program.
 Local Dev Instance
OpenStack can be explored on the Local Dev with the help of DevStack. Devstack intends to
provide tools for the installation of the core Openstack. Devstack can be installed and run on the
virtual machine, besides on the normal OS. This is suited well for the users, who are willing to
explore the features of the dashboard of what the admin cloud stack looks like. You can get more
information On DevStack
You can install Devstack through the Git Source
Since OpenStack is the free source available on the internet, open to all developers, finding an
authentic link to look for updates becomes tedious. Considering this, Opensource.com is working
incessantly to provide the latest updates on OpenStack, which gives the required guidelines to
the developments in OpenStack.
Besides this, there are many other sources available, which keep the recent updates on
OpenStack posted. Mindmajix is one of the best sources for it. We will know more about this
later in this module.
OpenStack Architecture
The basic components that make up the architecture of OpenStack are:
Compute (Nova)
 Compute is one of the most important and mandatory components of OpenStack. It is
basically a virtualization hypervisor. In a cloud computing environment, it acts as a
controller, which manages all the resources in a virtual environment. It is also used to
manage high-performance bare metal configurations.
 It is coded in Python and has utilized many pre-defined libraries to deliver robust
functioning. The hypervisor technologies that might be used are Xen, KVM, and
VMware and this selection depend on the version of OpenStack used. SQL is used for
database access.

The above picture dissects the computer and the explanation of the picture is given below.
Functionality
 The nova-API handles the requests and responses from and to the end-user.
 The nova-compute creates and destroys the instances as and when a request is made.
 Nova-scheduler schedules the tasks to the nova-compute
 The glace registry stores the details of the image along with its metadata.
 The Image store stores the images predefined by the admin/user.
 The nova network ensures network connectivity and routing.
Networking (Neuron)
This is responsible for establishing a neuron structure between the components for better
connectivity. It manages all the networking-related functionalities of the architecture as a whole.
Starting from assigning and managing the IP addresses of the nodes to managing and
implementing routing, it constitutes all.
Image
The instances of the virtual machines or the disk image are stored as images in the image storage
Glance.
Object Storage (Swift)
This is the mountable storage unit of the architecture. It helps in data replication across the data
center. The files and objects can be copied to multiple units with the help of this unit. The object
storage units are replicated with every new server addition. It also stores the replicate content
from all the active nodes and makes it available to the new clusters, ensuring a backup in case of
any hardware failure or server loss.
Block Storage (Cinder)
Block Storage provides persistent level storage facilities for cloud-oriented computing devices. It
helps in the creation, addition, and removal of the new block devices in the server. It provides
complete integration with the OpenStack, reducing the use of extraneous hardware components.
It can be accessed and instructed using CLI or web-based services. Linux-based systems can go
with Cloudbyte, EMC, Coraid, SAN Storage, etc.
Logical Architecture
Understanding the logical architecture, besides the basic structural architecture, is essential to
design, deploy and configure OpenStack.
OpenStack is made of all distinct Services. Each of these services is internally configured to have
one API service. Each API service is always looking for API requests and these requests when
obtained are preprocessed and passed on to the other parts of the service.
The diagram below has shown a pictorial representation of the Logical Architecture in
OpenStack.
 All services are authenticated through the one Identity Service (Keystone). Individual
services generally interact with each other through the public APIs, except for few, which
require admin privileges.
 For the inter-process communication within a service, an AMQP message broker is used.
The state of service will be stored and updated in the database.
 When you are configuring your OpenStack cloud, you can choose the message broker
and the database solution from a list of products/solutions available from the market, such
as RabbitMQ, MySQL, MariaDB, and SQLite.
 OpenStack can be accessed on web User Interface through CLI or through API calls
using tools like curl or other plug-ins. Ultimately, all these REST API calls will issue
access to the OpenStack services.
OpenStack Pros
 The idea of OpenStack can be better appreciated when we treat it as an environment than
as a mere product.
 OpenStack is a generic infrastructure that is built to handle many possibilities on the
cloud, based on the need. The companies are free to plug into and make necessary
changes to shape the environment to their need.
 It is also very efficient to handle both public and private clouds with a common
infrastructure, cutting down the dependency on two different environments to handle
private and public clouds.
For an end-user, the advantage of using OpenStack lies in the following points
 The average cost and complexity of supporting a generic infrastructure are low by
definition than supporting a large diversity of infrastructures that don't share a common
ground.
 As many big shot companies and independent developers are constantly contributing to
make OpenStack a better environment, it is more reliable to switch to, than those of
independent vendors.
 When talking about a company, managing both private and public clouds separately costs
heavily in terms of the labor, infrastructure investment, customizing capacity of the
specific infrastructure along the added risk. OpenStack, on the other hand, has grown to
support private and public clouds more efficiently than any other competitor in the
market. Moreover, it is always easier to manage one single environment than two
different ones.
Owing to all these advantages of OpenStack, which count in the longer run, many companies
have adopted it and have integrated into their back-end infrastructure. Some of the companies to
mention are, AT&T, Ericsson, Huawei, and Intel.
Steps for Openstack Installation
The OpenStack installation can be done using many ways like RDO Pack stack, Mirantis or
Devstack who have series of shell scripts which carries automated installation of OpenStack. The
DevStack is a series of extensible scripts used to quickly bring up a complete OpenStack
environment based on the latest versions of everything from git master.

To install OpenStack using Devstack the Prerequisites are Intel or AMD Multicore CPU, Minimum
6-8GB RAM, 250 GB Hard disk and preinstalled Ubuntu server/Desktop Operating system version
16.04 or above and internet speed should be minimum 4 MBPS. (The installation steps can be
found at https://docs.openstack.org/devstack/latest/)

The steps for installing Openstack using Devstack in a single server (All in one Single machine
setup) are given as follows

Step 1-: Update the ubuntu repository and install git package

The current version of Ubuntu OpenStack is Newton. So, that’s what we are going to install. To
begin with the installation, first, we need to use the git command to clone devstack.

$sudo apt-get update


$sudo apt-get install git
Step 2 -: Download the latest git repository for openstack
$ git clone https://git.openstack.org/openstack-dev/devstack

Step 3-: Open Devstack directory and start installation by executing stack.sh shell script
$cd Devstack
$./stack.shCL
At the initial stage, the installer will ask passwords for database, rabbit, service authentication,
horizon and keystone.
The installer may take up to 30 minutes to complete the installation depends on the internet
bandwidth. Once installation is done you may see the following screen which displays ip address
of dashboard i.e. horizon through which you can gain access to open stack VMs and resources

As you can see, two users have been created for you; admin and demo. Your password is the
password you set earlier. These are the usernames you will use to login to the OpenStack
Horizon Dashboard.
Open up a browser, and put the Horizon Dashboard address in your address bar.
http://192.168.0.116/dashboard you should see a login page like this.

To start with, log in with the admin users credentials. In admin panel, you will need to use the
demo user, or create a new user, to create and deploy instances. As you can see, two users have
been created for you; admin and demo. Your password is the password you set earlier. These are
the usernames you will use to login to the OpenStack Horizon Dashboard. Take note of the Horizon
web address listed in your terminal.
Creating and running Instances

To launch an instance from OpenStack dashboard, first we need to finish following steps:

▪ Create a Project and add a member to the Project.


▪ Create Image and Flavor
▪ Create Network for the Project.
▪ Create Router for the Project.LOCOMPUTING LAB MANUAL COMPILED BY PROF.
▪ Create a Key pair

A) Create a Project and add a member to the Project.


Login to the dashboard using Admin credentials and Go to Identity Tab –> Projects and Click
on Create Project.

Click on “Create Project” , We can also set the Quota for the project from Quota Tab. To create
Users , Go to Identify Tab–> Users–> Click on ‘Create User’ Button then specify User
Name, email, password, Primary Project and Role and click on create user to add in to
OpenStack workspace.
B) Create Image and Flavor

To create a flavor login in dashboard using admin credentials, Go to Admin Tab –> Flavors –>
Click on create Flavor.

CLOUD

COMPUTING LAB MANUAL COMPILED BY PROF. BHUSHAN JADHAV CONTACT -


:9702868662
Specify the Flavor Name (fedora.small) , VCPU , Root Disk , Ephemeral Disk & Swap disk.
To Create Image , Go to Admin Tab –> Images—> Click on Create Image. Specify the
Image Name , Description, Image Soure ( in my case i am using Fedora Image File which i have
already downloaded from fedora website with Format QCOW2)CLO

UD COMPUTING LAB MANUAL COMPILED BY PROF. BHUSHAN JADHAV CONTACT


-:9702868662
C) Create Network for the Project.

To create Network and router for Innovation project sign out of admin user and login as local
user in dashboard.
For my convenience i have setup my network as above
Internal Network = 10.10.10.0/24
External Network or Floating IP Network = 192.168.1.0/24
Gateway of External Network = 192.168.1.1

Now, Go to the Network Tab —> Click on Networks —> then Click on Create
Network Specify the Network Name as Internal

Click on Next. Then Specify the Subnet name (sub-internal) and Network Address (10.10.0.0/24)
Click on Next. Now, VMs will be getting internal IP from DHCP Server because we enable
DHCP option for internal network.

Now Create External Network. Click on “Create Network” again, Specify Network Name as
“external”
CLOUD COMPUTING LAB MANUAL COMPILED BY PROF. BHUSHAN JADHAV CONTACT
-:9702868662
Click on Next. Specify subnet Name as “sub-external” & Network Address as
“192.168.1.0/24”

Click on Next

Untick “Enable DHCP” option and Specify the ip address pool for external network.
Click on Create.

D) Create Router for the Project


Now time to create a Router. To create router Go To Network Tab –> Routers –> Click on
‘+ Create Router’

Now Mark External network as “External” , this task can be completed only from admin user , so
logout from linuxtechi user and login as admin.

Go to Admin Tab —> Networks–> Click on Edit Network for “External”


Click on Save Changes. Now Logout from admin user and login as local user. Go to Network
Tab —> Routers –> for Router1 click on “Set Gateway”
CLOUD COMPUTING LAB MANUAL COMPILED BY PROF. BHUSHAN JADHAV CONTACT
-:9702868662

Click on “Set Gateway”, this will add a interface on router and will assign the first ip of external
subnet (192.168.1.0/24).

Add internal interface to router as well , Click on the “router1″ and select on “interfaces” and
then click on “Add interface”
Now, Network Part is completed now & we can view Network Topology from “Network
Topology” Tab as below.
Now Create a key pair that will be used for accessing the VM and define the Security firewall
rules.

E)Create a key pair

Go to ‘Access & Security’ Tab —> Click on Key Pairs –> then click on ‘Create Key Pair‘

It will create a Key pair with name “myssh-keys.pem” Add a new Security Group with name
‘fedora-rules’ from Access & Security Tab. Allow 22 and ICMP from Internet ( 0.0.0.0 ).
Once the Security Group ‘fedora-rules’ created , click on Manage Rules and allow 22 & ICMP
ping.

Click on Add , Similarly add a rule for ICMP.

F) Launch Instance

Now finally it’s time to launch an instance. To launch instance, Go to Compute Tab –> Click on
Instances –> then click on ‘Launch Instance’ Then Specify the Instance Name, Flavor that we
created in above steps and ‘Boot from image’ from Instance Boot Source option and Select
Image Name ‘fedora-image’.

CLOUD COMPUTING LAB MANUAL COMPILED BY PROF. BHUSHAN JADHAV CONTACT


-:9702868662
Click on ‘Access & Security’ and Select the Security Group ‘fedora-rules’ & Key Pair ”myssh
keys‘

Now Select Networking and add ‘Internal’ Network and the Click on Launch ….
CLOUD COMPUTING LAB MANUAL COMPILED BY PROF. BHUSHAN
JADHAV CONTACT -:9702868662
Once the VM is launched , Associate a floating ip so that we can access the VM.

Click on ‘Associate Floating IP‘ to get public IP addresses


Click on Allocate IP.

CLOUD COMPUTING LAB MANUAL COMPILED BY PROF. BHUSHAN JADHAV


CONTACT -:9702868662
Click on Associate

Now try to access the VM with floating IP ( 192.168.1.20) using keys.

As we can see above that we are able to access the VM using keys. Our task of launching a VM
from Dashboard is Completed Now.
Conclusion : Openstack was Installed and Configured.
CLOUD COMPUTING LAB MANUAL COMPILED BY PROF. BHUSHAN JADHAV CONTACT
-:9702868662

You might also like