Finding Out the Instance to which a Volume is Attached

In this example, let???s consider that you want to find out the name of the instance that is attached to /Compute-acme/ storage volume. To find out the name of the instance to which a given storage volume is attached:

  1. Retrieve details of storage attachment that is associated with the storage volume by sending the GET /storage/attachment/{name}?storage_volume_name={name} HTTP request.

    Sample command

    curl -X GET 
         -H "Cookie: $COMPUTE_COOKIE"
         -H "Accept: application/oracle-compute-v3+json"
    • COMPUTE_COOKIE is the name of the variable in which you stored the authentication cookie earlier. For information about retrieving the authentication cookie and storing it in a variable, see Authentication.

    • is an example REST endpoint URL. Change this value to the REST endpoint URL of your Compute Classic site. For information about finding out REST endpoint URL for your site, see Send Requests.

    • acme and are example values. Replace acme with the identity domain ID of your Compute Classic account, and with your user name.

    • /Compute-acme/ is the name of the storage volume. In this example, we are finding the name of the instance that is attached to this storage volume. Replace this with the multipart name of the storage volume in your environment.

    Sample response body

    "result": [
        "index": 1,
        "account": null,
        "storage_volume_name": "/Compute-acme/",
        "hypervisor": null,
        "uri": "",
        "instance_name": "/Compute-acme/",
        "state": "attached",
        "readonly": false,
        "name": "/Compute-acme/"
  2. In the response body, note down the value of the instance_name field. This is the name of the instance to which the /Compute-acme/ storage volume is attached.

    If the response body is {"result": []}, then the storage volume is not attached to any instance.

See Also: