Create a runtime template in Colab Enterprise Skip to main content
Stay organized with collections Save and categorize content based on your preferences.
Create a runtime templateThis page shows you how to create a runtime template in Colab Enterprise.
To run code in your notebook, you use a compute resource called a runtime. You can use the default runtime or a runtime created from a runtime template. By creating a runtime template, you can configure the template to optimize a runtime's performance, cost, and other characteristics based on your needs.
Learn more about runtimes and runtime templates.
Before you beginIn the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Verify 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.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Verify that billing is enabled for your Google Cloud project.
Enable the Vertex AI, Dataform, and Compute Engine APIs.
To get the permissions that you need to create a runtime template in Colab Enterprise, ask your administrator to grant you the Colab Enterprise Admin (roles/aiplatform.colabEnterpriseAdmin
) IAM role on the project. 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.
One or more of the required roles includes thedataform.repositories.list
permission. Users who are granted the dataform.repositories.list
permission or the Code Creator (roles/dataform.codeCreator
) role in a project can list the names of code assets in that project by using the Dataform API or the Dataform command-line interface (CLI). Non-administrators using BigQuery Studio can only see code assets that they created or that were shared with them. Create the runtime template
To create a runtime template, you can use the Google Cloud console, the Google Cloud CLI, the REST API, or Terraform.
ConsoleTo create a runtime template:
In the Google Cloud console, go to the Colab Enterprise Runtime templates page.
Click add_box 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.
Optional: Add a Description of your runtime template.
Optional: To add a label, click add Add label, and then enter a Key and Value pair. To add more labels, repeat this step.
Click Continue.
In the Configure compute section, in the Machine type menu, select a machine type. For information on machine types, see the Machine families resource and comparison guide.
If you select a machine type that has GPUs, select the Accelerator type and Accelerator count. If you're unable to select the number of GPUs that you want, you might need to increase your quota. See Request a quota adjustment.
In the Data disk type menu, select a disk type.
In the Data disk size field, enter a size in GB.
In the Idle shutdown section:
To turn off idle shutdown, clear Enable idle shutdown.
To change the inactivity time period, in Time of inactivity before shutdown (Minutes), change the number to the number of minutes of inactivity that you want. In the Google Cloud console, this setting can be set to any integer value from 10 to 1440.
Click Continue.
In the Environment section, select an Environment. The default is Latest (currently Python 3.11).
Click Continue.
In the Networking and security section, in the Network menu, select a network. If you don't select a network, your default network is selected.
In the Subnetwork menu, select a subnetwork.
To turn off public internet access, clear Enable public internet access.
To turn off end-user credential access, clear Enable end-user credentials.
Click Create to finish creating the runtime template.
Your runtime template appears in the list on the Runtime templates tab.
gcloudBefore using any of the command data below, make the following replacements:
DISPLAY_NAME
: the display name of your runtime template.PROJECT_ID
: your project ID.REGION
: the region where you want your runtime template.MACHINE_TYPE
: the machine type to use for your runtime.ACCELERATOR_TYPE
: the type of hardware accelerator to use for your runtime.ACCELERATOR_COUNT
: the number of accelerators to use for your runtime.Execute the following command:
Linux, macOS, or Cloud Shell Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running either gcloud init; or gcloud auth login and gcloud config set project.gcloud colab runtime-templates create --display-name="DISPLAY_NAME" \ --project=PROJECT_ID \ --region=REGION \ --machine-type=MACHINE_TYPE \ --accelerator-type=ACCELERATOR_TYPE \ --accelerator-count=ACCELERATOR_COUNTWindows (PowerShell) Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running either gcloud init; or gcloud auth login and gcloud config set project.
gcloud colab runtime-templates create --display-name="DISPLAY_NAME" ` --project=PROJECT_ID ` --region=REGION ` --machine-type=MACHINE_TYPE ` --accelerator-type=ACCELERATOR_TYPE ` --accelerator-count=ACCELERATOR_COUNTWindows (cmd.exe) Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running either gcloud init; or gcloud auth login and gcloud config set project.
gcloud colab runtime-templates create --display-name="DISPLAY_NAME" ^ --project=PROJECT_ID ^ --region=REGION ^ --machine-type=MACHINE_TYPE ^ --accelerator-type=ACCELERATOR_TYPE ^ --accelerator-count=ACCELERATOR_COUNT
For more information about the command for creating a runtime template from the command line, see the gcloud CLI documentation.
RESTBefore using any of the request data, make the following replacements:
REGION
: the region where you want your runtime template.PROJECT_ID
: your project ID.DISPLAY_NAME
: the display name of your runtime template.MACHINE_TYPE
: the machine type to use for your runtime.ACCELERATOR_TYPE
: the type of hardware accelerator to use for your runtime.ACCELERATOR_COUNT
: the number of accelerators to use for your runtime.HTTP method and URL:
POST https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/notebookRuntimeTemplates
Request JSON body:
{ "displayName": "DISPLAY_NAME", "machineSpec": { { "machineType": MACHINE_TYPE "acceleratorType": ACCELERATOR_TYPE, "acceleratorCount": ACCELERATOR_COUNT, } }, }
To send your request, choose one of these options:
curl Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
curl -X POST \PowerShell Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/notebookRuntimeTemplates"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
$cred = gcloud auth print-access-tokenIf successful, the response body contains an instance of Operation.
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/notebookRuntimeTemplates" | Select-Object -Expand Content
For more information, see the notebookRuntimeTemplates.create
REST API documentation.
To learn how to apply or remove a Terraform configuration, see Basic Terraform commands. For more information, see the Terraform provider reference documentation.
The following sample uses the google_colab_runtime_template
Terraform resource to create a Colab Enterprise runtime template.
After you create a runtime template, you must grant access to it for a principal to be able to use it. A principal can create a runtime from a runtime template only when they have the following:
See Manage access to a runtime template.
Delete a runtime templateTo delete a runtime template:
In the Google Cloud console, go to the Colab Enterprise Runtime templates page.
In the Region menu, select the region that contains your runtime template.
Select the runtime template that you want to delete.
Click delete Delete.
Click Confirm.
This section shows you how to resolve issues with creating runtime templates in Colab Enterprise.
Unable to select enough GPUsWhile creating a runtime template, you can't select the number of GPUs that you want. This might be because you don't have enough quota.
Colab Enterprise uses Compute Engine quota for GPUs. For more information, see the Compute Engine quota and limits overview.
To resolve this issue, Request a quota adjustment.
What's nextExcept as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["Runtime templates in Colab Enterprise allow users to configure runtime performance, cost, and characteristics according to their specific requirements."],["Creating a runtime template can be done through the Google Cloud console, the Google Cloud CLI, or Terraform, each with its own set of steps and configurations."],["Configuring a runtime template involves defining settings like machine type, disk type, idle shutdown behavior, and networking and security options."],["To utilize a runtime template, users need the appropriate access to the template and the necessary permissions to create runtimes."],["A user might need to increase their quota if they need a number of GPUs for their template that exceeds their current limit."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4