Want to ask a question, how to create instance templates for existing instances on GCP. On the official website, there is only an instance template creation method for the os disk of the VM. How to create an instance template for a vm that has attached a disk, and you want to use this template for autoscaling.
Asked
Active
Viewed 132 times
1 Answers
1
You can follow this article in order to create an instance template based on an existing instance. But please keep in mind that this is a Beta release of Creating an instance template based on an existing instance . This feature is not covered by any SLA or deprecation policy and may be subject to backward-incompatible changes.
==== Edited ====
I assuming the extra disk was a blank disk and not made from an image then from the command line you can use as like following example :
gcloud beta compute instance-templates create test-from-instance-1 --source-instance=instance-1 --source-instance-zone=us-central1-c --configure-disk='device-name=disk-1,instantiate-from=blank'
if it's not a blank disk you need to choose the appropriate instantiate-from= argument

Shaiq
- 221
- 1
- 5
-
but how to do it? I can't find command – dyc Jun 22 '18 at 02:15
-
which parameter is about additional disk?!can u tell me thanks – dyc Jun 22 '18 at 02:43