In this Video, I am going to discuss Virtual Machines in Cloud Computing. But before understanding the Virtual Machines, let us first understand the state of IT before Virtual Machines came into existence.
What is Virtual Machines in Cloud Computing?. The Complete Cloud Computing Developer Course 2022 [Videos].
Application without Virtual Machines:
Nowadays all most all types of industries or all types of businesses such as hotels, banks, Airlines, Tourism, Shopping Malls, Online Portals, Hardware, etc. use applications that power and run the business. It is also impossible for a business to withstand the pressure and competition in the market without a good reliant, performant, and scalable application.
So, we can say that it is the application that runs the business smoothly nowadays. Again, we need to consider two things from an application point of view. They are as follows:
- First, Designing and developing the business application
- Second, Hosting the application on a server to make it available for the business.
Now lets discuss how we host the application before Virtual Machines and containers came into the picture. Once we understand this, then we will discuss What is Virtual Machine and how they overcome problems.
Without Virtual Machines (or you can without cloud computing), in order to host an application, we need (i.e. the business) a physical server. But the most important thing or the question that we (i.e. the business) need to consider is, how big and fast the server must be. Its not that easy to speculate or identify the demand for the application from day one as we may expect the business to grow as the day progress. So, to be on the safer side, we demand a high-end physical server which obviously costs a lot of money.
In addition to this initial capital expense, i.e. the cost of the physical server, we also have monthly recurring operating expenses like energy costs (both for power and cooling), hire a workforce to maintain the server, operating system license cost. In most cases, only a fraction of the server capacity (i.e. 5% to 10%) is used. That means a lot of company money is wasted.
How we host the application?
First, we must have a physical server. On top of the physical server, we must install the operating system (like Windows, Linux, etc) and on top of the Operating system, we install our business application. With this, our application is up and running and the users are now able to access and use our application.
Now, you start another business and for that new business, you also require a new application. As you have a new application, so you also require a new physical server as well as the license for the operating system which is installed on that new physical server. On top of the operating system, you installed the new application. The most important point that you need to keep in mind is, in addition to the cost of the physical server, we also have monthly recurring operating expenses.
At this point, you might be thinking, why cant we install this new application on our existing physical server, because the first application is only using a fraction of the server capacity. Yes. you can, but in most cases, you cant.
Why cant we host in the existing physical server?
There are several reasons for this, as it may possible that the new application has different dependencies than the first application. It also possible that the new application may need a different version of the framework. It may also possible that the new application altogether needs a different operating system. May be both the applications want to access the same resources which obviously results in resource conflicts.
One of the ways to solve the above problem is to buy a new physical server. That means, there is a one to one mapping between an application and a physical server. So, every time we need a new business application, we end up buying a new physical server. And the most important point is, these applications are only using a fraction (5% to 10%) of the server capacity. So, with this approach, it is a waste of company money. This is the application hosting model that we followed until virtualization came into existence.
What are Virtual Machines?
With the introduction of virtualization, now we can squeeze much more from physical servers. For a better understanding of this, please have a look at the below diagram.
As you can see in the above image, on top of the physical server, we have the operating system installed. This is nothing but the host operating system or you can say that the operating system installed at the physical server level.
On top of the Operating System, we have installed a piece of software called Hypervisor. The hypervisor is a technology from VMware which virtualizes the hardware of the physical server.
On top of the Hypervisor, we create virtual machines. We can create and run any number of virtual machines on a single physical server as per our business requirement.
My first application runs on VM1 and the second application runs on VM2 and so on. This is brilliant because now we can make proper utilization of the server hardware.
If you look closely at the above diagram, now there is no longer one to one mapping between the application and the physical server. Every time, we have a new application, we just require a new Virtual Machine. So, with virtualization, we are able to safely and securely run multiple applications on a single physical server.
Because of this virtualization, now each application thinks that it is running on a dedicated physical server with its own dedicated processer, memory, drive space, etc, but, they are running on the same physical server but on a dedicated virtual machine.
So, what exactly a Virtual Machine is?
You can think of the virtual machine as a computer within a computer. Multiple virtual machines can run simultaneously on the same physical server. In each virtual machine, you can install an operating system of your choice (Windows, Linux, etc), typically we need to install the OS and dependencies based on the application requirements.
Virtual Machines and Multiple applications:
Lets say we have 3 applications – App 1, App 2, and App 3. And we want to run all these 3 applications on one physical server let say Server 1. We cannot directly run these applications on the server hardware. We need an operating system like Windows or Linux on the Physical Server. This is the Host Operating System i.e. the operating system installed at the server level. On top of this Operating System, we install a piece of software called Hypervisor. It is the responsibility of the Hypervisor to creates and manages the virtual machines. As we want to host 3 applications, so we create 3 virtual machines on the top of the Hypervisor. And in each virtual machine, we host our applications as shown in the below image.
As we alwatchy discussed a virtual machine virtualizes the hardware of the given physical server. That means each virtual machine that is created, gets a slice of the server hardware. In our example, we created 3 virtual machines, so each Virtual Machine gets 33.33% of memory, disk space, processor, and other server hardware resources.
Virtual Machine Disadvantages
Virtual machines allow us to run more than one application on a given physical server, which ultimately utilizes the server hardware (memory, disk space, processor, and other server hardware resources) in a better way than what we see in our previous example. However, for each application, we need to create separate virtual machines and for each Virtual Machine, there is a lot of overhead in terms of Cost and Maintainability. Let us discuss the disadvantages of Virtual Machines.
The important point that we need to understand here is, the applications, i.e. App 1 to App 3 cannot directly run on the virtual machine. The role of a virtual machine is to virtualize the server hardware resources only. That means a virtual machine is a slice of the underlying server hardware and hence we cannot run an application directly on the hardware. So, in order to run an application on the Virtual Machine, it needs an operating system.
In our example, as we have 3 virtual machines, so we need to install 3 operating systems i.e. an OS on each virtual machine. Usually, the Operating system can be Windows or Linux. The operating system that we installed on a virtual machine is usually called the Guest Operating System. On top of this guest OS on the Virtual Machine, we need to install the application as well as any dependencies the application required. It might also possible that we installed Windows OS in one virtual machine and Linus Operating system in another Virtual Machine. For better understanding please have a look at the following diagram.
Wasted of Server Resources:
In order to install 3 Operating System, a huge amount of server hardware resources is required. That means a huge amount of server resources such as RAM, Disk Space, Memory, Processor time are wasted just to keep these Virtual Machines are up and running.
Admin Time to Keep OS up to date:
Each installation of the Operating System also required Admin time. For example, if there is an update or if there is a system patch available for the Operating System, then the system admin needs to download and installed the same on all Virtual Machines that have the same Operating System.
Operating System License Cost:
We also need to pay for all these Operating System Licenses.
Virtual Machine bootup Consumes time:
Virtual Machine is nothing but a computer within a computer and it has its own Operating System that we alwatchy discussed. So, for a virtual to be up and running, its OS must be booted up. Booting up an operating system consumes a lot of time. In our example, if we want our Application 1 to be up and running, then we need Virtual Machine 1 Operating system to be booted up as well as we also required to the host operating system (the Operating System hosted at the Server Level) to be booted up.
What is Virtualization?
The most important technology for Cloud Computing is Virtualization. Virtualization is the process of the partitioning of a single physical server into multiple logical servers. Once the physical server is divided, each logical server behaves like a physical server and can run an operating system and applications independently.
For software developers and testers, virtualization comes very handily, as it allows developers to write code that runs in many different environments and more importantly to test that code. Virtualization is mainly used for three main purposes
- Network Virtualization
- Server Virtualization
- Storage Virtualization
It is a method of combining the available resources in a network by splitting up the available bandwidth into channels, each of which is independent of the others and each channel is independent of others and can be assigned to a specific server or device in real-time.
It is the pooling of physical storage from multiple network storage devices into what appears to be a single storage device that is managed from a central console. Storage virtualization is commonly used in storage area networks (SANs).
Server virtualization is the masking of server resources like processors, RAM, operating system, etc, from server users. The intention of server virtualization is to increase resource sharing and reduce the burden and complexity of computation from users.