The cloud is more than a portal: oracle-dbcs-cli
A common misconception is that “The Cloud” is only accessible through the portal which is provided to you. In this post I will show that Oracle has some utilities ready for you to manage the cloud using the command line (cli). One way to do it, and which is very useful when you only use one-time commands, is Curl. The REST API is well documented with curl examples as well.
This time we will focus on oracle-dbcs-cli utility and the oracle traditional cloud.
The start of your journey to the Cloud Line interface is as always the oracle documentation. It’s self-explanatory. Yes good documentation exists! The utility itself can be downloaded here: https://www.oracle.com/technetwork/database/database-cloud/public/downloads/index.html After that it’s just as simple as unpacking the zipfile and running the utility. Simple isn’t it? The documentation says
“You must download it to your Linux computer and install it“.
Well, I use a Mac and I can confirm it works on mac too. What it does is just calling a java jar file (the orchestrator) and tell it what to do. Which basically comes down to a rest-call being performed. I won’t copy paste all the possibilities of this utility, it can be found here: https://docs.oracle.com/en/cloud/paas/database-dbaas-cloud/csdbi/run-oracle-dbcs-cli.html But there are some things I find remarkable.
To run the utility, a template/dat/configfile is required. There is a sample file bundled with the download which you can adapt to your needs and also that is documented here: https://docs.oracle.com/en/cloud/paas/database-dbaas-cloud/csdbi/oracle-dbcs-cli-create-data-file.html
So, no need to blog you would think? Well, there are a few things to mention.
sm_url
I am located in EMEA and we have a subscription to an EMEA based datacenter. When you copy paste the sm_url from the oracle documentation it will not work. I summarise it like this:
North America: https://dbaas.oraclecloud.com/paas/service/dbcs/api/v1.1/instances
EMEA: http://dbcs.emea.oraclecloud.com/paas/service/dbcs/api/v1.1/instances
The first part of the file looks like this then.
1 2 3 4 5 6 7 8 9 10 11 |
#------------------------------------------------------------------------------- # Specify the SM related info #------------------------------------------------------------------------------- # for emea sm_url=https://dbcs.emea.oraclecloud.com/paas/service/dbcs/api/v1.1/instances # for USA #sm_url=https://dbaas.oraclecloud.com/paas/service/dbcs/api/v1.1/instances identity_domain=<enter your traditional cloud identity domain> user_name=<enter your username> password=<enter your password> subscriptionType=monthly |
vm size
I left most of the config default and started with a config as basic as possible. I will highlight the problematic rules only here.
In the template there is for storage requirements this line:
1 |
# db_vols=(bits:30gb data:25gb fra:10gb redo:10gb) |
It’s best to crosscheck to the documentation again because apparently it has changed over time. A small adaption gives the following line which is actually usable:
1 |
db_vols=(bits:60gb data:15gb fra:26gb redo:25gb) |
What is very interesting in the document: “25 GB volume completely allocated to /u04
on the virtual machine. (If the data volume is 25 GB, then the redo volume is allocated 26 DB instead.)”. Definitely something to take into account.
The bad thing about this is, that the message in the activity log from the portal is not showing exactly what’s wrong:
1 2 3 4 5 6 7 |
Dec 30, 2017 3:38:48 PM UTC Activity Submitted Dec 30, 2017 3:38:48 PM UTC Activity Started Dec 30, 2017 3:38:57 PM UTC Failed to create Compute resources for Database Server...[java.lang.Exception: Internal Error: Expected one orchestration from dborch but got 0 ] Dec 30, 2017 3:38:57 PM UTC Initiating Database Service Termination... Dec 30, 2017 3:38:57 PM UTC Skipping delete backups for Database Service instance [vanpupivm] since the request parameter for delete backups is not set. Dec 30, 2017 3:39:09 PM UTC Stopped all Compute resources... Dec 30, 2017 3:39:11 PM UTC Removed Compute resources... |
When you look this error up you hit this bug: Bug 26254417 – CREATE DBAAS INSTANCE FAILS WITH EXPECTED ONE ORCHESTRATION FROM DBORCH BUT GOT 0.
The thing is … that bug refers to the password but the password used was a strong one, so this one could not be applicable. When digging further, it turned out that also not specifying the correct size of the volumes gave this error.
Another thing worth mentioning is the size of the vm boot volume as documented in the documentation.
When using it this way, you will end up with an error telling you that the boot volume is too small.
Oracle versions
In my opinion, Oracle 12.2 is the way to go. So whilst preparing the configfile, you must specify the version. Unfortunately the oracle-dbcs-cli does not offer you that choice. You have to stick with 12.1.0.2 (default in the template) or 11.2.0.4.
1 |
db_version=12102 |
When you try to specify the newer version:
1 2 3 4 5 6 7 8 |
mbp-vanpupi:dbcs-cli pieter$ ./oracle-dbcs-cli create -dat demo.dat.tmpl Database Cloud Orchestration Tool:Release 2.0.289.15.52 on Wed Jan 10 17:22:08 CET 2018 Copyright ©2014,2015, Oracle. All rights reserved. Creating VM Invalid parameter Error: db_version: 12201 is not valid. Valid values are: 11204 and 12101. DBOrch execution ended. mbp-vanpupi:dbcs-cli pieter$ |
This means you really have to stick with these versions. In my next blog-post about the psm utility you will see that you can specify a json-file as the payload in the rest call and that one does support 12.2.
Glassfish
For the project I am preparing I wanted to see if we can use the VM which comes with DBaas also as a web server. Then I saw in the configfile that you could also specify glassfish. Well … guess twice …
1 2 3 4 5 6 7 8 |
Jan 10, 2018 12:49:31 PM UTC Activity Submitted Jan 10, 2018 12:49:32 PM UTC Activity Started Jan 10, 2018 12:49:37 PM UTC Failed to create Compute resources for Database Server...[java.lang.Exception: Internal Error: Expected one orchestration from dborch but got 0 ] Jan 10, 2018 12:49:38 PM UTC Initiating Database Service Termination... Jan 10, 2018 12:49:38 PM UTC Skipping delete backups for Database Service instance [logctl] since the request parameter for delete backups is not set. Jan 10, 2018 12:49:50 PM UTC Stopped all Compute resources... Jan 10, 2018 12:49:52 PM UTC Removed Compute resources... Jan 10, 2018 12:49:52 PM UTC Database Service record removal complete... |
So … no glassfish available. The reason is actually simple. Glassfish was used for Apex. This has been changed with the standalone ORDS which is available out of the box and does the job nicely.
Summary
In short, the oracle-dbcs-cli is a usable tool to interact with your traditional Oracle cloud account. It has some limitations, but when you create a nice standard, it can be perfectly usable.
As always, questions, remarks? find me on twitter @vanpupi