After the preparation of the environment for the connection (here), you can create scripts using command line to manage Compute Service

List of Shape

# oracle-compute list shape
uri name cpus ram gpus io nds_iops_limit root_disk_size placement_requirements
------------------------------------------------------ ---- ---- ------ ---- ---- -------
https://api-z18.compute.em3.oraclecloud.com/shape/oc4m oc4m 16.0 122880 0 800 0 0
https://api-z18.compute.em3.oraclecloud.com/shape/oc7 oc7 32.0 122880 0 1000 0 0
https://api-z18.compute.em3.oraclecloud.com/shape/oc3m oc3m 8.0 61440 0 600 0 0
https://api-z18.compute.em3.oraclecloud.com/shape/oc5m oc5m 32.0 245760 0 1000 0 0
https://api-z18.compute.em3.oraclecloud.com/shape/oc3 oc3 2.0 7680 0 200 0 0
https://api-z18.compute.em3.oraclecloud.com/shape/oc5 oc5 8.0 30720 0 600 0 0
https://api-z18.compute.em3.oraclecloud.com/shape/oc4 oc4 4.0 15360 0 400 0 0
https://api-z18.compute.em3.oraclecloud.com/shape/oc1m oc1m 2.0 15360 0 200 0 0
https://api-z18.compute.em3.oraclecloud.com/shape/oc2m oc2m 4.0 30720 0 400 0 0
https://api-z18.compute.em3.oraclecloud.com/shape/oc6 oc6 16.0 61440 0 800 0 0

List of Instances

# oracle-compute list instance /Compute-smeretech/[email protected] -Fname
----------------------------------------------------------------------------------------------------
/Compute-smeretech/[email protected]/OL_6_7/2bec2546-d95a-438a-bc45-ac73cc03d4c7

List of Volumes

# oracle-compute list storagevolume /Compute-smeretech/[email protected] -F name,size
name size
----------------------------------------------------------------------- -----------
/Compute-smmereghetti/[email protected]/OL_6_7_storage 22548578304

Information about a Volume

# oracle-compute get storagevolume /Compute-smeretech/[email protected]/OL_6_7_storage -f json
{
 "list": [
  {
   "managed": true,
   "status_timestamp": "2016-11-30T10:58:12Z",
   "snapshot_account": null,
   "machineimage_name": "/oracle/public/OL_6.7_UEKR3_x86_64-16.3.6-20160906-203710",
   "snapshot_id": null,
   "imagelist": "/oracle/public/OL_6.7_UEKR3_x86_64",
   "writecache": false,
   "size": "22548578304",
   "platform": "linux",
   "storage_pool": "/compute-em3-z999/sleis01nas42-v1/storagepool/iscsi",
   "shared": false,
   "status": "Online",
   "description": "",
   "tags": [],
   "quota": null,
   "status_detail": null,
   "properties": [
    "/oracle/public/storage/default"
   ],
   "account": "/Compute-smeretech/default",
   "name": "/Compute-smeretech/[email protected]/OL_6_7_storage",
   "bootable": true,
   "hypervisor": null,
   "uri": "https://api-z999.compute.em3.oraclecloud.com/storage/volume/Compute-smeretech/user%40example.com/OL_6_7_storage",
   "imagelist_entry": 1,
   "snapshot": null
  }
 ]
}

Update Volume Size

Update volume size from 20GB to 30GB

# oracle-compute update storagevolume /Compute-smeretech/[email protected]/OL_6_7_storage \
30G /oracle/public/storage/default --description 'Updated Accounting Department Block Storage' --tags 'Accounting Dept.' -fjson
{
 "list": [
  {
   "managed": true,
   "status_timestamp": "2016-11-30T15:46:21Z",
   "snapshot_account": null,
   "machineimage_name": "/oracle/public/OL_6.7_UEKR3_x86_64-16.3.6-20160906-203710",
   "snapshot_id": null,
   "imagelist": "/oracle/public/OL_6.7_UEKR3_x86_64",
   "writecache": false,
   "size": "32212254720",
   "platform": "linux",
   "storage_pool": "/compute-em3-z999/sleis01nas42-v1/storagepool/iscsi",
   "shared": false,
   "status": "Updating",
   "description": "Updated Accounting Department Block Storage",
   "tags": [
    "Accounting Dept."
   ],
   "quota": null,
   "status_detail": "The storage volume is currently being updated.",
   "properties": [
    "/oracle/public/storage/default"
   ],
   "account": "/Compute-smeretech/default",
   "name": "/Compute-smeretech/[email protected]/OL_6_7_storage",
   "bootable": true,
   "hypervisor": null,
   "uri": "https://api-z999.compute.em3.oraclecloud.com/storage/volume/Compute-smeretech/user%40example.com/OL_6_7_storage",
   "imagelist_entry": 1,
   "snapshot": null
  }
 ]
}

Add a new Volume

# oracle-compute add storagevolume /Compute-smeretech/[email protected]/OL_6_7_data 10G \
/oracle/public/storage/default --description 'Add Block Storage' --tags 'Accounting Dept.' -fjson
{
 "list": [
  {
   "managed": true,
   "status_timestamp": "2016-11-30T15:50:55Z",
   "snapshot_account": null,
   "machineimage_name": null,
   "snapshot_id": null,
   "imagelist": null,
   "writecache": false,
   "size": "10737418240",
   "platform": null,
   "storage_pool": null,
   "shared": false,
   "status": "Initializing",
   "description": "Add Block Storage",
   "tags": [
    "Accounting Dept."
   ],
   "quota": null,
   "status_detail": "The storage volume is currently being initialized.",
   "properties": [
    "/oracle/public/storage/default"
   ],
   "account": "/Compute-smeretech/default",
   "name": "/Compute-smeretech/[email protected]/OL_6_7_data",
   "bootable": false,
   "hypervisor": null,
   "uri": "https://api-z999.compute.em3.oraclecloud.com/storage/volume/Compute-smeretech/user%40example.com/OL_6_7_data",
   "imagelist_entry": -1,
   "snapshot": null
  }
 ]
}

Snapshots

You can create a snapshot of a storage volume either when it is attached to an instance or after detaching it. If the storage volume is attached to an instance, then only data that has already been written to the storage volume will be captured in the snapshot. Data that is cached by the application or the operating system will be excluded from the snapshot. To create a snapshot of a bootable storage volume that is currently being used by an instance, you should delete the instance before you create the snapshot, to ensure the consistency of data. You can create the instance again later on, after the snapshot is created.

Remote Storage Snapshots

Remote snapshots aren’t stored in the same location as the original storage volume. Instead, they are stored in the associated Oracle Storage Cloud Service instance. However, creating a remote snapshot and restoring a storage volume from a remote snapshot can take quite a long time depending on the size of the storage volume, as data is written to and from the Oracle Storage Cloud Service instance.

Colocate Snapshots

Colocated snapshots are stored in the same physical location as the original storage volume and each snapshot uses the same amount of storage as the original volume. As compared to the time taken to create a remote snapshot, colocated snapshots are created relatively quickly. Colocated snapshots are useful for quickly cloning storage volumes within a site.

Create a Remote Storage Snapshot

# oracle-compute add storagesnapshot /Compute-smeretech/[email protected]/vol1 --description 'Remote snapshot of vol1' -f json

Create a Colocated Storage Snapshot

# oracle-compute add storagesnapshot /Compute-smeretech/[email protected]/vol1 --description 'Colocated snapshot of vol1' --property /oracle/private/storage/snapshot/collocated  -fjson

List of Snapshots

# oracle-compute list storagesnapshot /Compute-smeretech/[email protected] \
--since 2016-10-01T07:04:52Z --until 2016-11-30T17:00:52Z -fjson
{
 "list": [
  {
   "status": "completed",
   "start_timestamp": "2016-11-30T14:48:38Z",
   "name": "/Compute-smeretech/[email protected]/OL_6_7_storage/74f0aca36db6dde59db06e36fbb7a39181ecaa8463b1394291d5df8a9b3ae75e",
   "tags": [],
   "description": "Remote snapshot of vol1",
   "snapshot_timestamp": "2016-11-30T14:48:39Z",
   "account": "/Compute-smeretech/cloud_storage",
   "uri": "https://api-z999.compute.em3.oraclecloud.com/storage/snapshot/Compute-smeretech/user%40example.com/OL_6_7_storage/74f0aca36db6dde59db06e36fbb7a39181ecaa8463b1394291d5df8a9b3ae75e",
   "volume": "/Compute-smeretech/[email protected]/OL_6_7_storage",
   "platform": "linux",
   "machineimage_name": "/oracle/public/OL_6.7_UEKR3_x86_64-16.3.6-20160906-203710",
   "snapshot_id": "74f0aca36db6dde59db06e36fbb7a39181ecaa8463b1394291d5df8a9b3ae75e",
   "status_detail": "",
   "property": "/oracle/public/storage/snapshot/default",
   "status_timestamp": "2016-11-30T14:52:01Z",
   "size": "22548578304"
  },
  {
   "status": "completed",
   "start_timestamp": "2016-11-30T14:50:36Z",
   "name": "/Compute-smeretech/[email protected]/OL_6_7_storage/ef5282776a6a0a95dc1ee8d76399a49533bdffb1fd4d0895b00fd8f22005e1d2",
   "tags": [],
   "description": "Colocated snapshot of vol1",
   "snapshot_timestamp": "2016-11-30T14:50:38Z",
   "account": null,
   "uri": "https://api-z999.compute.em3.oraclecloud.com/storage/snapshot/Compute-smeretech/user%40example.com/OL_6_7_storage/ef5282776a6a0a95dc1ee8d76399a49533bdffb1fd4d0895b00fd8f22005e1d2",
   "volume": "/Compute-smeretech/[email protected]/OL_6_7_storage",
   "platform": "linux",
   "machineimage_name": "/oracle/public/OL_6.7_UEKR3_x86_64-16.3.6-20160906-203710",
   "snapshot_id": "ef5282776a6a0a95dc1ee8d76399a49533bdffb1fd4d0895b00fd8f22005e1d2",
   "status_detail": null,
   "property": "/oracle/private/storage/snapshot/collocated",
   "status_timestamp": "2016-11-30T14:50:38Z",
   "size": "22548578304"
  }
 ]
}
# oracle-compute discover storagesnapshot /Compute-smeretech/[email protected]
entry
------------------------------------------------------------------------
/Compute-smeretech/[email protected]/OL_6_7_storage/
# oracle-compute discover storagesnapshot /Compute-smeretech/[email protected]/OL_6_7_storage
entry
----------------------------------------------------------------------------------------------------------------------------------------
/Compute-smeretech/[email protected]/OL_6_7_storage/74f0aca36db6dde59db06e36fbb7a39181ecaa8463b1394291d5df8a9b3ae75e
/Compute-smeretech/[email protected]/OL_6_7_storage/ef5282776a6a0a95dc1ee8d76399a49533bdffb1fd4d0895b00fd8f22005e1d2