Attaches a Disk resource to an instance.

gce_attach_disk(instance, source = NULL, autoDelete = NULL,
  boot = NULL, deviceName = NULL, diskEncryptionKey = NULL,
  index = NULL, initializeParams = NULL, interface = NULL,
  licenses = NULL, mode = NULL, type = NULL,
  project = gce_get_global_project(), zone = gce_get_global_zone())

Arguments

instance

The instance name for this request

source

Specifies a valid partial or full URL to an existing Persistent Disk resource

autoDelete

Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance)

boot

Indicates that this is a boot disk

deviceName

Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance

diskEncryptionKey

Encrypts or decrypts a disk using a customer-supplied encryption key

index

Assigns a zero-based index to this disk, where 0 is reserved for the boot disk

initializeParams

A gce_make_boot_disk object for creating boot disks. Cannot be used with source also defined.

interface

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME

licenses

[Output Only] Any valid publicly visible licenses

mode

The mode in which to attach this disk, either READ_WRITE or READ_ONLY

type

Specifies the type of the disk, either SCRATCH or PERSISTENT

project

Project ID for this request

zone

The name of the zone for this request

Details

Authentication scopes used by this function are:

  • https://www.googleapis.com/auth/cloud-platform

  • https://www.googleapis.com/auth/compute

See also

Google Documentation

Other AttachedDisk functions: AttachedDisk