Virtual Machines in the Cloud

Virtual Machines in the Cloud

Gabriel Omamoke Edwards's photo
Gabriel Omamoke Edwards
·May 9, 2022·

10 min read

Virtual machines are one of the core building blocks of cloud computing. This is a concept that cloud architects, solution architects, and engineers need to have a firm grasp on. This article aims to provide a deeper understanding of virtual machines in the cloud in an easy-to-understand format.

Virtual machines have been around for a long time in on-premises datacenters and personal desktops. Its use in cloud environments is a natural progression.

Here are highlights of concepts we will touch on:

  • Virtual Machines (VMs)
  • Hypervisors
  • Creating Virtual Machines via the cloud Console (GUI configuration Interface)
  • IaC Tools (Large scale infrastructure deployment and destruction)

Precursor - Virtual Machines before the Cloud

  • A Virtual machine is a software representation or implementation of the operating system that runs on a physical computer.
  • Normally, the operating system (OS) runs on single computer hardware (also called a motherboard) and it utilizes the CPU, Memory, and Storage drives available on the local hardware or Storage Area Network (SAN) in the case of enterprise deployments.
  • The level of performance you can get from the hardware depends solely on the capability of the OS to manage, control, and cost-effectively expend these resources.
  • The challenge with this solution, is that most server operating systems can fully utilize only about 30% of the hardware resources available to them while the other 70% is wasted and this is very expensive for businesses.
  • The next logical progression was virtual machines and the use of virtual machines enabled businesses to put more operating systems on single computer hardware.



💡 Think of multi-tenant houses vs. single-tenant houses built on same-sized plots of land. One landlord gets rent from more tenants and makes more income while the other gets rent from only one tenant and makes less income with both landlords probably paying the same mortgage rates on their properties. It's obvious who is getting more use out of his land. Businesses need to get more use out of the computer hardware to be profitable.



Hypervisors - A Technical Solution to a Business Challenge

  • The hypervisor is a piece of software that has been built to facilitate the hosting of more operating systems on single computer hardware than is normally possible.
  • The hypervisor abstracts the OS from the hardware by translating calls between the OS and the hardware.
  • It essentially acts as a middleman. This enables the hardware to host multiple OS's rather than just a single OS.
  • The hypervisor (type 1) runs on the computer hardware as it is installed first, and the operating system runs on the Hypervisor.
  • The advent of hypervisors enabled businesses to get better ROI on their Capex while reducing the OpEx in the long run.

Advantages of using an Hypervisor

  • It isolates faults and failures in a particular OS from disrupting the entire system.
  • It enables more efficient use of the computing hardware.
  • It reduces the cost of ownership and cost of operation as more processing can be done on a “hypervized” server hardware with more virtual machines running on it than a single OS on the bare metal.

Hypervisors On-Prem and in the Cloud

There are different types of hypervisors but we are just going to mention them in this article and will go deeper in another article on hypervisors (watch out for that)

Hypervisors are categorized as type 1 and type 2 hypervisors

Type 1 Hypervisors

These are bare-metal hypervisors. This means that you install it directly on the computing hardware, then you install the operating system of your choice on the hypervisor

Type 2 Hypervisors

These require an Operating system like Linux or Windows to be installed first then the hypervisor can be installed through the operating system same as you will install an application like Microsoft word or photoshop.

In this case, the hypervisor depends on it's host OS, if the OS is restarted all the VMs are affected as such type 2 hypervisors are better suited for personal use and not enterprise applications.

Type 1 vs. Type 2 hypervisors

types of hypervisors.png Click here for larger Image


Below is a list of “Type 1 Hypervisors”

On-Premises Hypervisors

  • VMWare vSphere ESXi (Most pupolar on-premises hypervisor)
  • Microsoft Hyper-V (used on-premises)
  • KVM (Most popular open source Linux based hypervisor used on-premises )
  • Citrix Xenserver | Citrix hypervisor 8.2 (citrix hypervisor, | hypervisor 8.2 is based on the Xen project)

On Cloud Hypervisors

  • AWS Nitro Hypervisor (used to host and run EC2 instances on AWS)
  • Azure hypervisor (This is a version of Hyper-V, customized for the Azure platform)
  • GCP Hypervisor (Based on open-source security-hardened KVM hypervisor. Runs all VMs on GCP platform)

Note: You can not directly interact with the cloud-based hypervisors to tweak or control it in any way as this is abstracted from end-users as part of IaaS, PaaS, and SaaS structure which makes it the sole responsibility of the Cloud Service provider (CSP).

Virtual Machine (VM) Platform in the Cloud

  • Virtual Machines in the cloud are not different from virtual machines on-premises. The major difference between both can be said to be that the cloud provides an easier interface and a smoother user experience when creating virtual machines.
  • All cloud service providers (CSPs) brand their virtual machines/platforms differently but know that at the core of it, they are very much the same type of implementation.
  • The difference would be the type of hypervisor technology that underlays their implementation and this should be (and is) transparent to the end-user.
  • When creating VMs on Prem, depending on corporate policy, you might have to install the OS from scratch or more likely use a preconfigured, preinstalled image with all the patches and updates installed.
  • The second option is the route CSPs take with VM creation. For example on AWS, AMIs are used to create new VMs (called EC2 Instances) but in actuality, AMIs or Amazon Machine Images are simply clones or images of preinstalled machines that are copied and used as a basis for your new OS.
  • This simplifies the VM creation process and reduces the margin for error while improving user experience and the process is the same across all CSPs.

Virtual Machine (VM) Branding across the Top 3 CSPs

Today, the top 3 CSPs are AWS, Azure, and GCP

  • Each has branded its VM implementation to suit its marketing.
  • Branding in the cloud or the lack of standardization in the naming of technology components in the cloud has been a major roadblock for cloud adoption on the part of new cloud admins.
  • There are too many names to remember, and it gets really confusing really fast! the trick around this is to break the tech down to its core or foundational element, strip out the marketing and you will find the tech.

VMs on AWS

  • AWS Implementation of Virtual Machines is called an “EC2 Instance” or Elastic Compute Cloud Instance. You can deploy an “Instance” in any zone or region.
  • Most flavors of Linux or Windows can be deployed using the AWS AMI. The AMI or Amazon Machine Image is a VM clone that Amazon makes available to create new VMs

VMs on Azure

  • Azures’ implementation of Virtual Machines is called a “virtual machine” ! surprised?
  • Azure does its best to keep with industry standards when it comes to naming technology and stays away from the marketing/rebranding of established technology.
  • Just like AWS, VMs can be deployed in any zone or region and supports most flavors of Linux and Windows.

VMs on GCP

  • GCP’s implementation of virtual Machines is called a “compute engine instance
  • It is basically a virtual machine running on a customized KVM hypervisor on GCP’s infrastructure.
  • You can create most flavors of OS from Linux to Windows in any zone/region

💡 Note: *VMs naturally do not exist in isolation, they are typically placed in VLANs, as with bare-metal servers in traditional networks, the computer would be in a LAN or a subnet.

Every cloud service provider creates a LAN/VLAN entity. This will be addressed in an up coming blog post.

Follow me on Linkedin to get updates when new contents are released

Deploying VMs in the Cloud

  • As mentioned before the cloud gives a smoother user experience with VM creation.
  • On each cloud platform, you can use the GUI to create the VM by following the prompt. The process is usually initiated by searching for the brand name used for virtualization on that platform.
  • On AWS, search for ec2 Instances and follow the prompts, making decisions on the processor types, drives, memory, etc.
  • On Azure search for virtual machines, follow the prompts, and make the same decisions as above.
  • On GCP search for compute engine instance and repeat as above.

Creating VMs through Cloud Portals

Creating Virtual Machines in AWS:

  1. log on to the console 1.aws-vm.png Click Here for Larger Image

  1. Search for EC2, the click on instances on the left blade 2.aws-vm.png Click Here for Larger Image

  1. Click on lunch instances 3.aws.vm.png Click Here for Larger Image](Alt text of image

  1. Fill out the field presented 4.aws.vm.png Click Here for Larger Imaget

Creating Virtual Machines in Azure:

1.azure.vm.png Click Here for Larger Image


2.azure.vm.png Click Here for Larger Image

3.azure.vm.png Click Here for Larger Image

Creating Virtual Machines in GCP:

1.gcp.vm.png Click Here for Larger Image


IaC in the Cloud

  • IaC or Infrastructure as Code, provides a way to create and destroy cloud resources without going through the portal.
  • Most IaC tools are declarative in nature. This simply means you tell the engine what needs to happen, and it magically makes it happen by invoking respective API calls under the hood. You do not need to know how it makes it happen
  • Just as you do not need to know how the engine of a car works to drive it, you just put it in gear (tell it to move), and you are on you way. So long as you know your destination, you will arrive there.
  • With declarative tools, you start with the end goal in mind.
  • While GUI is great for creating one VM at a time or in some cases up to a few VMs, it is not suited for creating hundreds or thousands of VMs at once.
  • This is where IaC tools come in but as with all things, each CSP have its own flavor of IaC tool and each is created for their platform only in other words, they are proprietary however, do not despair beacuse on the flip side we find cloud-agnostic tools

Proprietary IaC Tools (cloud platform-specific)

  • AWS - Cloud Formation (YAML based)
  • Azure - ARM Templates (Azure Resource Manager Templates) (JSON based))
  • GCP - Deployment Manager (YAML Based)

The challenge with using proprietray IaC tools is that as the name they are platform-specific. This means that you can’t redeploy your infrastructure across multiple clouds without having to recode everything. You cant use Cloudformation codes on Azure neither can you use ARM templates base codes on AWS.

Cloud Agnostic IaC Tools

To avoid that painful scenario, it is better to use cloud agnostic IaC tools like:

  • Terraform
  • Pelumi
  • Octopus Deploy
  • Scalr

These tools allow you to code your infrastructure once with the ability to reuse the code.

This is article is the first in a series called building blocks of the cloud where we will review core elements that are used in every architecture design solution you will find in the cloud.


I welcome your feedback.

💡 Much thanks to @Rajesh for proof reading. You rock bro!

 
Share this