Use reservations
This document explains how to use Compute Engine reservations to gain a high level of assurance that your Colab Enterprise runtimes have enough virtual machine (VM) resources to run.
Reservations are a Compute Engine feature. They help make sure that you have the resources available to create VMs with the same hardware (memory and vCPUs) and optional resources (GPUs and Local SSD disks) whenever you need them.
When you create a reservation, Compute Engine verifies that the requested capacity is available in the specified zone. If so, then Compute Engine reserves the resources, creates the reservation, and the following happens:
The reserved resources are immediately available for you to consume, and they remain available until you delete the reservation.
You're charged for the reserved resources at the same on-demand rate as running VMs, including any applicable discounts, until the reservation is deleted. While consuming a reservation, a VM doesn't incur duplicate charges for resources since the reservation is already billed for the cost of the reserved resources. To learn more, see Reservations of Compute Engine zonal resources.
Overview
To use a reservation with Colab Enterprise, you perform the following tasks:
Use the reservation by running code on a runtime derived from your runtime template.
Limitations and requirements
All limitations of Compute Engine reservations apply when Colab Enterprise runtimes consume reservations. See How reservations work.
In addition, when using reservations with Colab Enterprise, the following limitations and requirements apply:
Your reservation must be one of the following:
- In the same project as your Colab Enterprise notebook and runtime.
- Shared with the same project as your Colab Enterprise notebook and runtime.
A reservation's VM properties must match exactly with your Colab Enterprise runtime to consume the reservation. For example, if a reservation specifies an
e2-standard-8
machine type, then the Colab Enterprise runtime can only consume the reservation if it also uses ane2-standard-8
machine type. See Requirements.
Before you begin
- Review the requirements and restrictions for reservations.
- Review the quota requirements and restrictions for shared reservations.
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Vertex AI, Dataform, and Compute Engine APIs.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Vertex AI, Dataform, and Compute Engine APIs.
Required roles
To get the permissions that you need to use reservations with Colab Enterprise, ask your administrator to grant you the following IAM roles on the project:
-
Colab Enterprise User (
roles/aiplatform.colabEnterpriseUser
) -
Compute Admin (
roles/compute.admin
)
For more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
Create a reservation
Create a Compute Engine reservation. It can be a single-project reservation or a shared reservation. For more information, see the following documents:
The reservation can include GPU accelerators.
Add your reservation to a new runtime template
To create a runtime template that uses your reservation, do the following:-
In the Google Cloud console, go to the Colab Enterprise Runtime templates page.
-
Click
New template.The Create new runtime template dialog appears.
-
In the Runtime basics section, enter a Display name.
-
In the Region menu, select the region where you want your runtime template.
-
In the Configure compute section, in the Machine type menu, select a machine type. The runtime template's machine type must match your reservation's machine type.
-
In the Reservations menu, select the specific reservation that you want to use or select Use automatically selected reservations.
For more information about consuming automatically selected or specifically targeted reservations, see the Consumption type section of How reservations work.
-
Complete the rest of the dialog, and then click Create.
Your runtime template appears in the list on the Runtime templates tab.
Use your reservation
To use your reservation, do the following:
Create a runtime from your new runtime template.
Open or create a notebook.
In your notebook, connect to the runtime, and run code.
Stop using your reservation
To stop using your reservation, you can delete your reservation.
If you want to continue using your reservation with other resources, but don't want your Colab Enterprise notebooks to use it, delete the runtime and runtime template that are associated with your reservation.
Billing
When consuming a Compute Engine reservation, you're billed for the following:
The Compute Engine resources, including any applicable committed use discounts (CUDs), at Compute Engine pricing. These charges have the label
goog-vertex-ai-product: colab-enterprise
on the SKU. See Compute Engine pricing.Colab Enterprise management fees in addition to your infrastructure usage. See Colab Enterprise pricing.
Troubleshoot
This section shows you how to resolve issues when using reservations with Colab Enterprise.
Unable to create a runtime
An error similar to the following occurs when you try to create a runtime.
Failed to create notebook runtime with error: Invalid value for field 'resource.reservationAffinity': '{"consumeReservationType": "SPECIFIC_ALLOCATION", "key": "compute.googleapis.com/reservation-name...'. No available resources in specified reservations.
This error occurs when a reservation's VM properties don't match your Colab Enterprise
runtime. For example, if a reservation specifies an e2-standard-8
machine type,
then the Colab Enterprise runtime can only consume the reservation if it also uses an
e2-standard-8
machine type. For more information,
see Requirements.
To resolve this issue, create a runtime template with a configuration that matches the reservation's VM properties.
What's next
To grant a principal access to your runtime template, see Manage access to a runtime template.
To learn more about Compute Engine reservations, see Reservations of Compute Engine zonal resources.