When you attach a storage volume to an instance, the volume remains attached until the instance or storage attachment is deleted.
Use the following command to attach a storage volume to an instance:
oracle-compute add storageattachment instance_name storage_volume_name index
The index
value must be between 1 and 10.
For more information, see CLI Reference for Oracle Compute Cloud Service.
To attach a storage volume to an instance using the API, use the POST https://api.oc.example.com/storage/attachment
method.
For more information, see REST API Reference for Oracle Compute Cloud Service.
If you are attaching a storage volume to an instance on an 17.1.2 system, perform the following best practices:
oracle-compute get instance <instance-name> -fjson
. The customer can use this saved copy to look up the hot plugged storage attachments and reattach them in case they get detached, such as in the event of a power outage. If a power outage already happened, the hot plug information can't be retrieved using the command.