Stay organized with collections Save and categorize content based on your preferences.
This document describes what an instance template is, when to use an instance template, and what a deterministic instance template is. It also provides a comparison between regional and global instance templates.
An instance template is a convenient way to save a virtual machine (VM) instance's configuration that includes machine type, boot disk image, labels, startup script, and other VM properties.
You can use an instance template to do the following:
Create individual VMs.
Create VMs in a managed instance group (MIG).
Create reservations for VMs.
To learn how to create an instance template, see Create instance templates.
When to use instance templatesUse instance templates any time you want to quickly create VMs or reservations for VMs based off of a pre-existing VM property. If you want to create a group of identical VMs (a MIG), then you must create the MIG using an instance template.
How to update instance templatesInstance templates are designed to create VMs with identical configurations. You can't update instance templates after they're created. Instead, do one of the following:
Create a new instance template as follows:
Create VMs while overriding the instance template's properties.
Deterministic instance templates make explicitly clear the type of third-party services or apps to install on your VMs. This helps to ensure that your instance template always creates VMs with an identical configuration. For example, if your template has a startup script that fetches an app, you can specify the version of the app that you want in your template's startup script.
For more information, see Deterministic instance templates.
Regional and global instance templatesInstance templates are available both as regional and global resources. Unless you need to reuse an instance template across multiple regions, Google recommends using regional instance templates over global instance templates.
The following table provides a comparison between regional and global instance templates:
Regional instance template Global instance template Scope You can use the template only in the template's region. You can use the template in any region. Reliability Hardware errors are isolated to the template's region. Hardware errors can impact any region where the template is used. Use caseIn an instance template, you might specify zonal resources, which restricts the use of that template to the zone where that resource resides. Similarly, if you specify a regional resource in a global instance template, the template is restricted to that region. For example, if you include a read-only Persistent Disk from us-central1-a
in your instance template, you can't use that template in any other zone because that specific Persistent Disk exists only in zone us-central1-a
.
For more information about zonal resources, see Regions and zones.
How to specify instance templatesWhen creating resources that are based on an instance template, depending on the interface that you're using, you might need to specify the full or partial URL of the instance template—for example:
https://www.googleapis.com/compute/v1/projects/example-project/regions/us-central1/instanceTemplates/1234567890
projects/example-project/regions/us-central1/instanceTemplates/1234567890
You can specify either the ID or the name of the instance template. Google recommends that you specify the ID because, unlike names, instance template IDs can't be reused. This approach helps to ensure that the resources that you create from the template have the properties that you intend.
To view the template ID of an instance, see Get information about an instance template.
PricingThere is no additional charge for using instance templates. You are charged for the resources that you create based on the templates.
For Compute Engine pricing information, see
Pricing.
What's nextCreate an instance template from scratch, based on an existing instance, or based on an existing instance template.
Use an instance template to create a VM.
Use an instance template to create a MIG or update an existing MIG.
Use an instance template to create a reservation for VMs.
Except 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."],[[["Instance templates are used to save VM configurations, including machine type, boot disk image, labels, and startup scripts, for quick VM creation or reservations."],["Instance templates are utilized for creating individual VMs, managed instance groups (MIGs), and reservations for VMs, while MIGs must be created using an instance template."],["Instance templates cannot be updated after creation; instead, you can create new templates based on existing VMs or templates, or override properties when creating new VMs."],["Deterministic instance templates ensure VMs are created with identical configurations, specifically when third-party apps or services are involved, by specifying exact versions."],["Regional instance templates are recommended over global templates unless cross-region use is necessary, offering better reliability by isolating hardware errors and allowing for regional data residency, while both can be limited by the presence of zonal resources."]]],[]]
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