This page describes how to get, list, and delete instance templates.
Get information about an instance template
Console
- In the Google Cloud console, go to the Instance Templates page.
- Click the name of the instance template to see the details of the template.
gcloud
Using the Google Cloud CLI, run:
gcloud compute instance-templates describe [INSTANCE_TEMPLATE_NAME]
API
In the API, make a instanceTemplates().get
request:
GET https://compute.googleapis.com/compute/v1/projects/[PROJECT_ID]/global/instanceTemplates/[INSTANCE_TEMPLATE]
Go
Java
Node.js
Python
List instance templates
To get a list of instance templates you created:
Console
The Instance Templates page lists all of the instance templates in your project.
gcloud
Using the Google Cloud CLI, run:
gcloud compute instance-templates list
API
In the API, make a instanceTemplates().list
request:
GET https://compute.googleapis.com/compute/v1/projects/myproject/global/instanceTemplates
Go
Java
Node.js
Python
Delete an instance template
Deleting an instance template removes it from your list of templates. You cannot delete an instance template if a managed instance group references it.
Console
- In the Google Cloud console, go to the Instance Templates page.
- Select the instance templates you want to delete.
- Click Delete.
gcloud
Using the Google Cloud CLI, run:
gcloud compute instance-templates delete [INSTANCE_TEMPLATE_NAME]
API
In the API, make a instanceTemplates().delete
request:
DELETE https://compute.googleapis.com/compute/v1/projects/myproject/global/instanceTemplates/[INSTANCE_TEMPLATE_NAME]
Go
Java
Node.js
Python
Sometimes the instances in a managed instance group can be out of sync with the rest of the group, and use a different instance template than the rest of the group. If an instance in a managed instance group uses a different template than what is specified on the group, that instance will continue to use its template for autohealing events even if that template is deleted. To update an instance to the new template, recreate that instance.