Attach a Volume
post
/20160918/volumeAttachments
Attach the specified storage volume to the specified instance.
Request
Supported Media Types
- application/json
Header Parameters
-
opc-is-volume-pv-encryption-in-transit-enabled: boolean
This optional parameter will overwrite the PvEIT which always be 'false' for BM ISCSI attachment.Default Value:
false
-
opc-retry-token: string
Minimum Length:
1
Maximum Length:64
A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected). -
opc-vnic-attachment-id: string
VNIC attachments for extra block storage volume in CVM hypervisor host.
-
opc-volume-external-attachment-id: string
Internal optional parameter to carry the ID of the ContainerInstance that is attached to this volume. 1. This ID will be used by BSCP as the target resource which the volume attached to. 2. This also used as external attachment ID by Blockstorage Virt as dimension (attachmentid) of customer metric.
Attach volume request
Root Schema : AttachVolumeDetails
Type:
object
Discriminator:
Show Source
type
-
createVolumeDetails:
object CreateVolumeDetails
The details of the volume to create. For the CreateVolume operation, this field is required in the request.
-
device:
string
Minimum Length:
3
Maximum Length:100
The device name. To retrieve a list of devices for a given instance, see ListInstanceDevices. -
displayName:
string
Minimum Length:
1
Maximum Length:255
A user-friendly name. Does not need to be unique, and it is changeable. Avoid entering confidential information. -
imageVolumeIndex:
integer
Minimum Value:
1
When launching from a Compute Image, it is possible for more than one volume to be defined in the Image definition. If the relative index of one of these volumes is provided in this field, then the provided createVolumeDetails descriptor will be utilized to modify the default creation/attachment parameters for this volume rather than the defaults. If this field is provided, then CreateVolumeDetails must be specified. -
instanceId:
string
Minimum Length:
1
Maximum Length:255
The OCID of the instance. For AttachVolume operation, this is a required field for the request. -
isReadOnly:
boolean
Whether the attachment was created in read-only mode.
- isShareable: boolean
-
type(required):
string
Minimum Length:
1
Maximum Length:255
The type of volume. The only supported values are "iscsi", "paravirtualized", "service_determined" and "nvme". -
volumeId:
string
Minimum Length:
1
Maximum Length:255
The OCID of the volume. If CreateVolumeDetails is specified, this field must be omitted from the request.
Nested Schema : CreateVolumeDetails
Type:
object
The details of the volume to create. For the CreateVolume operation, this field is required in the request.
Show Source
-
autotunePolicies:
array autotunePolicies
Unique Items Required:
true
The list of autotune policies to be enabled for this volume. -
availabilityDomain:
string
Minimum Length:
1
Maximum Length:255
The availability domain of the volume, which is AD-1. This parameter is not needed to clone a volume. -
backupPolicyId:
string
Minimum Length:
1
Maximum Length:255
If provided, specifies the OCID of the volume backup policy to assign to the newly created volume. If omitted, no policy will be assigned. -
blockVolumeReplicas:
array blockVolumeReplicas
Maximum Number of Items:
1
Unique Items Required:true
The list of block volume replicas to be enabled for this volume in the specified destination availability domains. -
buildingHint:
string
Minimum Length:
1
Maximum Length:255
The buildingHint for volume creation. This is an internal parameter passed by compute for best effort collocation. -
clusterPlacementGroupId:
string
Minimum Length:
1
Maximum Length:255
The clusterPlacementGroup ID of the volume for volume placement. -
compartmentId(required):
string
Minimum Length:
1
Maximum Length:255
The OCID of the compartment that contains the volume. -
definedTags:
object definedTags
Additional Properties Allowed: additionalPropertiesDefined tags for this resource. Each key is predefined and scoped to a namespace.
-
displayName:
string
Minimum Length:
1
Maximum Length:255
A user-friendly name. Does not need to be unique, and it is changeable. Avoid entering confidential information. -
freeformTags:
object freeformTags
Additional Properties Allowed: additionalProperties. Each tag is a simple key-value pair with no predefined name, type, or namespace. The volume block size can be set by using the PCA_blocksize free-form tag. The default block size is 8192 bytes. To specify a different block size, specify a value in bytes for the PCA_blocksize tag. Supported values are a power of 2 between 512 bytes and 1 megabyte. The block size cannot be modified once the volume has been created.
-
instanceId:
string
Minimum Length:
1
Maximum Length:255
The identifier of the instance that the volume will be associated with. -
ioAlignmentSizeInBytes:
integer(int32)
Minimum Value:
512
Maximum Value:32768
Multiple Of:512
The size (in Bytes) of the blocks for this block volume, between 512B to 32KB. Allowed values: * `512` : 512 Bytes * `1024` : 1 KB * `2048` : 2 KB * `4096` : 4 KB * `8192` : 8 KB * `16384`: 16 KB * `32768`: 32 KB -
isAutoTuneEnabled:
boolean
Specifies whether the auto-tune performance is enabled for this volume. This field is deprecated. Use the DetachedVolumeAutotunePolicy instead to enable the volume for detached autotune.
-
kmsKeyId:
string
Minimum Length:
1
Maximum Length:255
The OCID of the Key Management key to assign as the master encryption key for the volume. -
meteringMode:
string
Indicates whether the volume is to be billed with provisioned metering or pay-per-usage metering. The default behavior is to use provisioned metering.
-
siteGroupId:
string
Minimum Length:
1
Maximum Length:255
The siteGroup ID of the volume. This is an internal parameter. If clusterPlacementGroup is specified by external customer this field will be ignored. -
sizeInGBs:
integer(int64)
The size of the volume in GBs.
-
sizeInMBs:
integer(int64)
The size of the volume in MBs. The value must be a multiple of 1024. This field is deprecated. Use sizeInGBs instead.
-
sourceDetails:
object VolumeSourceDetails
Discriminator:
type
Specifies the volume source details for a new Block volume. The volume source is either another Block volume in the same Availability Domain or a Block volume backup or a disk image in Object Storage. This is an optional field. If not specified or set to null, the new Block volume will be empty. When specified, the new Block volume will contain data from the source volume or backup. -
volumeBackupId:
string
Minimum Length:
1
Maximum Length:255
The OCID of the volume backup from which the data should be restored on the newly created volume. This field is deprecated. Use the sourceDetails field instead to specify the backup for the volume. -
volumeScope:
string
This is an optional field. This value indicates whether the volume is AD-local or Regional. Oracle Private Cloud Appliance has one region, named pca_name.domain (for example, mypca.example.com), and one availability domain, named AD-1.
-
volumeType:
string
The flag indicating the given source volumes will be used for producing a thin clone or full clone.
-
vpusPerGB:
integer(int64)
The number of volume performance units (VPUs) that will be applied to this volume per GB, representing the Block Volume service's elastic performance options. Allowed values: 10 - Balanced option, 20 - Higher Performance option. For performance autotune enabled volumes, it would be the Default(Minimum) VPUs/GB.
-
xrcKmsKeyId:
string
Minimum Length:
1
Maximum Length:255
The OCID of the Vault service key, which is the master encryption key for the block volume cross region backups, which will be used in the destination region to encrypt the backup's encryption keys.
Nested Schema : autotunePolicies
Type:
array
Unique Items Required:
true
The list of autotune policies to be enabled for this volume.
Show Source
-
Array of:
object AutotunePolicy
Discriminator:
autotuneType
An autotune policy automatically tunes the volume's performace based on the type of the policy.
Nested Schema : blockVolumeReplicas
Type:
array
Maximum Number of Items:
1
Unique Items Required:
true
The list of block volume replicas to be enabled for this volume in the specified destination availability domains.
Show Source
-
Array of:
object BlockVolumeReplicaDetails
Contains the details for the block volume replica
Nested Schema : definedTags
Type:
object
Additional Properties Allowed
Show Source
-
object additionalProperties
Additional Properties Allowed: additionalPropertiesKey-value pair representing a defined tag key and value, scoped to a namespace. Example: `{"CostCenter": "42"}`
Defined tags for this resource. Each key is predefined and scoped to a namespace.
Nested Schema : freeformTags
Type:
object
Additional Properties Allowed
Show Source
. Each tag is a simple key-value pair with no predefined name, type, or namespace. The volume block size can be set by using the PCA_blocksize free-form tag. The default block size is 8192 bytes. To specify a different block size, specify a value in bytes for the PCA_blocksize tag. Supported values are a power of 2 between 512 bytes and 1 megabyte. The block size cannot be modified once the volume has been created.
Nested Schema : VolumeSourceDetails
Type:
object
Discriminator:
type
Specifies the volume source details for a new Block volume. The volume source is either another Block volume in the same Availability Domain or a Block volume backup or a disk image in Object Storage. This is an optional field. If not specified or set to null, the new Block volume will be empty. When specified, the new Block volume will contain data from the source volume or backup.
Show Source
Nested Schema : AutotunePolicy
Type:
object
Discriminator:
autotuneType
An autotune policy automatically tunes the volume's performace based on the type of the policy.
Show Source
-
autotuneType(required):
string
Allowed Values:
[ "DETACHED_VOLUME", "PERFORMANCE_BASED" ]
This specifies the type of autotunes supported by OCI.
Nested Schema : BlockVolumeReplicaDetails
Type:
object
Contains the details for the block volume replica
Show Source
-
availabilityDomain(required):
string
Minimum Length:
1
Maximum Length:255
The availability domain of the block volume replica. Example: AD-1 -
displayName:
string
Minimum Length:
1
Maximum Length:255
A user-friendly name. Does not need to be unique, and it is changeable. Avoid entering confidential information. -
xrrKmsKeyId:
string
Minimum Length:
1
Maximum Length:255
The OCID of the Vault service key which is the master encryption key for the cross region block volume replicas, which will be used in the destination region to encrypt the block volume replica's encryption keys.
Nested Schema : additionalProperties
Type:
object
Additional Properties Allowed
Show Source
-
object additionalProperties
The value of the tag. Only the String type is supported.
Key-value pair representing a defined tag key and value, scoped to a namespace. Example: `{"CostCenter": "42"}`
Nested Schema : additionalProperties
Type:
object
The value of the tag. Only the String type is supported.
Response
Supported Media Types
- application/json
200 Response
The volume is being attached.
Headers
-
etag: string
For optimistic concurrency control. See `if-match`.
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : VolumeAttachment
Type:
object
Discriminator:
attachmentType
A base object for all types of attachments between a storage volume and an instance. For specific details about iSCSI attachments, see IScsiVolumeAttachment. Avoid using confidential information when you supply string values using the API.
Show Source
-
attachmentType(required):
string
Minimum Length:
1
Maximum Length:255
The type of volume attachment. -
availabilityDomain(required):
string
Minimum Length:
1
Maximum Length:255
The availability domain of an instance. Example: AD-1 -
compartmentId(required):
string
Minimum Length:
1
Maximum Length:255
The OCID of the compartment. -
device:
string
Minimum Length:
3
Maximum Length:100
The device name. -
displayName:
string
Minimum Length:
1
Maximum Length:255
A user-friendly name. Does not need to be unique, and it is changeable. Avoid entering confidential information. -
id(required):
string
Minimum Length:
1
Maximum Length:255
The OCID of the volume attachment. -
instanceId(required):
string
Minimum Length:
1
Maximum Length:255
The OCID of the instance the volume is attached to. -
iscsiLoginState:
string
Allowed Values:
[ "UNKNOWN", "LOGGING_IN", "LOGIN_SUCCEEDED", "LOGIN_FAILED", "LOGGING_OUT", "LOGOUT_SUCCEEDED", "LOGOUT_FAILED" ]
The iscsi login state of the volume attachment. For a Iscsi volume attachment, all iscsi sessions need to be all logged-in or logged-out to be in logged-in or logged-out state. -
isEncryptionInTransitEnabled:
boolean
Whether in-transit encryption for the data volume's attachment is enabled or not.
-
isMultipath:
boolean
Whether the Iscsi or Paravirtualized attachment is multipath or not, it is not applicable to NVMe attachment.
-
isPvEncryptionInTransitEnabled:
boolean
Deprecated. Use isEncryptionInTransitEnabled instead.
-
isReadOnly:
boolean
Whether the attachment was created in read-only mode.
- isShareable: boolean
-
isVolumeCreatedDuringLaunch:
boolean
Flag indicating if this volume was created for the customer as part of a simplified launch. Used to determine whether the volume requires deletion on instance termination.
-
lifecycleState(required):
string
Allowed Values:
[ "ATTACHING", "ATTACHED", "DETACHING", "DETACHED" ]
The current state of the volume attachment. -
timeCreated(required):
string(date-time)
The date and time the volume was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2016-08-25T21:10:29.600Z
-
volumeId(required):
string
Minimum Length:
1
Maximum Length:255
The OCID of the volume.
400 Response
Bad Request
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.
401 Response
Unauthorized
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.
404 Response
Not Found
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.
409 Response
Conflict
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.
500 Response
Internal Server Error
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.
Default Response
An error has occurred.
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.