Iaas Using Openstack: Cloud Computing: Lab 7

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

Cloud Computing: Lab 7

IaaS using OpenStack


Akshat Shah
Final Year BTech IT
181080009
Date: 27/02/2022

Aim
Implement the service model of "Infrastructure as a Service" or private cloud datacenter. Use
DevStack (Openstack) or Open Nebula or any other open-source framework for IaaS.

Theory
OpenStack is a cloud OS that is used to control the large pools of computing, storage, and
networking resources within a data center. Open Stack is open-source and free software. This is
basically used for cloud computing and deployed as an IaaS.

OpenStack is a software platform that uses pooled virtual resources to create and manage
private and public clouds. OpenStack offers many cloud-related services (such as networking,
storage, image services, identity, etc.) by default. This can be handled by users through a
web-based dashboard, a RESTful API, or command-line tools. OpenStack manages a lot of
virtual machines; this permits the usage of physical resources to be reduced.

Components of OpenStack
● Compute (Nova): Compute is a controller that is used to manage resources in
virtualized environments. It handles several virtual machines and other instances that
perform computing tasks.
● Object Storage (Swift): To store and retrieve arbitrary data in the cloud, object storage
is used. In Swift, it is possible to store the files, objects, backups, images, videos, virtual
machines, and other unstructured data. Developers may use a special identifier for
referring the file and objects in place of the path, which directly points to a file and allows
OpenStack to manage where to store the files.
● Block Storage (Cinder): This works in the traditional way of attaching and detaching an
external hard drive to the OS for its local use. Cinder manages to add, remove, create
new disk space in the server. This component provides the virtual storage for the virtual
machines in the system.
● Networking (Neutron): This component is used for networking in OpenStack. Neutron
manages all the network-related queries, such as IP address management, routers,
subnets, firewalls, VPNs, etc. It confirms that all the other components are well
connected with OpenStack.
● Dashboard (Horizon): This is the first component that the user sees in OpenStack.
Horizon is the web UI (user interface) component used to access the other back-end
services. Through individual API (Application programming interface), developers can
access the OpenStack's components, but through the dashboard, system administrators
can look at what is going on in the cloud and manage it as per their need.
● Identity Service (Keystone): It is the central repository of all the users and their
permissions for the OpenStack services they use. This component is used to manage
identity services like authorization, authentication, AWS Styles (Amazon Web Services)
logins, token-based systems, and checking the other credentials (username &
password).
● Image Service (Glance): The glance component is used to provide the image services
to OpenStack. Here, image service means the images or virtual copies of hard disks.
When we plan to deploy a new virtual machine instance, then glance allows us to use
these images as templates. Glance allows virtual box (VDI), VMware (VMDK, OVF),
Raw, Hyper-V (VHD) and KVM (qcow2) virtual images

Implementation
We need to start with a clean and minimal install of a Linux system. DevStack attempts to
support the two latest LTS releases of Ubuntu, the latest/current Fedora version, CentOS/RHEL
8, OpenSUSE and openEuler. Hence this experiment used Ubuntu 20.04.04 LTS Server as a
virtual machine on KVM for installing and running OpenStack. It has 4GB memory, 2 vCPUs and
60GB storage allocated to it from the host machine.

DevStack should be run as a non-root user with sudo enabled. In this case, the user is named
“akshat”, set up during installation of Ubuntu 20 server.

Next, we download DevStack by cloning its git repository. The devstack repo contains a script
that installs OpenStack and templates for configuration files.
Create a local.conf file with four passwords preset at the root of the devstack git repo. This is
the minimum required config to get started with DevStack. The local.conf in the samples
subdirectory of the repo has more details:
https://opendev.org/openstack/devstack/src/branch/master/samples/local.conf. In addition to
passwords for different services, it specifies which git branches to use for installation of the
different OpenStack components.

Start the installation using the stack.sh script. The script can be referred to here:
https://opendev.org/openstack/devstack/src/branch/master/stack.sh. The script is very long
(1563 lines), and in turn uses other sh files in the repository. It is however documented with a lot
of comments that explain blocks of commands. This script installs:
● Keystone – Identity Service
● Glance – Image Service
● Nova – Compute Service
● Placement – Placement API
● Cinder – Block Storage Service
● Neutron – Networking Service
● Horizon – OpenStack Dashboard
Notes:
● For the installation to succeed, changes mentioned in this post on StackOverflow had to
be made. Follow these instructions if you get the same error as in the post.
○ Open the file /opt/stack/devstack/lib/neutron_plugins/ovn_agent
○ Change the line
OVS_RUNDIR=$OVS_PREFIX/var/run/openvswitch
to
OVS_RUNDIR=$OVS_PREFIX/var/run/ovn
○ Delete the /var/run/ovn directory
○ Run clean.sh
○ Run unstack.sh
○ Reboot
○ Re-run stack.sh
● DevStack’s installation of OpenStack components requires a logical volume called
“cinder-volume” for Cinder’s storage volumes.
○ Create a logical volume called cinder-volume using lvm
Horizon Dashboard:

In the Admin > Overview section, we can see a summary of the current usage of cloud
resources:
Admin > Compute

> Hypervisors

We see that we have a total of 2 vCPUs, 3.8GB of memory and 57 GB storage available. These
resources are of the VM that we are using to run a single-vm cloud. We have a single host,
ubuntu20-server of type QEMU, which provides these resources.

> Flavours
Here we can see the different compute flavours offered by this cloud. Each has a specific
amount of vCPUs, RAM, disk space and the like.
> Images
The images offered by this cloud. By default, devstack has the cirros image, and details of the
image are as shown:
Admin > Network

> Networks
We see that by default, there are three networks in the default project, each with its own
subnets: private, shared and public.

Admin > System

> Defaults
The default quotas for compute, volume and network resources.
Default Compute Quotas Default Network Quotas

Default Volume Quotas


> Metadata Information

> System Information


We can see which services are running, their purpose and their endpoints.

Project
Cloud providers group resources used for a certain application or project as a “Project”.
DevStack sets up a project during installation.
Here we see that the project name is “demo” and project ID is
“9df4c0e0c0c64da6b53cbadaa888a8a7”. In Project > API Access, we can see the same
services as we saw in the admin section, but with the endpoints specifying the project ID.

Parallel to the Overview, Compute, Network, Volumes subsections in the Admin section, these
subsections in the Project section give respective details related to the project.
Creating a compute instance
Creating a volume
Networking
Conclusion
In this experiment, we looked at OpenStack, a popular IaaS solution for setting up private
clouds. We installed OpenStack components, viz. Nova, Keystone, Glance, Cinder, Placement,
Neutron and Horizon on a single Ubuntu server with the resources of the same server pooled as
part of the infrastructure. We saw how instances can be created and used and how volumes can
be created and attached to VMs.

References
● https://docs.openstack.org/devstack/latest/
● https://opendev.org/openstack/devstack
● https://www.javatpoint.com/openstack
● https://docs.openstack.org/xena/
● https://stackoverflow.com/questions/68001501/error-opt-stack-devstack-lib-neutron-plugi
ns-ovn-agent174-socket

You might also like