Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google cloud Create image from instance

I have a VM which is up and running and I have few applications in the VM. So I want to have an image of this VM so that I can create new instances with all the installed packages. I have option called clone, but instead cloning a VM I wanted to have it as an Image and create VM whenever I want.

like image 317
Pasupathi Rajamanickam Avatar asked Apr 18 '16 18:04

Pasupathi Rajamanickam


People also ask

What is the difference between image instance and snapshot?

A snapshot reflects the contents of a persistent disk in a concrete instant in time. An image is the same thing, but includes an operating system and boot loader and can be used to boot an instance.


1 Answers

It's described here: https://cloud.google.com/compute/docs/creating-custom-image

Basically what it boils down to:

  1. Set the auto-delete state of the root persistent disk to false so that it is not automatically deleted when you delete the instance.
  2. Delete the instance.
  3. gcloud compute images create example-image --source-disk example-disk --source-disk-zone ZONE
like image 162
Christiaan Avatar answered Oct 14 '22 01:10

Christiaan