Create a customized boot disk Stay organized with collections Save and categorize content based on your preferences.
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
- When you create virtual machines (VMs) from images or disks by using theGoogle Cloud CLI or REST, there's a limit of 20 VM instances persecond. If you need to create a higher number of VMs per second,request a higher quota limitfor theImages resource.
- If you haven't already, then set up authentication.Authentication is the process by which your identity is verified for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloud
Afterinstalling the Google Cloud CLI,initialize it by running the following command:
gcloudinit
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update
.- Set a default region and zone.
REST
To use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.
Afterinstalling the Google Cloud CLI,initialize it by running the following command:
gcloudinit
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
For more information, seeAuthenticate for using REST in the Google Cloud authentication documentation.
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
In the Google Cloud console, go to theCreate a disk page.
UnderDisk source type, selectImage. Choose an image from thelist.
ClickCreate.
gcloud
To create a standalone boot disk, use thegcloud compute disks create
command:
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
In the Google Cloud console, go to theCreate a disk page.
UnderDisk source type, selectSnapshot.
Choose a snapshot from the list.
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
- The process for resizing a boot disk and a non-boot diskare the same. For more information, see the instructions inResize a Persistent DiskorChange the size or provisioned performance of a Hyperdisk volume.
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.