VME2E s01e01: What even is a VM?

askcarter
8 min readAug 31, 2020

Everybody’s talking about the cloud.

But what is it?

According to wikipedia, cloud computing is: the on-demand availability of computer system resources, especially data storage and computing power, without direct active management by the user. The term is generally used to describe data centers available to many users over the Internet.

Basically, it means being able to connect to the internet and interact with physical resources that aren’t on your machine → you can retrieve emails stored on a gmail server, write an application that uses variable amount of storage, or write ML models on computers way that run way faster than your three year old macbook.

Cloud just means shifting your data storage and computing needs from the computer in front of you to a data center managed by someone else.

Many of the articles, conference talks, and posts about “the cloud” focus on the newer technologies made possible by this technology shift. We focus on technologies like serverless or containers but most of the solutions built in containers or serverless are running on systems built entirely of Virtual Machines (VMs). You can’t escape them.

And why would you?

Problem — What are VMs and why do we need them?

Virtual Machines are pretty much the basic building block of most server side computing today. They do a great deal of the work required for the day in day out operations for most companies.

According to Wikipedia, a VM is: an emulation of a computer system. They provide all of the functionality of a physical computer system, while being run as a software. This means you can have more than one virtual computer running on your physical computer. Each version of a virtual computer is called a VM instance, or instance for short. VMs offer a lot of benefits, like being able to test out application behavior in different operating systems and being able to programmatically set up computer environments for a company’s employees.

As an industry we moved to VMs around the turn of the century and haven’t looked back. Even as we move to the cloud to take advantage of technologies like serverless or massively distributed systems, virtual machines make up a large amount of workloads.

This has two main benefits: saving money and less complexity.

Instead of spending money on having people maintain your infrastructure or on excess infrastructure you’re only using during peak times, that money can be spent developing your offering or whatever else you want to do with it. Hint: investing in diversity and equality is never a bad investment.

And instead of having to split resources and people hours learning, managing, and developing infrastructure, you can have a team of specialists do all that for you: Providing the latest and greatest security patches to your VM instances; handling the storage and monitoring of the physical machines your VMs run on; and more. This allows your company to focus on what it does best: proving an offering to customers.

Are they a perfect solution?

To be clear, sometimes it makes sense not to bring all, or even any, of your platform over to the cloud. Despite the many benefits, there are some use cases where having a dedicated machine is advantageous. For example, legacy applications can have licenses that require one machine. You’re trying to plug a dongle into the back of your cloud to run your legacy database app? Not gonna work so well. Or you may need a very specific OS settings to run a proprietary executable. Perhaps, you need to run a specialized hardware like GPUs or TPUs that hasn’t been enabled by your cloud or platform provider. These are all times where it might be best to leave part, or all, of your system on premise.

But while VMs aren’t perfect, they are pretty good and they look to be the way the industry is trending. And it’s important to understand that development. So we can properly see where we are going with Virtual Machines, first let’s look at how they evolved.

The History of VMs

Virtual machine technology has roots that stretch all the way back to the 1960’s, when people first started experimenting with time sharing — or finding a way for multiple users to use a machine, concurrently. It would appear to each user like they were the only one using the machine, but behind the scene the computer would switch back and forth between executing each program, saving and restoring state in the background.

This eventually evolved into truly virtual machines that completely simulated the underlying hardware and hypervisors — programs that create and run virtual machines. Hypervisors allowed for one “host” machine to have multiple virtual “guest” machines running on them. Each guest would have an operating system that looked and behaved almost exactly like running natively on the host machine.

This allowed for sharing unused resources (like CPU or storage) with multiple users at once. This was a natural fit for data centers which would often have lots of unused resources. The adoption of virtual machines in the datacenter opened the way for cloud computing.

Many users, from large retailers to small businesses, we’re searching for ways to maximize the benefits of scalable computers and having a data center, without owning and managing data centers. And that’s where Infrastructure as a Service, or IaaS, came from.

Many large companies like Google and Amazon, would manage the hardware and virtualization needs for other people to use. Depending on the type of application some customer’s needed more or less control. Some just wanted to use software without managing its resources (Software as a Service), some needed tooling to develop applications without having to manage the resources that app used (Platform as a Service), and others needed the underlying virtual resources for various things (Infrastructure as a Service).

The future seems to be more cloud based as we move towards the illusion of not having any physical machines to manage (serverless). But for this series will focus on the underlying systems that make all of this other technology possible.

Which brings us back to Google Cloud.

Google Compute Engine

Google cloud has virtual machines. Announced in 2012, Compute Engine is Google’s very own IaaS which allows you to run your workloads in the same data centers as Gmail, Search, and other Google Products. Until then only App Engine was offered by Google Cloud, and it was a Platform as a Service that heavily restricted what types of workloads you could run. Compute Engine was Google’s first pure Infrastructure as a Service play.

Example — Here’s why you might find Google Compute interesting

It’s easy to migrate to and explore

If you’re looking to get the benefits of cloud computing, Google Compute offers many ways to migrate your existing VMs, depending on the complexity of your setup. In the case of simple migrations, you can just import your Virtual Disk. Solutions like Cloud Endure and Velostrata can help you take on more complex migrations.

More complex migration are talked about in this series of videos and articles.

When developers and systems administrators try out new environments, like a new cloud, virtual machines are usually the tires they kick. A common method for starting a serious test of a new environment is trying out a lift and shift: picking up an application in their current environment and spinning it up in a new one. It’s actually a great test in most cases — you’ll have to make some tweaks to deal with the new environment, but that’s usually settings, not wholescale application code.

GCE has flexibility to serve your needs custom resource configurations

Because of the way that Compute Engine is architected on top of Google’s infrastructure, it can offer very interesting combinations of resources that you cannot duplicate on some other clouds. Compute Engine processors and memory resources are granularly configurable. If you need 26 processors to optimally power your application, no need to choose between an image with 16 or 32 processors, dial in to exactly what you need.

Once you have your machines set up, you have many more options to customize your virtual machines to your needs. For example, Compute Engine allows you to configure machines with:

  • Machine instances of various size and speeds to suit your needs;
  • Disk images based on popular OS choices or even bring your own customized image;
  • Snapshotting for backups and disaster recovery; and,
  • Sole Tenancy — the ability to be the only customer on the underlying hardware infrastructure.

These VMs take advantage of Google’s Internal Network. This allows VMs to communicate securely, at high speeds with other VMs in any of Google Cloud’s data centers. The centralized control panel allows you to see all of your VMs anywhere in the world, all on one screen. This enables Compute Engine VMs to be configured in a global system system, and not just isolated groups of machines in separate data centers.

Additionally, Compute Engine VMs have the ability to use Google Cloud’s custom ML hardware — Tensor Processing Units, or Cloud TPUs. They are specially designed by Google to be the optimal hardware for running certain types of common machine learning tasks. These are only available on Google Cloud, and lead to significantly faster and cheaper ML jobs.

GCE is more secure

When it comes to securing cloud environments, companies care about:

Consistently delivering the right services and the right data to the right people. This can’t be something that only happens some of the time; it needs to happen for every single request.

Implementing authorization and authentication, to make sure that only the right people have access to resources and data.

Proactively prevent threats, because bad actors are constantly evolving and effective cloud security allows you to be proactive rather than just reactive.

Complying with regulatory requirements of their industry. Not all, but more and more, businesses are required to be compliant, so that’s something you have to be aware of.

Flexibility & Control so internal teams can be empowered to act on the parts they’re responsible for and can control.

Google Cloud helps with this in many ways — whether it’s with Identity and Access Management, a secure private network, specialized hardware and software, or even secure server farms — Google Cloud makes keeping your infrastructure secure a lot more manageable.

If you want to learn more about security, specifically, check out the Cloud Security Basics video series.

GCE can save you money

All of this flexibility, management, and security can lead to a lot of savings. Compute Engine has a number of cost optimizing tools and techniques that make this issue easier than elsewhere.

For many organizations, the most important thing to get right in the migration to cloud is cost control. Many organizations moving to the cloud using capacity planning ideas that work on premise get sticker shock moving to the cloud.

But GCE makes this easier by allowing you to customize your memory and processors to use exactly what you need — and not pay for what you don’t need.

Compute Engine has Sustained Use discounts that kick in automatically when you use a VM for up to a month at a time. You can also lock in Committed Use Discounts where you pay upfront for a set amount of processors and memory for a set period of time — but you can configure and reconfigure those resources to your heart’s content. Finally we have an option called Preemptible VMs that cost a fraction of the normal cost, but are guaranteed to do away sometime in 24 hours, perfect for reducing the cost of scheduled batch work.

Conclusions

If you’re looking to get the benefits of cloud computing, Google Compute offers many ways to migrate your existing VMs.

Virtual machines handle much of the computing workloads at many companies all around the world. Moving to the cloud doesn’t mean losing those benefits. In fact it often means getting many more out of them. Google Cloud Virtual Machines are called Compute Engine. Compute Engine provides huge configurable differences that keep them an ocean apart from other cloud Virtual Machine platforms.

All Google Cloud accounts get 1 free micro instance to play with, so you can sign up and start kicking the tires today.

Stay tuned for the next article

This is a part of a series around understanding Compute Engine better.

The next article in the series, on Cost Control, is here.
The TOC is here.

--

--