Unable to Create instance-template from VM Instance

33 views
Skip to first unread message

Dx Dev

unread,
Sep 10, 2018, 10:16:33 PM9/10/18
to Google App Engine
hi,

I am new to google cloud platform. i have already running my php web app on single VM Instance. now i am trying to create a Autoscaling Groups for this app. for that i have followed following steps:
  • create instance-template from my existing vm instance (the one which have running php web app)
  • then created instance group 
  • and finally create a load balancer.
now when i check my Autoscaling Groups, it has created new instance but without any code from my existing  instance. new instance only create with ubuntu OS but I thought it will copy all php code and install Apache web server from my old instance as I created instance template for the old instance with the help of following command:

gcloud beta compute instance-templates create my-templates-instance --source-instance=my-instance-1 --source-instance-zone=us-central1-c

i don't know what i miss. please help me 

Shaiq Muhammad (Google Cloud Support)

unread,
Sep 13, 2018, 5:57:35 PM9/13/18
to Google App Engine
Hello, 

As per this article "--source-instance" flag to save the configuration of an existing virtual machine instance into an instance template. From your gcloud command line, it seems like you already used this flag but still the new instances created without the code from existing instance, In order move the case forward and figure out the root cause please provide the following information: 

- Is there more than one disk on the machine? we need this information because, this manifests easily if code lives on a second disk, but the template is made only from the boot disk.
- Can you create the template successfully via cloud console? Flow would be to 

1) Make an image from the intended disk 
2) make a new instance template from that image (once you create image you will see the image under "Custom images" )
3) spin up instance using that template
Reply all
Reply to author
Forward
0 new messages