volume_attachments
Creates, updates, deletes, gets or lists a volume_attachments resource.
Overview​
| Name | volume_attachments |
| Type | Resource |
| Id | oci.compute.volume_attachments |
Fields​
The following fields are returned by SELECT queries:
- get
- list
The volume attachment was retrieved.
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the volume attachment. |
attachmentType | string | The type of volume attachment. |
availabilityDomain | string | The availability domain of an instance. Example: Uocm:PHX-AD-1 |
compartmentId | string | The OCID of the compartment. |
device | string | The device name. |
displayName | string | A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. |
instanceId | string | The OCID of the instance the volume is attached to. |
isMultipath | boolean | Whether the Iscsi or Paravirtualized attachment is multipath or not, it is not applicable to NVMe attachment. |
isPvEncryptionInTransitEnabled | boolean | Whether in-transit encryption for the data volume's paravirtualized attachment is enabled or not. |
isReadOnly | boolean | Whether the attachment was created in read-only mode. |
isShareable | boolean | Whether the attachment should be created in shareable mode. If an attachment is created in shareable mode, then other instances can attach the same volume, provided that they also create their attachments in shareable mode. Only certain volume types can be attached in shareable mode. Defaults to false if not specified. |
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. |
iscsiLoginState | string | 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. (UNKNOWN, LOGGING_IN, LOGIN_SUCCEEDED, LOGIN_FAILED, LOGGING_OUT, LOGOUT_SUCCEEDED, LOGOUT_FAILED) |
lifecycleState | string | The current state of the volume attachment. (ATTACHING, ATTACHED, DETACHING, DETACHED) |
timeCreated | 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 | string | The OCID of the volume. |
A base object for all types of attachments between a storage volume and an instance.<br />For specific details about iSCSI attachments, see<br />[IScsiVolumeAttachment Reference](#/en/iaas/latest/IScsiVolumeAttachment/).<br /><br />For general information about volume attachments, see<br />[Overview of Block Volume Storage](/iaas/Content/Block/Concepts/overview.htm).<br /><br />Warning: Oracle recommends that you avoid using any confidential information when you<br />supply string values using the API.<br />
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the volume attachment. |
attachmentType | string | The type of volume attachment. |
availabilityDomain | string | The availability domain of an instance. Example: Uocm:PHX-AD-1 |
compartmentId | string | The OCID of the compartment. |
device | string | The device name. |
displayName | string | A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. |
instanceId | string | The OCID of the instance the volume is attached to. |
isMultipath | boolean | Whether the Iscsi or Paravirtualized attachment is multipath or not, it is not applicable to NVMe attachment. |
isPvEncryptionInTransitEnabled | boolean | Whether in-transit encryption for the data volume's paravirtualized attachment is enabled or not. |
isReadOnly | boolean | Whether the attachment was created in read-only mode. |
isShareable | boolean | Whether the attachment should be created in shareable mode. If an attachment is created in shareable mode, then other instances can attach the same volume, provided that they also create their attachments in shareable mode. Only certain volume types can be attached in shareable mode. Defaults to false if not specified. |
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. |
iscsiLoginState | string | 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. (UNKNOWN, LOGGING_IN, LOGIN_SUCCEEDED, LOGIN_FAILED, LOGGING_OUT, LOGOUT_SUCCEEDED, LOGOUT_FAILED) |
lifecycleState | string | The current state of the volume attachment. (ATTACHING, ATTACHED, DETACHING, DETACHED) |
timeCreated | 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 | string | The OCID of the volume. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | volumeAttachmentId, region | Gets information about the specified volume attachment. | |
list | select | compartmentId, region | availabilityDomain, limit, page, instanceId, volumeId | Lists the volume attachments in the specified compartment. You can filter the<br />list by specifying an instance OCID, volume OCID, or both.<br /><br />Currently, the only supported volume attachment type are [IScsiVolumeAttachment](#/en/iaas/latest/IScsiVolumeAttachment/) and<br />[ParavirtualizedVolumeAttachment](#/en/iaas/latest/ParavirtualizedVolumeAttachment/).<br /> |
attach | insert | region, instanceId, volumeId, type | opc-retry-token | Attaches the specified storage volume to the specified instance.<br /> |
update | update | volumeAttachmentId, region | opc-request-id, if-match | Updates information about the specified volume attachment. |
detach | delete | volumeAttachmentId, region | if-match | Detaches a storage volume from an instance. You must specify the OCID of the volume attachment.<br /><br />This is an asynchronous operation. The attachment's lifecycleState will change to DETACHING temporarily<br />until the attachment is completely removed.<br /> |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
compartmentId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment. |
region | string | OCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION) |
volumeAttachmentId | string | The OCID of the volume attachment. |
availabilityDomain | string | The name of the availability domain. Example: Uocm:PHX-AD-1 |
if-match | string | For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value. |
instanceId | string | The OCID of the instance. |
limit | integer | For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine). Example: 50 |
opc-request-id | string | Unique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. |
opc-retry-token | string | 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). |
page | string | For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine). |
volumeId | string | The OCID of the volume. |
SELECT examples​
- get
- list
Gets information about the specified volume attachment.
SELECT
id,
attachmentType,
availabilityDomain,
compartmentId,
device,
displayName,
instanceId,
isMultipath,
isPvEncryptionInTransitEnabled,
isReadOnly,
isShareable,
isVolumeCreatedDuringLaunch,
iscsiLoginState,
lifecycleState,
timeCreated,
volumeId
FROM oci.compute.volume_attachments
WHERE volumeAttachmentId = '{{ volumeAttachmentId }}' -- required
AND region = '{{ region }}' -- required
;
Lists the volume attachments in the specified compartment. You can filter the<br />list by specifying an instance OCID, volume OCID, or both.<br /><br />Currently, the only supported volume attachment type are [IScsiVolumeAttachment](#/en/iaas/latest/IScsiVolumeAttachment/) and<br />[ParavirtualizedVolumeAttachment](#/en/iaas/latest/ParavirtualizedVolumeAttachment/).<br />
SELECT
id,
attachmentType,
availabilityDomain,
compartmentId,
device,
displayName,
instanceId,
isMultipath,
isPvEncryptionInTransitEnabled,
isReadOnly,
isShareable,
isVolumeCreatedDuringLaunch,
iscsiLoginState,
lifecycleState,
timeCreated,
volumeId
FROM oci.compute.volume_attachments
WHERE compartmentId = '{{ compartmentId }}' -- required
AND region = '{{ region }}' -- required
AND availabilityDomain = '{{ availabilityDomain }}'
AND limit = '{{ limit }}'
AND page = '{{ page }}'
AND instanceId = '{{ instanceId }}'
AND volumeId = '{{ volumeId }}'
;
INSERT examples​
- attach
- Manifest
Attaches the specified storage volume to the specified instance.<br />
INSERT INTO oci.compute.volume_attachments (
device,
displayName,
instanceId,
isReadOnly,
isShareable,
type,
volumeId,
region,
opc-retry-token
)
SELECT
'{{ device }}',
'{{ displayName }}',
'{{ instanceId }}' /* required */,
{{ isReadOnly }},
{{ isShareable }},
'{{ type }}' /* required */,
'{{ volumeId }}' /* required */,
'{{ region }}',
'{{ opc-retry-token }}'
RETURNING
id,
attachmentType,
availabilityDomain,
compartmentId,
device,
displayName,
instanceId,
isMultipath,
isPvEncryptionInTransitEnabled,
isReadOnly,
isShareable,
isVolumeCreatedDuringLaunch,
iscsiLoginState,
lifecycleState,
timeCreated,
volumeId
;
# Description fields are for documentation purposes
- name: volume_attachments
props:
- name: region
value: "{{ region }}"
description: Required parameter for the volume_attachments resource.
- name: device
value: "{{ device }}"
description: |
The device name. To retrieve a list of devices for a given instance, see [ListInstanceDevices](#/en/iaas/latest/Device/ListInstanceDevices).
- name: displayName
value: "{{ displayName }}"
description: |
A user-friendly name. Does not have to be unique, and it's changeable.
Avoid entering confidential information.
- name: instanceId
value: "{{ instanceId }}"
description: |
The OCID of the instance. For AttachVolume operation, this is a required field for the request,
see [AttachVolume](#/en/iaas/latest/VolumeAttachment/AttachVolume).
- name: isReadOnly
value: {{ isReadOnly }}
description: |
Whether the attachment was created in read-only mode.
- name: isShareable
value: {{ isShareable }}
description: |
Whether the attachment should be created in shareable mode. If an attachment
is created in shareable mode, then other instances can attach the same volume, provided
that they also create their attachments in shareable mode. Only certain volume types can
be attached in shareable mode. Defaults to false if not specified.
- name: type
value: "{{ type }}"
description: |
The type of volume. The only supported values are "iscsi" and "paravirtualized".
- name: volumeId
value: "{{ volumeId }}"
description: |
The OCID of the volume. If CreateVolumeDetails is specified, this field must be omitted from the request.
- name: opc-retry-token
value: "{{ opc-retry-token }}"
description: 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).
description: 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).
UPDATE examples​
- update
Updates information about the specified volume attachment.
UPDATE oci.compute.volume_attachments
SET
iscsiLoginState = '{{ iscsiLoginState }}'
WHERE
volumeAttachmentId = '{{ volumeAttachmentId }}' --required
AND region = '{{ region }}' --required
AND opc-request-id = '{{ opc-request-id}}'
AND if-match = '{{ if-match}}'
RETURNING
id,
attachmentType,
availabilityDomain,
compartmentId,
device,
displayName,
instanceId,
isMultipath,
isPvEncryptionInTransitEnabled,
isReadOnly,
isShareable,
isVolumeCreatedDuringLaunch,
iscsiLoginState,
lifecycleState,
timeCreated,
volumeId;
DELETE examples​
- detach
Detaches a storage volume from an instance. You must specify the OCID of the volume attachment.<br /><br />This is an asynchronous operation. The attachment's lifecycleState will change to DETACHING temporarily<br />until the attachment is completely removed.<br />
DELETE FROM oci.compute.volume_attachments
WHERE volumeAttachmentId = '{{ volumeAttachmentId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
;