GCLOUD_COMPUTE_DISKS_CREATE(1)

NAME

gcloud compute disks create - create Google Compute Engine persistent disks

SYNOPSIS

gcloud compute disks create DISK_NAME [DISK_NAME ...] [--csek-key-file=FILE] [--description=DESCRIPTION] [--image-project=IMAGE_PROJECT] [--labels=[KEY=VALUE,...]] [--no-require-csek-key-create] [--size=SIZE] [--type=TYPE] [--zone=ZONE] [--image=IMAGE | --image-family=IMAGE_FAMILY | --source-snapshot=SOURCE_SNAPSHOT] [GCLOUD_WIDE_FLAG ...]

DESCRIPTION
gcloud compute disks create creates one or more Google Compute Engine persistent disks. When creating virtual machine instances, disks can be attached to the instances through the gcloud compute instances create command. Disks can also be attached to instances that are already running using gcloud compute instances attach-disk. 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 compute disks create my-disk-1 my-disk-2 --zone us-east1-a

POSITIONAL ARGUMENTS

    DISK_NAME [DISK_NAME ...]
        The names of the disks to create.

FLAGS

    --csek-key-file=FILE
        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 https://cloud.google.com/compute/docs/disks/customer-supplied-encryption for more details.

    --description=DESCRIPTION
        An optional, textual description for the disks being created.

    --image-project=IMAGE_PROJECT
        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.

    --labels=[KEY=VALUE,...]
        A list of label KEY=VALUE pairs to add.

    --require-csek-key-create
        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 --csek-key-file. See https://cloud.google.com/compute/docs/disks/customer-supplied-encryption for more details. Enabled by default, use --no-require-csek-key-create to disable.

    --size=SIZE
        Indicates the 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.

    --type=TYPE
        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.

    --zone=ZONE
        The zone of the disks to create. If not specified, 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:

    --image=IMAGE
        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.

    --image-family=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=SOURCE_SNAPSHOT
        A 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.

GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.