Here’s how to create a GCP Disk Image from a Boot Drive.

  • First, stop the instance.
  • If you can’t, stop the applications/database from writing to disks.
  • Run sudo sync .

Create From Disk

<pre lang="bash">
gcloud compute images create the-new-image-name \
   --source-disk the-source-boot-disk \
   --source-disk-zone us-central1-a \
   --family the-image-family \
   [--force]

Create From Image

<pre lang="bash">
gcloud compute images create the-new-image-name \
  --source-image the-source-image \
  --source-image-project the-project-where-the-image-is-located \
  --family the-image-family

Create From Snapshot

<pre lang="bash">
gcloud compute images create the-new-image-name \
  --source-snapshot the-source-snapshot

For more info.