Virtual Machines Based Compute Options

Google Cloud Certification : GCP Virtual Machines Based Compute Options

In this article, we are going to learn about GCP Virtual machines and the benefits of Google Cloud Virtual Machine. Google Cloud Platform is one of the Grooming Cloud Providers in the industry, which is rising fast in adoption and has a number of services on it, that particularly want to use around things like Compute Engine, Machine learning and Analytics and so on. So it can be interesting to look at the benefits of Google Cloud Compute Engine.

This topic is tested in Google Cloud Certifications while you are preparing for the certification exam. If you are preparing for the Google Cloud Digital Leader exam , then this topic is asked in the cloud digital leader exam.

What is a Virtual Machine?

In Virtual machines, you will have the base underlying hardware which belongs to the physical machine and then on top of this you will have the virtual machine implementation or virtual box which allows you to have different virtual machines like VM1, VM2 and VM3 etc,. For this individual virtual machine they have their own kernel or own separate Operating system installed on top of this virtual machine.

Therefore, we have seen that, in reality we are just having one physical hardware but on top of that we have installed a different Operating system in each virtual machine with the help of a hypervisor or Virtual Box.

GCP Virtual Machines or Compute Engine

Google Cloud Compute Engine is a product that allows you to run virtual machines on top of Google’s massive infrastructure. Google Cloud Compute Engine is an Intuitive, flexible, simple at scale and secure compute service that lets you create and run your applications on Google Cloud’s Global Infrastructure.  

So, it consists of tons of Computing Cores, Memory, Disk storage and Networks which are globally distributed. The workflow that allows you to easily spin up thousands of VMs and coordinate their activity by intelligently routing traffic to the instances based on the user needs. 

There are six different VM families in Google Cloud Platform. These six different VMs are splitted into two Categories. They are

  • General Purpose
  • Workload Optimized

Here is the infographics for this:

Google Cloud Virtual Machines

General Purpose Machines

General purpose VMs are ideal for a wide variety of applications like web serving, databases and image processing and come in flavors that are optimized either for cost or a balance of price and performance.

  • Cost Optimized: For applications like web-serving, Steady state LOB apps and Small – Medium databases users can go with E2 families(Efficient). This is the best practices according to Google Cloud for users like Cost savings is a Priority.
  • Balanced VMs:  If the workload is like Enterprise apps, Medium databases, Web & App serving then users can go with Balanced (N1, N2, N2D) families. It can Balance between customization, performance and TCO.
  • Scale-out Optimized: It is suitable for scale-out workload, variety of cloud native deployments, large scale java applications and the user is looking for best performance then users can go with Tau(T2D) families.

Workload Optimized VMs

Workload optimized VMs include compute, memory and accelerator optimized options for your most demanding applications such as SAP Hana and high performance computing.

  • Compute Optimized: If the user is looking for ultra high performance with high intensive workload and CPUs like Game servers, Ad serving and high performance web serving then users can go with C2,C2D families.
  • Memory Optimized: If the workload is like Real-time data analytics, SAP HANA, Largest in memory Databases then Users can go with M1, M2 machine families. Mostly this machine is opted for Ultra high memory workload on Compute Engine.
  • Accelerator Optimized: If the workload consists of High Performance GPUs like ML Training, Massive Parallelized Computation then the users can go with A2 machine families.

Google Cloud Compute Engine offers Custom machine type to customize your machine by selecting the exact number of Cores and RAM for your workload.

Therefore, There is a range of machine types, so you can go from 1vCPU to 64vCPUs and you can opt for 0.6GB RAM to 416GB of RAM. Then Google Cloud has a set of different combinations of resources like standard, High CPU, High Memory and Shared CPU.

Spot VMs in Google Cloud

By using Spot VMs, you can achieve even greater savings through taking advantage of Spot VMs. Spot VMs are affordable compute instances suitable for batch jobs and fault tolerant workloads.

Google Cloud Spot VMs guarantee higher minimum savings and more predictability in Pricing for Spot instances compared to other Cloud Providers. The features of Spot VMs are

  • Enhanced Pre-emptible offerings
  • Higher minimum savings
  • More predictable pricing 
  • Spot extends to GKE standard(automatic preemption)

Security Features in Google Cloud Compute Engine

Google Cloud and Compute Engine are designed to be secure by default. For enhanced security, you can leverage Shielded VMs. Shielded VM features include verifiable integrity with secure and measured boot.

Shielded VMs

Secure boot helps prevent malicious code from being loaded early in the boot sequence. Measured boot ensures the integrity of the bootloader, kernel and boot drivers to guard against malicious modifications to the VM. 

vTPM Resistance (Virtual Trusted Platform Module) can validate your guest VM pre-boot and boot integrity using vTPM technology, which is a compatible and trusted computing group.

Live migration and patching :Keep your virtual machine instances running even when a host system event occurs, such as software or hardware updates. You can define IAM policies and permissions and set these policies that constrain all new Compute Engine instances to use Shielded VM disk images. This enables vTPM and Integrity Monitoring options.

Integrity Monitoring : Integrity monitoring lets you monitor and verify the runtime boot integrity of your shielded VM instances using Stackdriver reports. It Requires vTPM to be enabled.

Disks Options in Compute Engine

For every VM that you start up, you are going to need attached storage and so Google Compute Engine offers two types of Disks. They are

  • Standard Persistent Disks: Standard Disks are rotating magnetic media that is backed by Hard Disk Drive(HDD)
  • SSD persistent Disks: SSDs are obviously good random I/O kind of operations and it is backed by Solid State Drive(SSD)

Whether they are SSD or persistent Disks, it offers you very high availability and durability. Your data is actually spread across multiple disks, so if a particular device goes down, your data does not get lost and you continue to have access. 

Your data is encrypted at rest, so Google automatically encrypts the data and manages the keys.

Google provides Snapshots which allows you to easily backup disks and make copies and then transport that backup to other zones or other regions to spin up the instances.

Pricing of Virtual machine Instances

Virtual machines Pricing range from $0.008/hr to $4.032/hr per instance hour. You only get charged while the machine is running and there are a number of really friendly pricing innovations.

Instances are billed on a per minute basis so, if you use an instance for 10 minutes and even if it’s a 4$ per hour, you will get billed based on your usage. 

There are sustained use discounts which can be applicable for an instance which is running for a minimum period of 1 month. Then you will actually get a 30% discount. The more you use it, the bigger the marginal discount becomes.

Cost Optimization Benefits in Virtual Machines

Automatic Recommendation for VM Instance

Google Cloud automatically provides recommendations for machines and disks that may be idle or under utilized. Click on Compute Engine in the navigation menu.

In the recommendation column, you can see suggestions for each VM based on its historic resource usage. Applying these recommendations can provide an easy way to save on long term usage.

By clicking on the Save recommendation you can customize your VM instance based on the workload.

Recommended Instance in GCP

Pre-emptible VM

Depending on the type of workload you are running, you may also benefit from using different types of instances and Pre-emptible VMs. 

The new generation of E2 general purpose machines can give you a similar performance to the N1 series while also saving your money.

Leveraging Pre-emptible instances is a great way to run stateless workloads that are time sensitive like media transcoding. They have a maximum uptime of upto 24 hours before they are deleted, but they are 80% cheaper.

You can choose Pre-emptible when making new compute instances. To choose the Pre-emptible instance, you need to select the Create Instance tab.

Creating an Instance in GCP

After choosing the machine family and machine size you need to expand the Networking tab.

By default, Pre-emptible machines will be automatically turned off under the Management tab. It can be enabled manually by selecting the dropdown menu.

Pre-emptible Instance in GCP

Committed Use Discounts

If you know that you will be using resources over a long period of time, you can save even more by using committed use discounts. These are great for static workloads where you have consistent resource usage like multiple production machines.

When you purchase Committed Use Discounts for Compute Engine Resources like vCPU, RAM, GPU, local SSD and sole tenant. If there is a certain amount you know that you will always be running, you need to sign up for Commitments for a 1 or 3 year term. This can save upto 57% of your Total costs. Commitments can be made per project or span across entire billing account.

Instance Groups in Compute Engine

Instance groups are simply a collection of machines that you can manage together as opposed to individually. So these allow you to easily add or remove instances and you can simply change the size of the instance group and spin up additional instances. 

Instance Group provides you Self-healing on your instances. So, for some reason an instance goes down and you have a health check running already, the instance group can determine that instance is no longer healthy. Finally, it can shut it down and then bring up a replacement instance with the same configuration.

Auto-Scaling can be used to resize the instance automatically based on the traffic to the server. Auto-Scaling can be based on CPU utilization, requests per second and custom stackdriver metrics. 

Basically, how the machines are being used once they exceed an average utilization and you can add additional instances. This also scales down based on low traffic on the server.

Autoscaling in GCP

Load Balancing for Instances

HTTP(s) Load Balancing, which not only distributes the load across multiple backend instance groups, but it intelligently routes traffic to the nearest or fastest instance group as long as it has capacity. 

There is also TCP and UDP load balancing available in Google Compute Engine. And these instance groups can be zonal or regional. Opt for multiple zones which makes it less likely that, if there is an outage in one zone it will respond from another zone for your end users.

Loadbalancing in GCP

Networking in Google Compute Engine

In Google Cloud you have a sophisticated range of networking options available to you in Google Compute Engine. It automatically creates a network for you when you create a project.

This network has a variety of subnets, and those subnets are all routed for you automatically. So, it automatically generates these routes that allow all subnets to talk to each other. 

You can also create custom routes as necessary. The Firewall rules are super flexible to allow incoming traffic or deny incoming traffic from a particular port.

Conclusion

So hopefully, that gives you a good sense about using a Google Compute Engine in Google Cloud Platform. There are other products in GCP that use Compute Engine as the underlying platform like Kubernetes Engine, CloudShell and Dataproc.

Therefore, if you want to play around with Google Compute Engine there is a free tier of Compute Engine for f1 micro with 6GB of RAM and shared Processor.

I hope this article gives you an overview about Benefits of Google Compute Engine. In the next blog, we are going to publish a few more articles on Google Cloud. Till that stay tuned with us!!!

Happy Learning!!!

Leave a Comment

Your email address will not be published. Required fields are marked *


Scroll to Top