An instance-attached disk resource.
JSON representation |
---|
{ "kind": string, "type": enum ( |
Fields | |
---|---|
kind |
[Output Only] Type of the resource. Always
for attached disks. |
type |
Specifies the type of the disk, either
or
. If not specified, the default is
. |
mode |
The mode in which to attach this disk, either
or
. If not specified, the default is to attach the disk in
mode. |
saved |
For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this field is set to
if the LocalSSD data has been saved to a persistent location by customer request. (see the discardLocalSsd option on Stop/Suspend). Read-only in the api. |
source |
Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance boot disk, one of
or
or
is required. If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. Note that for InstanceTemplate, specify the disk name for zonal disk, and the URL for regional disk. |
device |
Specifies a unique device name of your choice that is reflected into the
tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, the server chooses a default device name to apply to this disk, in the form
, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks. |
index |
[Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number. |
boot |
Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem. |
initialize |
[Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. This property is mutually exclusive with the
property; you can only define one or the other, but not both. |
auto |
Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). |
licenses[] |
[Output Only] Any valid publicly visible licenses. |
interface |
Specifies the disk interface to use for attaching this disk, which is either
or
. For most machine types, the default is
. Local SSDs can use either NVME or SCSI. In certain configurations, persistent disks can use NVMe. For more information, see About persistent disks. |
guest |
A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. |
disk |
Encrypts or decrypts a disk using a customer-supplied encryption key. If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Note: Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. You cannot create VMs that have disks with customer-supplied keys using the bulk insert method. |
disk |
The size of the disk in GB. |
shielded |
[Output Only] shielded vm initial state stored on disk |
force |
[Input Only] Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error. |
architecture |
[Output Only] The architecture of the attached disk. Valid values are ARM64 or X86_64. |
DiskSavedState
Enums | |
---|---|
DISK_SAVED_STATE_UNSPECIFIED |
[Default] Disk state has not been preserved. |
PRESERVED |
Disk state has been preserved. |
InitializeParams
[Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance.
This field is persisted and returned for instanceTemplate and not returned in the context of instance.
This property is mutually exclusive with the
source
property; you can only define one or the other, but not both.
JSON representation |
---|
{ "diskName": string, "sourceImage": string, "diskSizeGb": string, "diskType": string, "sourceImageEncryptionKey": { object ( |
Fields | |
---|---|
disk |
Specifies the disk name. If not specified, the default is to use the name of the instance. If a disk with the same name already exists in the given region, the existing disk is attached to the new instance and the new disk is not created. |
source |
The source image to create this disk. When creating a new instance boot disk, one of
or
or
is required. To create a disk with one of the public operating system images, specify the image by its family name. For example, specify
to use the latest Debian 9 image:
Alternatively, use a specific version of a public operating system image:
To create a disk with a custom image that you created, specify the image name in the following format:
You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with
:
If the source image is deleted later, this field will not be set. |
disk |
Specifies the size of the disk in base-2 GB. The size must be at least 10 GB. If you specify a
, which is required for boot disks, the default size is the size of the
. If you do not specify a
, the default disk size is 500 GB. |
disk |
Specifies the disk type to use to create the instance. If not specified, the default is
, specified using the full URL. For example:
For a full list of acceptable values, see Persistent disk types. If you specify this field when creating a VM, you can provide either the full or partial URL. For example, the following values are valid:
. |
source |
The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. InstanceTemplate and InstancePropertiesPatch do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source images are encrypted with your own keys. |
labels |
Labels to apply to this disk. These can be later modified by the
method. This field is only applicable for persistent disks. |
source |
The source snapshot to create this disk. When creating a new instance boot disk, one of
or
or
is required. To create a disk with a snapshot that you created, specify the snapshot name in the following format:
If the source snapshot is deleted later, this field will not be set. |
source |
The customer-supplied encryption key of the source snapshot. |
description |
An optional description. Provide this property when creating the disk. |
replica |
Required for each regional disk associated with the instance. Specify the URLs of the zones where the disk should be replicated to. You must provide exactly two replica zones, and one zone must be the same as the instance zone. |
resource |
Resource policies applied to this disk for automatic snapshot creations. Specified using the full or partial URL. For instance template, specify only the resource policy name. |
on |
Specifies which action to take on instance update with this disk. Default is to use the existing disk. |
provisioned |
Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second that the disk can handle. Values must be between 10,000 and 120,000. For more details, see the Extreme persistent disk documentation. |
licenses[] |
A list of publicly visible licenses. Reserved for Google's use. |
architecture |
The architecture of the attached disk. Valid values are arm64 or x86_64. |
resource |
Resource manager tags to be bound to the disk. Tag keys and values have the same definition as resource manager tags. Keys must be in the format |
provisioned |
Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values must greater than or equal to 1. |
enable |
Whether this disk is using confidential compute mode. |
storage |
The storage pool in which the new disk is created. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
|
OnUpdateAction
LINT.IfChange(OnUpdateAction) The action to take with this disk on instance update.
Enums | |
---|---|
USE_EXISTING_DISK |
Use the existing disk, this is the default behaviour. |
RECREATE_DISK |
Always recreate the disk. |
RECREATE_DISK_IF_SOURCE_CHANGED |
Recreate the disk if source (image, snapshot) of this disk is different from source of existing disk. |