Virtualization & Virtual Machines for DevOps

Course Code - 1.1.2

Virtualization & Virtual Machines for DevOps

Welcome back to another blog of the series: "The Ultimate Guide To DevOps & Cloud Course". In this blog, we will be talking about an important concept that is used extensively in DevOps and is the fundamental technology that makes Cloud computing work - Virtualization.

What is Virtualization?

Virtualization is a technique of creating a virtual version of something, like compute storage, networking, servers or applications.

Virtual is something that exists but doesn't exist right at that place. Let's take a very simple example, Virtual meeting- Where people are talking and seeing each other on applications such as Google meets, Teams etc. but in reality, they are not present around each other and only talking to each other via the virtual world that's why called the virtual meet.

The IT definition: Virtualization is the technology that lets you create useful IT services using resources that are traditionally bound to hardware. It distributes the capabilities of a physical machine among multiple users or environments in order to utilize its full capacity.

How does virtualization work?

Virtualization is not something that is created in the air. It requires the architecture and hardware of a host machine. Virtualization is possible because of Hypervisor. A hypervisor is software that separates the physical resources and allocates them to virtual environments.

There are 2 types of Hypervisors :

1. TYPE 1

  • Type 1 Hypervisors are also known as native or bare-metal hypervisors.

  • Sit on top of the physical server and manage guest operating systems. It takes the place of a host operating system and VM resources are requested directly from the hardware by the hypervisor.

  • Usage: enterprise data centre or other server-based environments (Secure, Low latency).

  • Examples: KVM, Microsoft Hyper-V, and VMware vSphere

2. TYPE 2

  • Type 2 Hypervisors are also known as hosted hypervisors.

  • Sit on top of the host os and works by abstracting guest operating systems from the host operating system.

  • Usage: A type 2 hypervisor is better for individual users who want to run multiple operating systems on a personal computer like Ubuntu & KaliLinux simultaneously to test something (Higher latency).

  • Examples: VirtualBox, VMware workstation etc.

The below diagram will build a picture in your mind.

hypervisor types.jpg

Using all these concepts the Hypervisor spins up Virtual Machines. Virtual machines work the same as physical computers have their own os and applications.

Hypervisors can run multiple VMs of different OS depending on the resources of the host physical server and interestingly these machines are independent of each other.

E.g. Look at the below image the first VM can be running Windows and the second one Linux. This independence makes the VMs portable.

image.png

Also, guess which type of Hypervisor is being used in the below architecture and comment in the end.

Benefits of Virtualization

When we are talking about technologies, what value it provides to the end-users and organizations is important.

Let me explain, How major IT companies for e.g. Infosys utilized this great technology in recent times. Infosys trains thousands of freshers every year and the covid wave of 2020 was a big challenge. Shipping of computers was difficult and calling employees to training centres was impossible.

So what they did was to assign Virtual machines to every trainee. The real machine was in mysore, but the trainees were able to access the resources and even appear for examinations via VMs.

Amazing! The best use of technology.

Saving Cost

The next thing, if something went wrong with a VM, because of the portability they were able to move the system on some other machine very easily.

Reduces downtime, if your real machine gets broken you have to take it for repair not the case with VMs.

Also, you can spin an environment according to your requirement very quickly. So the Speed, Flexibility Agility.

Virtualization & DevOps

Software development is optimized through the use of collaboration and cutting-edge technologies in DevOps.Using virtual machines, a DevOps team can build, test, and deploy code in simulated environments without wasting important computing resources.

As discussed in the benefits Virtualization provides agility, flexibility, and scalability to the team. A VM can be scaled up and down according to the needs very quickly using tools such as VirtualBox.

Setting up the required environment for testing and deployment purposes without the hassle increases the productivity of the team and saves the cost of Maintainance.

Another important concept i.e. Containerization takes virtualization one step further by utilizing operating system (OS) kernels to run multiple applications within a single container. Together Virtualization & Containerization helps a DevOps Engineer greatly to achieve Continuous deployment.

Detailed article here

Setting up a Linux VM

If you're following this course you may have already set up a VM or WSL2 for provisioning a Linux environment. For if you have not set up your Linux environment here are the basic steps you need to follow :

Linux Machine can be set up using VirtualBox.VirtualBox is a general-purpose virtualization tool for x86 and x86-64 hardware, targeted at server, desktop, and embedded use, that allows users and administrators to easily run multiple guest operating systems on a single host.

  • Check for the basic requirements of the system

  • Download and Install VirtualBox

  • Download the ISO file of the Linux distribution you want to install. My recommendation is to either work on RHEL based CentOS or Debian based Ubuntu.

  • Install Linux in VirtualBox by specifying the specifications of the machine you want to build e.g. OS, RAM, Type of Hard disk

  • Set up all this and boot up the machine and your Linux machine is ready to roll!

Here's a detailed Installation Guide .

Remember this is a Type-2 Hypervisor and its performance may be slow depending on the resources of your host. Explore better ways to set up a Linux Machine. I personally prefer WSL2 which is much faster than VirtualBox.

Tasks For Today

  • Setup your first Virtual Machine.

  • Explore which Virtualization software works best for you

  • Try running VMs with different Operating Systems.

Summary

Virtualization is an important concept one should go through to become a DevOps or a Cloud Engineer. Virtualized environments make it possible to develop, test, and deploy software. Knowledge of Virtualization, Setting up VMs will help you greatly in your DevOps journey.

ABOUT THE SERIES

So, This was the explanation of Virtualization for DevOps from the Series "The Ultimate Guide to DevOps & Cloud".

If you want to Get started with DevOps make sure to check out our course on Twitter The Ultimate Guide to DevOps & Cloud

Master DevOps with our online community and join us in the initiative of learning DevOps & Cloud.

Follow the creators:

If you feel we should change any of our approaches in order to make this course the Best course, please comment down with your ideas. we would love to hear that from you.

And if you feel that this energy & effort, we are putting down in this is worth every penny then please share out with other folks who are struggling to break down into Tech-verse. Best of luck with a new journey & Happy Learning From the Team :)