- gcloud alpha compute disks create - create Google Compute Engine persistent disks
gcloud alpha compute disks create DISK_NAME [DISK_NAME ...] [--csek-key-file=FILE] [--description=DESCRIPTION] [--guest-os-features=[GUEST_OS_FEATURE,...]] [--labels=[KEY=VALUE,...]] [--licenses=[LICENSE,...]] [--replica-zones=ZONE,ZONE] [--no-require-csek-key-create] [--resource-policies=[RESOURCE_POLICY,...]] [--size=SIZE] [--type=TYPE] [--image-project=IMAGE_PROJECT --image=IMAGE | --image-family=IMAGE_FAMILY | --source-snapshot=SOURCE_SNAPSHOT] [--kms-key=KMS_KEY : --kms-keyring=KMS_KEYRING --kms-location=KMS_LOCATION --kms-project=KMS_PROJECT] [--region=REGION | --zone=ZONE] [GCLOUD_WIDE_FLAG ...]
(ALPHA) gcloud alpha compute disks create creates one or more Google
Disks are zonal resources, so they reside in a particular zone for their entire lifetime. The contents of a disk can be moved to a different zone by snapshotting the disk (using gcloud compute disks snapshot) and creating a new disk using --source-snapshot in the desired zone. The contents of a disk can also be moved across project or zone by creating an image (using gcloud compute images create) and creating a new disk using --image in the desired project and/or zone.
When creating disks, be sure to include the --zone option:
$ gcloud alpha compute disks create my-disk-1 my-disk-2 \
- DISK_NAME [DISK_NAME ...]
Names of the disks to create.
Path to a Customer-Supplied Encryption Key (CSEK) key file, mapping Google
Compute Engine resources to user managed keys to be used when creating,
mounting, or snapshotting disks.
If you pass - as value of the flag the CSEK will be read from stdin. See cloud.google.com/compute/docs/disks/customer-supplied-encryption for more details.
An optional, textual description for the disks being created.
This parameter enables one or more features for VM instances that use the image
for their boot disks. The following features are available:
MULTI_IP_SUBNET - For configuring interfaces with a netmask other than /32.
SECURE_BOOT - Enables UEFI secure boot, which restrics unsigned software from
booting or unsigned drivers from loading on the VM instance.
UEFI_COMPATIBLE - Enables UEFI booting, which is an alternative system boot
method. Most public images use the GRUB bootloader as their primary boot method.
VIRTIO_SCSI_MULTIQUEUE - Enables multiqueue SCSI capabilities for Local SSD
devices. This option is an alternative to NVMe.
- For Linux images, you can enable VIRTIO_SCSI_MULTIQUEUE on images with kernel versions 3.17 and higher.
For Windows images, you can enable VIRTIO_SCSI_MULTIQUEUE on images with driver
version 184.108.40.2061 or higher.
WINDOWS - Required for Windows Server images. Newer public images for Windows
server include the WINDOWS parameter to indicate that it is a Windows image.
GUEST_OS_FEATURE must be one of: MULTI_IP_SUBNET, SECURE_BOOT,
UEFI_COMPATIBLE, VIRTIO_SCSI_MULTIQUEUE, WINDOWS.
List of label KEY=VALUE pairs to add.
Keys must start with a lowercase character and contain only hyphens (-), underscores (_), lowercase characters, and numbers. Values must contain only hyphens (-), underscores (_), lowercase characters, and numbers.
A list of URIs to license resources. The provided licenses will be added onto
the created disks to indicate the licensing and billing policies.
A comma-separated list of exactly 2 zones that a regional disk will be
replicated to. Required when creating regional disk. The zones must be in the
same region as specified in the --region flag. See available zones with
gcloud compute zones list.
Refuse to create resources not protected by a user managed key in the key file
when --csek-key-file is given. This behavior is enabled by default to
prevent incorrect gcloud invocations from accidentally creating resources with
no user managed key. Disabling the check allows creation of some resources
without a matching Customer-Supplied Encryption Key in the supplied
more details. Enabled by default, use --no-require-csek-key-create
A list of resource policy names to be added to the disk. The policies must exist
in the same region as the disk.
Size of the disks. The value must be a whole number followed by a size unit of
GB for gigabyte, or TB for terabyte. If no size unit is
specified, GB is assumed. For example, 10GB will produce 10 gigabyte
disks. Disk size must be a multiple of 1 GB. Limit your boot disk size to 2TB to
account for MBR partition table limitations. If disk size is not specified, the
default size of 500GB for standard disks and 100GB for pd-ssd disks will be
Specifies the type of disk to create. To get a list of available disk types, run
gcloud compute disk-types list. The default disk type is pd-standard.
The project against which all image and image family references will be
resolved. It is best practice to define image-project.
- If specifying one of our public images, image-project must be provided.
- If there are several of the same image-family value in multiple projects, image-project must be specified to clarify the image to be used.
- If not specified and either image or image-family is provided, the current default project is used.
At most one of these may be specified:
An image to apply to the disks being created. When using this option, the size
of the disks must be at least as large as the image size. Use
--size to adjust the size of the disks.
This flag is mutually exclusive with --source-snapshot and --image-family.
The family of the image that the boot disk will be initialized with. When a
family is used instead of an image, the latest non-deprecated image associated
with that family is used.
Source snapshot used to create the disks. It is safe to delete a snapshot after
a disk has been created from the snapshot. In such cases, the disks will no
longer reference the deleted snapshot. To get a list of snapshots in your
current project, run gcloud compute snapshots list. A snapshot from an
existing disk can be created using the gcloud compute disks snapshot
command. This flag is mutually exclusive with --image.
When using this option, the size of the disks must be at least as large as the snapshot size. Use --size to adjust the size of the disks.
Key resource - The Cloud KMS (Key Management Service) cryptokey that will be
used to protect the disk. The arguments in this group can be used to specify the
attributes of this resource.
ID of the key or fully qualified identifier for the key. This flag must be
specified if any of the other arguments in this group are specified.
The KMS keyring of the key.
The Cloud location for the key.
The Cloud project for the key.
At most one of these may be specified:
Region of the disks to create. If not specified, you may be prompted to select a
To avoid prompting when this flag is omitted, you can set the compute/region property:
- $ gcloud config set compute/region REGION
A list of regions can be fetched by running:
- $ gcloud compute regions list
To unset the property, run:
- $ gcloud config unset compute/region
Alternatively, the region can be stored in the environment variable CLOUDSDK_COMPUTE_REGION.
Zone of the disks to create. If not specified and the compute/zone
property isn't set, you may be prompted to select a zone.
To avoid prompting when this flag is omitted, you can set the compute/zone property:
- $ gcloud config set compute/zone ZONE
A list of zones can be fetched by running:
- $ gcloud compute zones list
To unset the property, run:
- $ gcloud config unset compute/zone
Alternatively, the zone can be stored in the environment variable CLOUDSDK_COMPUTE_ZONE.
- At most one of these may be specified:
GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
This command is currently in ALPHA and may change without notice. If this command fails with API permission errors despite specifying the right project, you will have to apply for early access and have your projects registered on the API whitelist to use it. To do so, contact Support at cloud.google.com/support These variants are also available:
- $ gcloud compute disks create $ gcloud beta compute disks create