d.ansimov
d.ansimov

Reputation: 2171

GCE: create instance template out of disk snapshot

Is it possible? Official manual consists this:

Deterministic instance templates

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

Upvotes: 7

Views: 3772

Answers (3)

Nepaluz
Nepaluz

Reputation: 697

I don't know whether it is anew feature, but you can simply replicate an instance by

  1. Creating a snapshot
  2. When the snapshot is ready, click on it (it'll show the details)
  3. In the breadcrumbs bar, click on Create Instance.

It'll take a minute or so and the new instance will start-up, and that's all!

Upvotes: -1

Cigogne  Eveillée
Cigogne Eveillée

Reputation: 2208

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

Upvotes: 7

Faizan
Faizan

Reputation: 1967

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.

Upvotes: 6

Related Questions