Virtualization - What is it and Why we use it
Virtualization
What is it and Why do we use it?
Photo by Andrea Piacquadio from Pexels |
The What
So virtualization in the world of computers is like having a magical copy machine that can duplicate entire computers. Virtualization takes one computer and turns that computer's internal hardware into a buffet from which virtual machines can pick and choose how much of each hardware they want.
I know that the image is quite exaggerated, but it captures the fact that virtualized machines are not polite. Virtualization is a calculated way of maximizing the hardware on the host machine (the physical machine that you can touch) and all of the virtual machines that may be needed to support testing labs, classrooms, businesses, or applications.
The Why
So why do we make use of virtualization? Well if you are anything like me, you have a deep curiosity about all of the different operating systems being released regularly, but cannot afford to fork over $300-$3,000 each time the newest computer is marketed. With virtualization, I can just download the newest operation system (Yes, even Mac OS), and run it in a virtual environment. Virtualization also saves you from the headache of having to keep track of and maintain multiple computers. I could not tell you how often I trip over a laptop or laptop power cord in my home.
In short, we virtualize because it saves us time and energy while allowing us to expand and make use of the newest features on some "slightly" used equipment.
LIGHTBULB!!!
I'm just like a big business. We both want to be cheap where it counts while getting more than we expected. Yes, yes, I do feel a little dirty after admitting my TRUTH.
The How
Before we get into our virtualization options let's first get to know the hardware that is most important to virtualizing. Most people would start talking about RAM or the CPU, but I'm far from most people. I want to start with the Motherboard. I start with the motherboard for two reasons:
- The motherboard must first support virtualization. some motherboards do not have BIOS firmware that can make use of your CPU capability. This does not happen often these days, but you may be among the unlucky few. Check your BIOS settings after restarting your host machine.
- The chipset impacts how quickly any other hardware components can speak to each other.
As you can see in this image above, memory(RAM) and the CPU are connected by the Northbridge chipset. The video support (GPU) is also on the Northbridge. Everything else goes through the Southbridge. Every motherboard is different. Some of these chipsets are like two-lane country back roads while others are like 6 lane highways. Having a massive CPU and a large amount of RAM with the wrong motherboard is like trying to move homes in a pickup truck versus a 26ft moving truck. It can be done, but you will not like it. The lessons learned here is: do not add more power to your host machine before you learn more about your motherboard
Next, We discuss the hard disk. The hard disk is your primary storage for everything on the host machine, and not calculating the use of your storage will end very badly.
Before even thinking about adding a virtual machine or alternative, know how much hard disk space you can sacrifice.
Talking about sacrificing hard disk space, This is a good time to mention swap and page files. Both serve the same purpose, but these days most people work with swapfiles. A swapfile is a file stored on your hard drive that is dedicated to just the information overflow from your RAM. when your RAM starts to see excessive use and your host machine is configured to use a swapfile, RAM will be instructed to send items over to the swapfile. At this point, you have to remember where the RAM and Hard disks are located on the motherboard. Traversing both Northbridge and Southbridge chipsets can be challenging to say the least depending on the type of roads your data is riding on. Why even use the swapfile feature? Oh yeah, forgot to mention that the swapfile is optional. Well, swapfiles offer a balance of performance and functionality. If you are actively using your virtual machines then your virtual machines will be a priority to the RAM meaning that any other low priority processes in the RAM will be moved out of RAM and speed up the use of the virtual machines.
On the other hand, if the swapfile were to be turned off or removed and there were too many processes running in RAM, the host machine would rather stop processing new requests (applications being opened and used) or crash to save other data from being corrupted. My recommendation: USE A 4Gb+ SWAPFILE
Lastly, when it comes to the most widely known hardware components, the CPU and RAM, it is pretty straightforward. Make sure that you know how many CPU cores and how much RAM you have.
This example computer has 4 CPU cores and 16Gigs of RAM meaning it can support no more than 2 or 3 simultaneous computers at one time. |
Until now we have discussed the hardware side of virtualization. Next, let's discuss the technology itself. Virtualization comes in two forms: virtual machines and containers. Sandboxes are sometimes mentioned, but in all honesty, they are the predecessors to containers. The evolution of containers has taken sandboxes and added to the concept of portability. Here is a quick comparison of virtual machines and containers constructs.
Image from https://mkaschke.medium.com/virtual-machine-vm-vs-container-13ab51f4c177 As you can see, there are two technologies to consider when running virtual machines. Both technologies are called hypervisors, but one does not require a preinstalled operating system such as Microsoft Windows or Mac OS. This one is called the bare-metal hypervisor. An example of a bare-metal hypervisor is the popular VMware ESXi or Xen. The bare-metal hypervisor software is the essential programming needed to access and manage the hardware of the host machine. There is no internet searching, tweeting, or gaming on the host machine. This also means that you get way more use out of the hardware available (i.e. way better virtual machine stability and power). The hosted hypervisor gives the amount of hardware allocation for virtualizing because it has to support the host's operating system first. This means that you will have to choose more carefully about how powerful or how many virtual machines you will have when selecting this option. It has taken me many years to say what it is that I am about to say, but I finally wrapped my big head around it. My personal favorite is the container option. I like it because it requires the least amount of effort to use them while providing the most portability. Containers make use of only what they require and run the same way no matter where they are because they are not concerned with loading entire operating systems. We will dig into what makes up an operating system over time, but in a nutshell, most everything you do on your computer breaks down to a file and where it is located. So in my very biased opinion containers are the best option for most situations. The Corporate Spin At the end of each post, I like to leave you with questions and answers I have found to be most important How do we protect it?
How do we make it repeatable?
|
Comments
Post a Comment