Wednesday, June 29, 2016

Creating an Oracle Storage Cloud Service

Creating an Oracle Storage Cloud Service is necessary if you want to enable cloud backup on your Oracle Database Cloud Service instance.

Creating an Oracle Database Cloud Service instance with cloud backup is required if you decide to create an Oracle SOA Cloud Service instance.

Thus, creating an Oracle Storage Cloud Service is relatively important. Unfortunately, there is no front-end GUI that allows you to do this. This blog post describes how to do it.


Login to Unix Server

1. Log in to a linux server.

2. Ensure that you have curl available on this server, as you will use it to invoke a REST web service.


Request an Authentication Token

3. The format of the curl command is as follows:

curl -v -s -X GET -H "X-Storage-User: Storage-<Identity Domain>:<Oracle Account>" -H "X-Storage-Pass: <Oracle Account Password>" https://<Identity Domain>.storage.oraclecloud.com/auth/v1.0

4. For example:

root@demo:/root> curl -v -s -X GET -H "X-Storage-User: Storage-ahmeddomain:ahmed@raastech.com" -H "X-Storage-Pass: mypassword" https://ahmeddomain.storage.oraclecloud.com/auth/v1.0

5. The output will look like this. Note the values highlighted in yellow. You will use this authentication token in subsequent requests.

* About to connect() to ahmeddomain.storage.oraclecloud.com port 443 (#0)
*   Trying 192.152.172.2... connected
* Connected to ahmeddomain.storage.oraclecloud.com (192.152.172.2) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLS_RSA_WITH_AES_128_CBC_SHA
* Server certificate:
*       subject: CN=*.storage.oraclecloud.com,O=Oracle Corporation,L=Redwood Shores,ST=California,C=US
*       start date: Aug 07 00:00:00 2015 GMT
*       expire date: Oct 05 23:59:59 2016 GMT
*       common name: *.storage.oraclecloud.com
*       issuer: CN=VeriSign Class 3 Secure Server CA - G3,OU=Terms of use at https://www.verisign.com/rpa (c)10,OU=VeriSign Trust Network,O="VeriSign, Inc.",C=US
> GET /auth/v1.0 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: ahmeddomain.storage.oraclecloud.com
> Accept: */*
> X-Storage-User: Storage-ahmeddomain:ahmed@raastech.com
> X-Storage-Pass: mypassword
>
< HTTP/1.1 200 OK
< date: 1466885484548
< X-Auth-Token: AUTH_tk2d476138c79fba6ac4cb559b3b9e
< X-Storage-Token: AUTH_tk2d476138c79fba6ac4cb559b3b9e
< X-Storage-Url: https://storage.us2.oraclecloud.com/v1/Storage-ahmeddomain
< Content-Length: 0
< Server: Oracle-Storage-Cloud-Service
<
* Connection #0 to host ahmeddomain.storage.oraclecloud.com left intact
* Closing connection #0


Create a Cloud Storage Instance

6. The format of the curl command is as follows:

curl -v -s -X PUT -H "X-Auth-Token: <Authorization Token>" https://storage.us2.oraclecloud.com/v1/Storage-<Identity Domain>/<New Container Name>

7. For example:

root@demo:/root> curl -v -s -X PUT -H "X-Auth-Token: AUTH_tk2d476138c79fba6ac4cb559b3b9e" https://storage.us2.oraclecloud.com/v1/Storage-ahmeddomain/MyContainer1

8. The output will look like this. Note the values highlighted in yellow to confirm creation.

* About to connect() to storage.us2.oraclecloud.com port 443 (#0)
*   Trying 192.152.172.4... connected
* Connected to storage.us2.oraclecloud.com (192.152.172.4) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLS_RSA_WITH_AES_128_CBC_SHA
* Server certificate:
*       subject: CN=*.us2.oraclecloud.com,O=Oracle Corporation,L=Redwood Shores,ST=California,C=US
*       start date: Dec 08 00:00:00 2015 GMT
*       expire date: Jan 06 23:59:59 2017 GMT
*       common name: *.us2.oraclecloud.com
*       issuer: CN=Symantec Class 3 Secure Server CA - G4,OU=Symantec Trust Network,O=Symantec Corporation,C=US
> PUT /v1/Storage-ahmeddomain/MyContainer1 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: storage.us2.oraclecloud.com
> Accept: */*
> X-Auth-Token: AUTH_tk2d476138c79fba6ac4cb559b3b9e
>
< HTTP/1.1 201 Created
< X-Trans-Id: tx181d451d2f8048e281b86-00576ee5
< Date: Sat, 25 Jun 2016 20:13:26 GMT
< Connection: keep-alive
< X-Last-Modified-Timestamp: 1466885606.10161
< Content-Type: text/html;charset=UTF-8
< Content-Length: 0
< Server: Oracle-Storage-Cloud-Service
<
* Connection #0 to host storage.us2.oraclecloud.com left intact
* Closing connection #0


Verify Creation of Cloud Storage Instance

9. The format of the curl command is as follows:

curl -v -s -X GET -H "X-Auth-Token: <Authorization Token>" https://storage.us2.oraclecloud.com/v1/Storage-<Identity Domain>/<Container Name>

10. For example:

root@demo:/root> curl -v -s -X GET -H "X-Auth-Token: AUTH_tk2d476138c79fba6ac4cb559b3b9e" https://storage.us2.oraclecloud.com/v1/Storage-ahmeddomain/MyContainer1

11. The output will look like this. Note the values highlighted in yellow to verify instance.

* About to connect() to storage.us2.oraclecloud.com port 443 (#0)
*   Trying 192.152.172.3... connected
* Connected to storage.us2.oraclecloud.com (192.152.172.3) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLS_RSA_WITH_AES_128_CBC_SHA
* Server certificate:
*       subject: CN=*.us2.oraclecloud.com,O=Oracle Corporation,L=Redwood Shores,ST=California,C=US
*       start date: Dec 08 00:00:00 2015 GMT
*       expire date: Jan 06 23:59:59 2017 GMT
*       common name: *.us2.oraclecloud.com
*       issuer: CN=Symantec Class 3 Secure Server CA - G4,OU=Symantec Trust Network,O=Symantec Corporation,C=US
> GET /v1/Storage-ahmeddomain/MyContainer1 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: storage.us2.oraclecloud.com
> Accept: */*
> X-Auth-Token: AUTH_tk2d476138c79fba6ac4cb559b3b9e2406
>
< HTTP/1.1 204 No Content
< X-Container-Object-Count: 0
< X-Container-Write: ahmeddomain.Storage.Storage_ReadWriteGroup
< Accept-Ranges: bytes
< X-Timestamp: 1466885606.14093
< X-Container-Read: ahmeddomain.Storage.Storage_ReadOnlyGroup,ahmeddomain.Storage.Storage_ReadWriteGroup
< X-Container-Bytes-Used: 0
< X-Trans-Id: tx6519d2b91911413885376-00576ee61aga
< Date: Sat, 25 Jun 2016 20:14:18 GMT
< Connection: keep-alive
< X-Storage-Class: Standard
< X-Container-Meta-Policy-Georeplication: us2-us6
< X-Last-Modified-Timestamp: 1466885606.10161
< Content-Type: text/html;charset=UTF-8
< Server: Oracle-Storage-Cloud-Service
<
* Connection #0 to host storage.us2.oraclecloud.com left intact
* Closing connection #0


Configure Backup and Recovery Options

Keep in mind that the name of an your Oracle Storage Cloud Service container takes the form <Storage Service Name>-<Identity Domain>/<Container Name>

For example...

Cloud Storage Container: Storage-ahmeddomain/MyContainer1
Cloud Storage User Name: ahmed@raastech.com (your Oracle Account username)
Cloud Storage Password: mypassword (your Oracle Account password)



Applicable Versions:
  • Oracle Storage Cloud Service (2016)


References:



No comments: