Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCE: create instance template out of disk snapshot

Is it possible? Official manual consists this:

Deterministic instance templates

  • Use custom images or disk snapshots rather than startup scripts.

But no more info how can I do this. Maybe someone have already did that? Tnx in advance.

like image 900
cardinal-gray Avatar asked Jan 21 '15 13:01

cardinal-gray


2 Answers

It's possible. Here's the process:

  1. Create your Snapshot
  2. Create Disk from your Snapshot
  3. Create an Image from Disk
  4. Create an Instance Template from Image
like image 94
Cigogne Eveillée Avatar answered Sep 28 '22 00:09

Cigogne Eveillée


So my solution is following:

  1. I created an instance.
  2. Install the required services on that instance.
  3. Created the image from the disk using the steps mentioned on this link.
  4. With that Image created a new template.

The startup scripts will run on instance boots up or restarts. So the only way I found to run it once is the same which you have tired i.e deleting them from metadata. In my setup when using startup scripts I don't reboot the instances I rather delete them and create a new ones if required.

like image 22
Faizan Avatar answered Sep 28 '22 00:09

Faizan