Detaching a Block Volume
On Compute Cloud@Customer, when an instance no longer needs access to a volume, you can detach the volume from the instance without affecting the volume's data.
If you later reattach the detached volume, the volume might be associated with a different device name and the instance operating system might not recognize the volume.
Prerequisites
-
Perform administrative tasks to remove any dependencies that any instances have for the block volume.
For example, ensure that no applications are accessing the volume. Unmount the volume and remove it from the
/etc/fstab
file, and so on.
-
Perform administrative tasks to remove any dependencies that any instances have for the block volume.
For example, ensure that no applications are accessing the volume. Unmount the volume and remove it from the
/etc/fstab
file, and so on. -
In the Compute Cloud@Customer Console navigation menu, click Compute, then click Instances.
- At the top of the page, select the compartment that contains the instance with the volume that you want to detach.
-
Click the name of the instance that has the volume attached.
-
Under Resources, select Attached Block Volumes.
-
Next to the volume you want to detach, click the Actions menu (
), then click Detach.
-
Confirm when prompted.
-
Use the oci compute volume-attachment detach command and required parameters to detach a block volume from an instance.
oci compute volume-attachment detach --volume-attachment-id <volume-attachment_OCID> [OPTIONS]
For a complete list of CLI commands, flags, and options, see the Command Line Reference.
Use the DetachVolume operation to detach a block volume from an instance.
For information about using the API and signing requests, see REST APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface.