Create a customized boot disk


When you create a Compute Engine instance, you must also create aboot disk for the instance. You can use a public image, a custom image, ora snapshot that was taken from another boot disk. When you create a boot disk,limit the disk size to 2 TiB to account for the limitations ofMBR partitioning.

Compute Engine automatically creates a boot disk when youcreate an instance.If you require additional data storage space for your instances, add one ormore secondaryinstance storage disks to the instance.

Use the procedures described in this document to create boot disks that you canuse later to create VMs. To improve the performance of a boot disk or to addspace for additional applications or operating system files, you canresize thePersistent Disk orGoogle Cloud Hyperdiskboot disk.

As a best practice, don't useregional disksfor boot disks. In a failover situation, they don't force-attach to a computeinstance.

Before you begin

Create a boot disk from an image

You can create a standalone boot disk outside of instance creationand attach it to an instance afterwards.

Console

  1. In the Google Cloud console, go to theCreate a disk page.

    Go to the Create a disk page

  2. UnderDisk source type, selectImage. Choose an image from thelist.

  3. ClickCreate.

gcloud

To create a standalone boot disk, use thegcloud compute disks createcommand:

gcloud compute disks createDISK_NAME --imageIMAGE_NAME

REST

To create a new boot disk, make aPOST request to thedisks.insert method:

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_NAME/zones/ZONE/disks?sourceImage=IMAGE

ReplaceIMAGE with the URL-encoded, fully qualified URI of the sourceimage to apply to this boot disk.

The request body must contain a name for this new disk:

{    "name": "DISK_NAME"}

If you created a boot disk that is larger than the image, you might want torepartition the boot disk.

Create a boot disk from a snapshot

After you create a snapshot of a boot disk, you can use the snapshot to createnew boot disks.

You can only apply data from a snapshot when you first create a disk. You can'tapply a snapshot to an existing disk, or apply a snapshot to disks thatbelong to a different project than the snapshot.

Console

  1. In the Google Cloud console, go to theCreate a disk page.

    Go to the Create a disk page

  2. UnderDisk source type, selectSnapshot.

  3. Choose a snapshot from the list.

  4. Finish setting the properties for your disk and clickCreate.

gcloud

To apply data from a disk snapshot, run the following command:

gcloud compute disks createDISK_NAME --source-snapshotSNAPSHOT_NAME

REST

To create a boot disk from a snapshot, make aPOST request to thedisks.insert method:

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_NAME/zones/ZONE/disks

The request body must contain a name for this new disk and theURL for the snapshot to use when creating the disk:

{    "name": "DISK_NAME",    "sourceSnapshot": "zones/ZONE/snapshots/SNAPSHOT_NAME"}

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-09 UTC.