Tuesday, May 10, 2016

#501 IaaS --> Cloning Instances via Snapshots

According to the docs -

Instance snapshots provide an easy way to create a customized machine image using an existing instance as a template. You can then use this customized machine image to create multiple instances with identical configurations.

So how does this look in the UI?

Here I am looking at my JCS instance, from a previous blog post.

















I click Create Snapshot.
I give it a name -




















Now, I get an error -



This is because NDS (Nimbula Disk Service) is currently not supported.
We currently only support local boot disks (ephemeral).

So let's take another example - Here is another instance creation -






















I now create the snapshot -





















I can see this snapshot, when I view the instance -










Now, I can create an image based on this -
















Now, I create the clone - based on this newly associated image














































Friday, May 6, 2016

#500 JCS First Steps...

Introduction

JCS is available now on shop.oracle.com.

As you can see, it includes IaaS and DB CS.










Install Steps


Install of JCS requires an instance of DB CS.
Storage is also required for DB CS and JCS.

Create Storage


Get X-Auth-Token and X-Storage-Url via REST

curl -v -s -X GET -H "X-Storage-User: Storage- yourIdentityDomain:yourUser" -H "X-Storage-Pass: yourPwd" https://yourIdentityDomain.storage.oraclecloud.com/auth/v1.0
Create DB & JCS Storage containers using the X-Storage-Url and X-Auth-Token

curl -v -s -X PUT -H "X-Auth-Token: X-Auth-Token" https://X-Storage-URL/myDBContainer


curl -v -s -X PUT -H "X-Auth-Token: X-Auth-Token" https://X-Storage-URL/myJCSContainer

Create DB CS Instance

Use 12c Release 1, EE

























































Create JCS Instance





























































Check out what's been created













As you can see, we have access to the usual WLS consoles.
We also have ssh access to the vm.

Now let's look at what has been created during the install at Compute Service level -
I go back to Compute Service and click on Instances.

I see 2 new instances.






If I click on Storage, I see -

















If I click on Network -> Security Rules, I see -


















I check Security Lists -






I click on Security Applications -

















The DB VM is a member of the following security list -










The WLS VM is a member of -












Let's check the security rules that allow the WLS VM to access the DB VM.




Here is the first rule -
























Look at the security application - NCJCS/1/sys_dblistener

This is self-explanatory -





The second rule allows ssh access from the wls vm to the DB machine -




Check out the JCS Console
















Check out the Administration tab -

















Click on Topology -
















Click on the hamburger menu to the right -







Check out Scale Up/Down -












As we say in Ireland, great stuff!

Now, let's look at the weblogic domain on my JCS instance -

sudo su - oracle

Then cd to /u01/data/domains 


















and
/u01/app/oracle/Middleware 













#499 IaaS --> REST apis

Introduction


To begin with, REST api docs are here

I suggest you go thru them first.

To perform operations on an Oracle Compute Cloud Service resource by using
REST API calls, you must specify the fully-qualified, unique URI of the resource.

Let's go back to my Compute Service -













Under Details, I find the REST Endpoint (api endpoint) - yes, I have obfuscated this somewhat!

REST request format is as follows -

https ://{ api_endpoint}/{resource_base_path}/{resource_name}

resource_name is broken down into -
/Compute-{identity_domain}/{user}/{object_id}

So to a simple example -

Authenticate user

curl -i -X POST -H "Content-Type: application/oracle-compute-v3+json" -d '{"user":"/Compute-yourIdentityDomain/yourUser","password":"yourPwd"}' yourAPIEndpoint/authenticate/


















This cookie is then used in all subsequent requests.

Set an env variable as follows to leverage the cookie.













Retrieve the names of my instances in the container

From previous posts you will remember I have NCVM1 and NCVM2

Here is the curl cmd -

curl -X GET -H "Cookie: $COMPUTE_COOKIE" -H "Accept: application/oracle-compute-v3+directory+json" https://YourRESTApiEndpoint/instance/Compute-yourIdentityDomain/yourUser/
















Tuesday, May 3, 2016

#498 Installing Puppet on IaaS



I download puppet enterprise from
here

I then copy the file across to my vm via pscp.

The format of the cmd is as follows -
pscp -i "C\yourPrivateKeyDirectory\yourPrivateKey.ppk" puppet-enterprise-2016.1.1-el-6-x86_64.tar.gz opc:YourVMIPAddress/yourTargetDirectory/yourTargetFile

Now I extract the tarball -












I now install - sudo ./puppet-enterprise-installer











I get the following message -







I create the following security application to open up port 3000 and
8140 -







Here is my Security List -




My Compute Service instance is added to this security list -









I now create the 2 security rules -

























and similar for ncpuppet8140.





I point my browser to my https://MyVM:3000

























Click Let's get started!

Then choose Monolithic








































Get a cup of coffee or chamomile tea...












Login








































Now I install the puppet agent on another VM.
To do this, I ssh into the 2nd vm and enter the following -

curl -k https://YourPuppetMaster:8140/packages/current/install.bash | sudo bash














What this essentially does is the following -

- Set up an apt, yum, or zipper repo that refers back to the Puppet master
- Pull down and install the puppet-agent packages.
- Create a basic puppet.conf
- Kick off a Puppet run.

Before nodes with the Puppet agent component can fetch configurations or appear in the
console, an administrator needs to sign their certificate requests. This helps prevent unauthorized
nodes from intercepting sensitive configuration data.

Here I sent the cert request from the agent vm -