gcloud compute disks create
NAME
NAME
…]--description
DESCRIPTION
]--format
FORMAT
]--help
]--image
IMAGE
| --source-snapshot
SOURCE_SNAPSHOT
]--image-project
IMAGE_PROJECT
]--project
PROJECT_ID
]--quiet
, -q
]--size
SIZE
]--type
TYPE
]--zone
ZONE
]-h
]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
gloud compute instances attach-disk
.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.--zone
option:$ gcloud compute disks create my-disk-1 my-disk-2 --zone us-east1-a
NAME
[NAME
…]
--description
DESCRIPTION
--image
IMAGE
--size
to adjust the size of the disks.
Alias | Project | Image Name |
---|---|---|
centos-6 | centos-cloud | centos-6 |
centos-7 | centos-cloud | centos-7 |
container-vm | google-containers | container-vm |
coreos | coreos-cloud | coreos-stable |
debian-7 | debian-cloud | debian-7-wheezy |
debian-7-backports | debian-cloud | backports-debian-7-wheezy |
opensuse-13 | opensuse-cloud | opensuse-13 |
rhel-6 | rhel-cloud | rhel-6 |
rhel-7 | rhel-cloud | rhel-7 |
sles-11 | suse-cloud | sles-11 |
ubuntu-12-04 | ubuntu-os-cloud | ubuntu-1204-precise |
ubuntu-14-04 | ubuntu-os-cloud | ubuntu-1404-trusty |
ubuntu-14-10 | ubuntu-os-cloud | ubuntu-1410-utopic |
--image-project
. When --image-project
is
present, no API calls are made to resolve the image. This
property is useful for scripts.--source-snapshot
.--image-project
IMAGE_PROJECT
--image
for more details.
--size
SIZE
KB
for kilobyte, MB
for megabyte, GB
for gigabyte, or TB
for terabyte. For
example, 10GB
will produce 10 gigabyte disks. If omitted,
a default size of 500 GB is used for standard disks and 200GB
for SSD disks. The minimum size a disk can
have is 1 GB. Disk size must be a multiple of 10 GB.
--source-snapshot
SOURCE_SNAPSHOT
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
.
--size
to adjust the
size of the disks.--type
TYPE
gcloud compute
disk-types list
. The default disk type is pd-standard.
--zone
ZONE
compute/zone
property:$ gcloud config set compute/zone ZONE
$ gcloud compute zones list
$ gcloud config unset compute/zone
CLOUDSDK_COMPUTE_ZONE
.--format
FORMAT
json
, text
, yaml
.
--help
--project
PROJECT_ID
--quiet
, -q
-h
compute
component. See
installing components
if it is not installed.