You are on page 1of 13

Virtualization in Action

Introduction
BetterDev is a Norwegian based, global educational company. It provides a
learning management system that allows students all around the world to find
useful tidbits provided by other developers and get up to speed on the newest
technologies.
BetterDev excels by professionally managing and translating each course
uploaded to their servers, assuring top quality videos and learning material.
With the increased demand on BetterDev’s services, we have been assigned to
renovate their whole server infrastructure, and assure the new servers can
accommodate for up to one hundred thousand users.
This paper analyses the workflow in determining the best options to implement a
robust, scalable, high performing virtual environment. It will also highlight the
implications virtualization can have on server performance, and why different
hosting providers like Google Cloud can prove to be the right choice for our client.
Further, in this paper, we will discuss the options we had available as well to
demonstrate and reflect upon our choices in practical application. We will also
create a minimum viable product, which is a low scale fully functional
demonstration of the end product. MVP will help us explore new ideas as well as
provide a sample of the end product to satisfy our client.
To achieve this, it is crucial to do extensive research and understand the
fundamentals of virtualization and why it differs from other methods. Once
enough information has been gathered around this topic, we will explore
different approaches, and explain why we ended with choosing virtual servers
over local. As well as discuss why operating systems like Linux suited our needs
much better than the known Windows OS.
Main Part
What is Virtualization?
Virtualization on a computer is virtually the same as virtual reality for humans.
Virtual reality creates an environment convincing enough for a human to work
within it. Virtualization does the same by convincing a guest OS it is running on its
own hardware by using a hypervisor (Meyers, 2016).
Hypervisor enables hardware and software to work together in order to enable
one machine (Host) to run multiple guest OS. Figure A represents a hypervisor on
a single system hosting three virtual machines (Meyers, 2016).

Virtualization requires hypervisors to be able to allocate portions of the host’s


hardware power to individual virtual machines. Nowadays, most CPUs support
hypervisors out of the box, especially after Intel and AMD added extra features to
their CPUs in 2005 (Righini, 2010).
As virtualization becomes more popular, more people aim toward creating a
better performing virtual environment, which is why we have two types of
hypervisors, Type-1 and Type-2.
Type-2 hypervisor is represented in Figure-B, where the hypervisor is installed on
the host operating system. Type-1, however, improves performance by removing
the host operating system and getting installed directly on the hardware. Type-1
is powerful hypervisor/OS combination called a bare-metal hypervisor (Biondi,
2016), and is represented in Figure-B.

Cloud Virtualization
Let’s assume we only have one physical server. If we use it to host an important
site, the full potential of the server might go unused. But if we install a hypervisor
on it, we are now using our server more productively (Meyers, 2016).
With hypervisors, we can use a virtual machine to host our website, only allocate
fractions needed from the host’s physical hardware, and accordingly add more
resources if needed (Meyers, 2016).
While such simple virtualization has enabled us to optimize and reallocate our
computing resources in response to our needs, we can’t, unfortunately, exceed
the capability of the local hardware (Meyers, 2016).
Fortunately enough, large companies like Google and Microsoft, offer computing
services (servers, storage, networking, etc…) over the internet, also known as “the
cloud” (Azure.microsoft.com, 2018).
Google Cloud Platform
As the name suggests, Google Cloud Platform or GCP delivers different computer
solutions through a huge network of virtual servers. Google is a global
Infrastructure as a Service (IaaS) provider; it uses virtualization to minimize idle
hardware, protect data, and eliminate downtime and respond to spikes in
demand (Rouse, 2013).
By using IaaS, Google manages the provided resources like data storage,
virtualization, servers, and networking, and leaves us responsible for handling
other resources including applications, runtime, etc. (Rouse, 2013).
GCP uses Kernel-based Virtual Machine (KVM), a Type-1 hypervisor. It is a run
directly in the kernel and ensures overall better security and performance (Honig,
2017). Hardware Virtualization allows scalability and flexibility whenever extra
resources are needed.
There is a range of machine types, from one CPU up to 64 CPUs, and from half a
gig of RAM up to 416 GB, meaning we can choose and configure machines
depending on our needs. Google also offers Virtual CPUs, which are a lot cheaper
than dedicated CPUs but are shared with other clients (Google Cloud. 2018).
For every machine we start up, we are going to need attached storage, and so
GCP offers standard and SSD persistent disk. Disk options, whether they’re SSD or
persistent offer very high availability and durability. The data is actually spread
across multiple disks, so if a particular device goes down, the data doesn’t get
lost, and the users continue to have access. The data is also automatically
encrypted (Google Cloud. 2018).
There are a lot of customer-friendly pricing innovations offered by Google.
Instances are billed on a per minute basis, and for the duration, it is running
(Google Cloud. 2018).
Local Servers vs. Cloud Servers
We chose IaaS over On-Premises services because it allows us to rent IT-
infrastructure and upgrade as needed. This cuts down on the expenses of setting
up the on-site Datacenter (Electricity, Server Racks, cooling, etc.), as well the
expenses of hiring IT experts to manage and administer the infrastructure (Sether,
2016).

Hosting Providers allows easy global scalability, especially when our client has
users from all around the world. If we were to have on-site Datacenter, people
living far away would have bad latency, thus poor user experience. Cloud servers
offer datacenters all around the world, meaning with few clicks, we can launch
new servers depending on the users’ geographic needs (Sether, 2016).
Since our client provides educational videos, it is important to excel in
performance and speed. Cloud computing provides fast, efficient, and regularly
upgraded computing hardware, ready to be used. In addition to the unlimited
flexible storage amount, that can save a lot of physical space in an office, if we
were to have an on-site datacenter (Sether, 2016).
While Cloud services might sound like a match made in heaven for us IT nerds,
however, it is important to realize that we, by choosing Cloud Providers, are
entrusting the foundation of the business to them. But it is a risk that we have
chosen to take, especially when it comes to a reputable provider like Google
(APOSTU and PUICAN, 2015).

Minimum Viable Product


To demonstrate how our finished product would look like, we have created a fully
functional product (MVP), with just enough features to satisfy our client.
After lots of research about the best Learning Management System (LMS), we
have decided that Moodle is the best option our client has to use as a Web
Application. Moodle scores 5/5 overall, for its ease of use, features, customer
support and value for the money (Capterra.com, 2018).
Moodle is an open source platform, distributed under the General Public License,
meaning it is free to use and customize. Moodle offers different package plans
with different perks, like better overall technical support, custom themes, and a
mobile app, etc. (Moodle, 2018).
Moodle is mainly developed on Linux using Apache, MySQL, PHP (also known as
LAMP). While it still works as well on Windows, open source projects are usually
first tested on Linux, meaning better overall stability and performance, mind that
it is also free (Docs.moodle.org, 2018).
Creating a server
After creating an account on Google Cloud Platform (GCP), we create a virtual
machine or as Google calls it, an Instance. We choose our disk size, and image. For
this demo, we used approximately 100GB, and Ubuntu 16.04 LTS. We make sure
to allow HTTP traffic through the firewall, which opens up port 80 (Google Cloud,
2018).

We wait for the VM instance to get setup and booted, and then SSH into our VM
as shown in Figure-C.

Figure-C: Screenshotted from Google Cloud Platform

Once we are inside the system, we can make sure the system is up to date by
running sudo apt-get update && sudo apt-get upgrade which updates and
installs newest versions of different packages on the OS.
Now we want to install Apache, MySQL, and PHP. Luckily, Moodle has provided us
with a step by step tutorial on how to do it, but in summary:
1. Install Apache, MySQL, PHP5
sudo apt-get install apache2 mysql-client mysql-server php5
2. Download Moodle
sudo git clone git://git.moodle.org/moodle.git
After running installing and downloading Moodle, we copy the local repository
(where Moodle was downloaded) to /var/www/html (where the website will be
hosted). We follow along with the tutorial, and at the end of it, we can connect to
Moodle through http://ip.address.of.server/moodle . NB! Check out the
installation guide for more details at https://docs.moodle.org/26/en/Step-by-
step_Installation_Guide_for_Ubuntu (See Figure-D).

Figure-D
Users
After installing Moodle, creating users is just a few clicks away. With Admin
privileges we can create users as following Users > Accounts > Add a new user
(Docs.moodle.org, 2018).

We then get a page to insert the personal information about our users; it looks
like this:

After creating ten users, we can browse through the list of users through Users>
Accounts > Browse list of users (Docs.moodle.org, 2018).
We can see here that we have created up to 14 users.

Scalability
Now that we have demonstrated how easy it is to set up an LMS in seconds, it is
important to note that all that happened on one server, where the database, web
server is hosted on the same machine. This is not an effective solution especially
when we are talking about a global user base.
To be able to accommodate 100K users, we build the following architecture
represented in Figure-E.
Figure-E: Edited from Google Cloud Platform

Using the architecture represented above, we can see that we have users coming
from North America, Europe, and Asia. They all hit the same IP address, and this
IP address is actually an intelligent load balancer. It will direct users to the closest
set of servers that have the capacity (Google Cloud, 2018).
In the example above, we have servers in US Central, Northern Europe and in Asia
East. We are running Apache servers, and these servers deliver the standard user
interface to the LMS users. If load goes up, we want to this to scale up and give us
multiple servers automatically (Google Cloud, 2018).
These Apache servers are pulling all of the configuration data, user information,
information about the learning paths, and learning modules out of a Cloud SQL
instance (Google Cloud, 2018).
When a developer creates a new module, he uploads media, and that media goes
into Google Cloud Storage, and we transcode that media by taking the original file
video and encoding it at 480p, 720p, and 1080p (Google Cloud, 2018).
Transcoding servers are back-end servers separate from the front end; they will
open up the submitted media, transcode it into different versions, and store it in
different locations. This allows users to choose the preferred video resolution
depending on their bandwidth (Google Cloud, 2018).
Google Compute engine can create new VM instances that look just like the
original development machines, and automatically scale up or down the number
of instances depending on the load (Google Cloud, 2018).
Google makes this whole process easier through Instance templates. Instance
templates define a virtual machine’s type, boot disk image, network, and other
properties when it is created. Using this automatic process, we can then create
instance groups (Google Cloud, 2018).

Figure-F: Screenshotted from Google Cloud Platform


Instance groups is a collection of VMs that we can manage together, and when
they are based on a template, we can set up auto-scaling and load balancing quite
easily.
In instance group settings we can configure how many the minimum and a
maximum number of instances, and choose what kind the auto scaling should be
based on (See figure-F).
The method described above is called horizontal scaling, where we added more
servers to spread the load across multiple machines. This effective for Apache
server, or the front end servers in our case. We configure our front-end load
balancer, so it uses our preconfigured instance groups to create more VMs or less,
depending on the CPU utilization. While creating a load balancer, we can define
what the maximum CPU utilization for each VM should be before creating a new
VM (Linux Academy Blog, 2018).
Since we theoretically have unlimited resources available at our hands, scalability
is not an issue and isn’t something we should be worried about. Remember that
we are using IaaS, which means we are just renting the hardware to use.
Add to that, with the help of cloud services like Google, and with their easy user
interface, building a high-performance, scalable VM environment is a piece of
cake.
Conclusion
Compute Engine is a product that allowed us to run virtual machines on top of
Google’s massive infrastructure. Tons of computing cores, memory, disk storage,
and network, globally distributed. In addition to tools and workflow that easily
allows us to spin up one to hundreds to thousands of VMs and coordinate their
activity and also intelligently route traffic to the instances based on the users’
needs.
Services like GCP has provided small business with the tools necessary to compete
with larger ones; this has proven true when the main advantage of Cloud
computing is cost efficiency. In addition to the easier scales of services to reach
more users, and adapt accordingly.
Choosing a Learning Management system like Moodle eliminates the worry about
the backend or the front end. Everything is automated; it is user-friendly. Moodle
even assists with the installation of its web app on cloud services.
This paper has discussed the details of using GCP auto-scaling features, as well as
how to set up a VM, and how to deploy an LMS. Further in, Virtualization has
been explained thoroughly and reflected upon why it has become a popular
feature among server owners.

References:
Meyers, M. (2016). CompTIA A+ certification all-in-one exam guide (exams 220-901 & 220-902). 9th ed.

Righini, M. (2010). [online] Intel.com. Available at:


https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/virtualization-enabling-
intel-virtualization-technology-features-and-benefits-paper.pdf [Accessed 11 Nov. 2018].

Biondi, A. (2016). Hypervisors. [online] Retis.sssup.it. Available at:


http://retis.sssup.it/~giorgio/slides/cbsd/Biondi1-hypervisors.pdf [Accessed 11 Nov. 2018].

Azure.microsoft.com. (2018). What is cloud computing? A beginner’s guide | Microsoft Azure. [online]
Available at: https://azure.microsoft.com/en-in/overview/what-is-cloud-computing/ [Accessed 11 Nov.
2018].

Rouse, M. (2013). What is Infrastructure as a Service (IaaS)? - Definition from WhatIs.com. [online]
SearchCloudComputing. Available at:
https://searchcloudcomputing.techtarget.com/definition/Infrastructure-as-a-Service-IaaS [Accessed 11
Nov. 2018].

Honig, A. (2017). Seven ways we harden our KVM hypervisor at Google Cloud: security in plaintext |
Google Cloud Blog. [online] Google Cloud Blog. Available at:
https://cloud.google.com/blog/products/gcp/7-ways-we-harden-our-kvm-hypervisor-at-google-cloud-
security-in-plaintext [Accessed 11 Nov. 2018].

Sether, A. (2016). Cloud Computing Benefits. [online] ResearchGate. Available at:


https://www.researchgate.net/publication/304380663_Cloud_Computing_Benefits [Accessed 11 Nov.
2018].

APOSTU, A. and PUICAN, F. (2015). Study on advantages and disadvantages of Cloud Computing.
[online] Pdfs.semanticscholar.org. Available at:
https://pdfs.semanticscholar.org/da62/49af5e0df8ed36334b34c2f1010ed19c53f4.pdf [Accessed 11 Nov.
2018].

Moodle. (2018). Pricing - Moodle. [online] Available at: https://moodle.com/pricing/ [Accessed 11 Nov.
2018].

Capterra.com. (2018). Moodle Reviews and Pricing - 2018. [online] Available at:
https://www.capterra.com/p/80691/Moodle/#reviews [Accessed 11 Nov. 2018].

Google Cloud. (2018). Quickstart Using a Linux VM | Compute Engine Documentation | Google Cloud.
[online] Available at: https://cloud.google.com/compute/docs/quickstart-linux [Accessed 11 Nov. 2018].
Docs.moodle.org. (2018). Browse list of users - MoodleDocs. [online] Available at:
https://docs.moodle.org/35/en/Browse_list_of_users [Accessed 11 Nov. 2018].

Linux Academy Blog. (2018). What is scalability in cloud computing? - Linux Academy Blog. [online]
Available at: https://linuxacademy.com/blog/cloud/scalability-cloud-computing/ [Accessed 11 Nov. 2018].

Google Cloud. (2018). Autoscaling Groups of Instances | Compute Engine Documentation | Google
Cloud. [online] Available at: https://cloud.google.com/compute/docs/autoscaler/ [Accessed 11 Nov. 2018].

Google Cloud. (2018). Google Cloud Platform | Documentation | Google Cloud. [online] Available at:
https://cloud.google.com/docs/ [Accessed 11 Nov. 2018].

Docs.microsoft.com. (2018). Microsoft Azure Documentation. [online] Available at:


https://docs.microsoft.com/en-us/azure/ [Accessed 11 Nov. 2018].

Harris, T. (2018). CLOUD COMPUTING – An Overview. [online] Thbs.com. Available at:


https://www.thbs.com/downloads/Cloud-Computing-Overview.pdf [Accessed 11 Nov. 2018].

S.P.T, K. (2015). Getting Started with Google Cloud Platform. [online] ResearchGate. Available at:
https://www.researchgate.net/publication/300149417_Getting_Started_with_Google_Cloud_Platform
[Accessed 11 Nov. 2018].

Salmeron, A. (2018). Building and Developing Science Gateways with Google Cloud Platform. [online]
Sciencegateways.org. Available at:
https://sciencegateways.org/documents/20182/25103/Google+Cloud+Platform+SGCI+Webinar+Slides.pd
f/8d27354e-28f0-4fe8-8bbd-88bd916df8e4 [Accessed 11 Nov. 2018].

You might also like