Introduction

Google Cloud Platform (GCP) provides users with the ability to make reservations, allowing them to reserve virtual machine instances and save costs. With GCP reservations, users can plan and allocate their computing resources more effectively. By reserving instances ahead of time, users can ensure that their applications have the necessary compute capacity, while also benefiting from significant cost savings compared to on-demand pricing.

GCP reservations are suitable for a wide range of workloads, including batch processing, analytics, and high-performance computing. Whether you are a startup, small business, or an enterprise – leveraging GCP reservations can help optimize your cloud spending and enhance overall efficiency. Take advantage of Google Cloud Platform’s reservation feature and unlock the power of cost-effective and scalable computing for your business needs.

Protect Your Data with BDRSuite

Cost-Effective Backup Solution for VMs, Servers, Endpoints, Cloud VMs & SaaS applications. Supports On-Premise, Remote, Hybrid and Cloud Backup, including Disaster Recovery, Ransomware Defense & more!

When is Reservation for a VM required ?

To ensure availability of Compute Engine resources when needed, utilize reservations. Reservations offer a strong guarantee of acquiring capacity for Compute Engine zonal resources. They can assist in securing resources for anticipated increases in demand within your project. You may require reservation in the following cases:

  • Growth
  • Planned or unplanned spikes
  • Migration of a large number of virtual machine (VM) instances
  • Backup and disaster recovery

With a reservation, 95% of VMs can start within less than 120 seconds. Each reservation guarantees resources for one or more VMs with identical properties. Once a reservation is created, the reserved resources are instantly available and remain so until the reservation is deleted. As soon as a reservation is created, charges for the reserved resources commence, and when the reservation is no longer needed, deleting it stops further incurring charges. While a VM is using a reservation, no additional charges are incurred.

How does a Reservation work?

According to GCP documentation, “A Reservation ensures capacity for one or more Compute Engine VMs with the specified configuration. It can also be used with Compute Engine commitments or other products that utilize VMs.”

Download Banner

When you create a reservation, you define the following properties:

  • Provisioning type (on-demand or future)
  • Auto-delete
  • Consumption type (automatic or specific)
  • Share type (single-project or shared)
  • Resource placement policy (compact) – Optional
  • VM count
  • VM properties

Provisioning type – On demand or Future reservation

An on-demand reservation (default) is allocated when you request it, if the required capacity is available.

A future reservation enables you to secure important or hard-to-obtain capacity in advance. It comprises two types of resources: a) future reservation requests, which, if approved, result in automatically b) created reservations at your specified future time.

Once the requested reservation period has ended, an auto-created reservation is either automatically removed or operates similarly to an on-demand reservation.

Utilizing future reservations can offer an even higher level of assurance in obtaining capacity compared to on-demand reservations, as it allows Google Cloud more time to fulfill your request.

Auto-delete

The auto-delete feature enables reservations to be automatically deleted, regardless of whether they have been fully consumed. If you activate this option, the reservation will be removed within two hours of the specified date and time. Automatically deleting reservations can help prevent unnecessary charges for reservations that have not been used for a period of time.

Consumption type (automatic or specific)

An automatically utilized reservation (default) can be utilized by VMs with a reservation affinity property that allows them to automatically utilize any of these reservations (default).

Specifically targeted reservations are only accessible to VMs with a reservation affinity property directed at that specific reservation. Using targeted reservations simplifies monitoring and controlling the consumption of reservations by VMs.

Share type (single-project or shared)

By default, a single-project reservation can only be used by VMs within the same project. On the other hand, a shared reservation can be used by VMs in the project where it’s located as well as any other project it’s shared with. Utilizing shared reservations can enhance reservation utilization and minimize the need to create and handle multiple reservations.

VM count

The VM count is the number of VMs with matching properties and zone that you want to reserve when creating a reservation. After you create the reservation, you can modify the VM count.

VM properties

The VM properties describe the hardware requirements for the VMs that you want to reserve. A VM can consume a reservation only if both the VM’s properties and reservation’s properties match exactly. For more information, refer to the Requirements section.

Requirements for creating a Reservation

A Virtual Machine (VM) can only use a reservation if all of the following characteristics for both the VM and the reservation match precisely:

  • Project
  • Zone
  • Machine type
  • Minimum CPU platform
  • GPU type and count
  • Local SSD type and count
  • Reservation affinity
  • Compact placement policy

In this blog, we are providing steps to create a single-project reservation, which can be consumed only by virtual machine (VM) instances in the same project.

Login to your GCP console with your valid credential

Choose Reservation under Virtual Machines in Left Navigation Menu

Click “Create Reservation” on the main page of the Reservation page.

Google Cloud

In the create a reservation page, provide a name for the reservation. Choose Region & Zone for the reservation.

In the Share type, choose Local to use this reservation only for the Current project where your VM resides, and choose the option ” use reservation automatically”. This option grants you to allow matching VMs to automatically consume this reservation.

Google Cloud

The below screenshot shows these steps.

Under Resouce details,

Provide the number of VM instances ie., the number of VMs that you want to reserve.

In the Machine configuration section, you can choose a particular machine type or can use the instance template of your choice.

In the machine type, choose a machine type with preset amounts of vCPUs and memory that suit most workloads. Or, you can create a custom machine for your workload’s particular needs.

The below screenshot shows these details

Google Cloud

Further down the configuration page,

You can configure a compact placement policy as an optional step. Then you can configure Auto-delete option, wherein you can specify the date and time to let compute Engine automatically delete the reservation. Automatically deleting reservations can be useful to avoid unnecessary charges when you stop consuming the reservation.

Finally to create the reservation, click Create.

Google Cloud

Creating the single-project reservation might take some time to complete. This action redirects you to the Reservations page. On clicking the name of the reservation you will get all the details of the reservation.

Google Cloud

In this blog, we have provided only the steps for creating a reservation. Further, the user needs to fulfill the additional step “Consume reserved VMs” to consume the reservation created.

Consume reserved VMs

When a virtual machine (VM) instance is created, the VM will only begin utilizing a reservation if the properties of both the VM and the reservation match. Additionally, you must specify the reservation affinity property of the VM with one of the following options:

Consume any matching reservation – the VM can automatically consume any reservation with matching properties (default).

This feature is beneficial when creating and deleting numerous VMs and wanting to utilize reservations whenever feasible. In this situation, a VM can be created regardless of whether its properties align with a reservation or not. If they do align, the VM will begin utilizing the reservation based on its consumption order.

Consume a specific reservation – the VM can consume only a specific reservation. The reservation can’t be automatically consumed.

This feature is valuable in situations where you need to reserve a specific capacity as a backup for special events. In this case, a virtual machine (VM) will only be created if its properties align with the properties of the specific reservation.

Can’t consume any reservation at all—the VM can’t consume any reservation.
This option is useful when, for example, you create a temporary VM that you don’t want to consume reserved resources.

Reservation Restrictions

All reservations have the following restrictions:

1. You can reserve up to 1,000 VMs per reservation.

2. Reservations apply only to the usage of VMs in the following Google Cloud products:

  • Batch
  • Compute Engine
  • Dataflow
  • Dataproc
  • Google Kubernetes Engine

3. Reservations don’t apply to the following resources:

  • f1-micro and g1-small machine types
  • Preemptible VMs
  • Sole-tenant nodes
  • Other services not previously listed, like Cloud SQL

4. Compute Engine attempts to allocate on-demand resources when you create a reservation. If there aren’t enough resources in the zone at the time of the request, the reservation fails with a resource availability error due to insufficient capacity. If the reservation is created successfully, then the resources are available for you to use, even if you don’t use them immediately.

Conclusion

In conclusion, Google Cloud Platform (GCP) offers users the invaluable feature of reservations, enabling them to effortlessly reserve virtual machine instances and assert control over their expenditure. With GCP reservations, users can strategically plan and allocate their computing resources, ensuring the adequate compute capacity for their applications while simultaneously enjoying substantial cost savings relative to on-demand pricing.

GCP reservations accommodate an array of workloads, ranging from batch processing and analytics to high-performance computing, making them an ideal solution for startups, small businesses, and enterprises alike. By employing GCP reservations, businesses can optimize their cloud spending, bolster operational efficiency, and harness the benefits of cost-effective and scalable computing that Google Cloud Platform has to offer.

Follow our Twitter and Facebook feeds for new releases, updates, insightful posts and more.

Rate this post