gcloud compute instances attach-disk
INSTANCE
--device-name
DEVICE_NAME
] --disk
DISK
[--format
FORMAT
]--help
]--mode
MODE
; default="rw"]--project
PROJECT_ID
]--quiet
, -q
]--zone
ZONE
]-h
]gcloud compute instances attach-disk
is used to attach a disk to an instance. For example,$ gcloud compute instances attach-disk example-instance --disk DISK \ --zone us-central1-a
DISK
to the instance named
example-instance
in zone us-central1-a
.INSTANCE
--device-name
DEVICE_NAME
--disk
DISK
--mode
MODE
; default="rw"
ro
for
read-only and rw
for read-write. If omitted, rw
is used as
a default. It is an error to attach a disk in read-write mode to
more than one instance.
--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.