Thursday, April 28, 2016

#496 - IaaS / PaaS Partner Roundtable hits Warsaw

Great event and a magnificent location, affording great city views.

Great resonance from the participants, especially in respect of 
Public Cloud Machine.







































Public Cloud Machine whitepaper here




Wednesday, April 27, 2016

#495 IaaS - Deploying Docker on Oracle Compute Service



We all know docker - Build, Ship and run anywhere.
So how does this work with Oracle Compute Cloud Service?


Docker containers are essentially lightweight virtualized environments, containing everything you need to run your app.

Step 1 Install docker

Here I install docker on my vm.

Firstly, I update the yum repository.
More info on yum here

Make sure that you are UEK 4.x compatible.

If not, then update -

[ol6_UEKR4]
name=Latest Unbreakable Enterprise Kernel Release 4 for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/UEKR4/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol6_UEKR3_latest]
name=Latest Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/UEKR3/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_UEK_latest]
name=Latest Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/UEK/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0


copy the above to your /etc/yu.repos.d/public-yum-ol6.repo file

then run sudo yum update

Once this is complete, then install docker -

sudo yum install docker-engine









Step 2 -Start docker

sudo service docker start






do the sanity test -
sudo docker run hello-world


















Now, let's run an Ubuntu container -

docker run -it ubuntu bash
















docker containers are stored here -






Good article on getting started with docker available here


Thursday, April 21, 2016

#494 IaaS - Rapid provisioning of vms thru Orchestration




What is Orchestration?

From the Oracle docs (Bold/Italic) -

An orchestration defines the attributes and interdependencies of a collection of compute, networking, and storage resources in Oracle Compute Cloud Service. You can use orchestrations to automate the provisioning and lifecycle operations of an entire virtual compute topology.
For example, you can use orchestrations to create and manage a collection of instances hosting a multitiered application stack with all the necessary networking, storage, and security settings.

Some Terminology up front

oplan - Object plan, the primary building block of an orchestration. 
An orchestration can have up to 10 oplans.

obj_typeAn object type refers to the Oracle Compute Cloud Service resource that you want to create. 

Here is the list of valid obj_types - 



objects - The objects attribute defines the properties or characteristics of the the Oracle Compute Cloud Service resource that you want to create, as specified by the obj_type attribute.

For example, if you want to create a storage volume, the obj_type would be storage/volume, and the objects would include size and bootable. If you want to create an instance, the obj_type would be launchplan, and the objects would include instances, along with instance-specific attributes, such as imagelist and shape.



You can create relationships between different oplans, e.g. one plan to create the instance, the other to create the storage volume.

Simple Example 

This simple example will have 2 parts -

  1. Instance Orchestration to manage my VM instance
  2. Volume Orchestration to manage storage volumes

From what I said earlier, would could also include a master that ties the other 2 together via a relationship. The master will be detailed later.

So what does it look like?

Let's start with the volume orchestration -

I begin with a screenshot of the UI for creating Storage Volumes -



Here is the equivalent orchestration -

{
    "relationships": [],
    "status": "ready",
    "account": "/YourIdentityDomain/default",
    "description": "Creating a bootable storage volume for the nc-oel 1st disk",
    "schedule": {
        "start_time": "2016-03-16T22:07:55Z",
        "stop_time": null
    },
    "uri": "https://YourRESTEndpoint/orchestration/Compute-YourIdentityDomain/yourUser/nc-oel-bootvolume",
    "oplans": [
        {
            "status": "ready",
            "info": {
                "errors": {}
            },
            "obj_type": "storage/volume",
            "ha_policy": "monitor",
            "label": "nc-oel-bootvolume",
            "objects": [
                {
                    "status": "Online",
                    "account": "/Compute-YourIdentityDomain/default",
                    "managed": true,
                    "name": "/Compute-YourIdentityDomain/yourUser/nc-oel-bootvolume",
                    "tags": [],
                    "bootable": true,
                    "hypervisor": null,
                    "description": null,
                    "status_detail": "The storage volume is online.",
                    "quota": null,
                    "uri": null,
                    "imagelist_entry": 1,
                    "storage_pool": "/YourStoragePool/iscsi/thruput_1",
                    "machineimage_name": "/oracle/public/OL-6.6-20GB-x11-RD",
                    "status_timestamp": "2016-03-16T22:26:07Z",
                    "shared": false,
                    "imagelist": "/oracle/public/OL-6.6-20GB-x11-RD",
                    "writecache": false,
                    "properties": [
                        "/oracle/public/storage/default"
                    ],
                    "size": "23622320128"
                }
            ],
            "status_timestamp": "2016-03-16T22:26:26Z"
        }
    ],
    "info": {
        "errors": {}
    },
    "status_timestamp": "2016-03-16T22:26:26Z",
    "name": "/YourIdentityDomain/yourUser/nc-oel-bootvolume",
    "_paasResource": false,
    "_personalResource": false
}


Now, let's look at the instance orchestration -
Again, here is the creation UI -
















Here is the equivalent orchestration -

{
  "relationships" : [ ],
  "account" : "/YourIdentityDomain/default",
  "description" : "Create instance that represents on OEL 6.6",
  "schedule" : {
    "start_time" : "2016-03-16T22:33:32Z",
    "stop_time" : null
  },
  "oplans" : [ {
    "obj_type" : "launchplan",
    "ha_policy" : "active",
    "label" : "nc-oel-instance",
    "objects" : [ {
      "instances" : [ {
        "networking" : {
          "eth0" : {
            "dns" : [ "nc-oel" ],
            "vethernet" : "/oracle/public/default",
"nat": "ippool:/oracle/public/ippool"
          }
        },
        "name" : "/YourIdentityDomain/yourUser/nc-oel-instance/cfa3dfba-c071-46d4-8b10-247eec1ab3c9",
        "boot_order" : [ 1 ],
        "storage_attachments" : [ {
          "volume" : "/YourIdentityDomain/yourUser/nc-oel-bootvolume",
          "index" : 1
        } ],
        "label" : "nc-oel-instance",
        "shape" : "oc3",
        "imagelist" : "/oracle/public/OL-6.6-20GB-x11-RD",
        "sshkeys" : [ "/YourIdentityDomain/yourUser/yourPublicKey" ],
        "tags" : [ ]
      } ]
    } ]
  } ],
  "name" : "/Compute-YourIdentityDomain/yourUser/nc-oel-instance"
}





















I added a master - Here we define the dependency between instance and volume creation.
Essentially, we need to create the volume before we can create the instance.


{
"name": "/YourIdentityDomain/yourUser/master",
"oplans": [
{
"label": "instance",
"obj_type": "orchestration",
"ha_policy": "monitor",
"objects": [
{
"name": "/YourIdentityDomain/yourUser//nc-oel-instance"
}
]
},
{
"label": "volume",
"obj_type": "orchestration",
"ha_policy": "monitor",
"objects": [
{
"name": "/YourIdentityDomain/yourUser/nc-oel-bootvolume"
}
]
}
],
"relationships": [
{
"oplan": "instance",
"to_oplan": "volume",
"type": "depends"
}
]
}

Now, normally when I upload orchestrations they execute, creating the relevant
resources. They then appear with the status "Ready".








Note, mine have the status stopped. I stopped these, via the context sensitive menu.
Stopping involves destroying the resources previously created.

Now I click on the menu for master -
















Wednesday, April 20, 2016

#493 IaaS - Adding Storage Volumes to a running instance



We begin with a refresher -

A temporary, non-persistent storage volume is associated with your Compute Cloud instance on creation. Your instance boots from this nonpersistent storage volume.

What if you want to save applications or data on your instance?
Then you must create a persistent storage volume and attach it to your instance.
If necessary, you can also specify a bootable storage volume. Using a bootable storage volume
allows you to save any configurations made to your instance at OS level.
This allows you to delete from instance and create it again without losing your OS configurations.































Once created, we can attach it to one of our instances, from the previous post.




















Please note: 

The disk number you specify here determines the device name.

The disk attached at
index 1 is named /dev/xvdb,
the disk at index 2 is /dev/xvdc,
the disk at index 3 is /dev/xvdd, etc.







Now I ssh into my vm.















Note disk xvdc above.

Now I create a disk partition -

sudo fdisk /dev/xvdc
















I now create a file system - sudo mkfs -t ext3 /dev/xvdc1

Now mount - sudo mount -t ext3 /dev/xvdc1 /u01
























Tuesday, April 19, 2016

#492 IaaS - Communication between Instances

Introduction

Many scenarios here, weblogic communicating with the database, for example.

I am going to make it even easier.
I will just create a second instance, as per the post #490.





Now I want to open communications between these 2 Oracle cloud instances.
I will open port 23 for tcp.


Step 1 is to create a new Security List



























Step 2 is to add the Instance to the Security List
















I do the same for VM1.
Here I create a new Security list - NiallC-VM-DB-Seclist























Step 3 is to create a Security Application, essentially opening port 23 for tcp

































Step 4 is to create a Security Rule leveraging the above Security Application
and the 2 Security Lists















Testing via Telnet

I have installed telnet server on VM1










I have installed telnet client on VM, and, as you can see,
I can connect successfully.









































#491 IaaS - Configuring Network access

Leading on from the previous example -

Here I login via ssh to my vm.











I start the http server -












I can access the test page -















Now I create a Security List -




Now I add my instance to this security list -

























 










I try and access the http server -








Now, I will create a security rule to enable access -





































Now, I think the above is self-explanatory, but just in case...

Security Application - protocol I want to use, in my case, http.

Source - where I am coming from, in my case the public internet. I am trying access
the http server from my laptop.

Destination - where I want to get to - NCVM. My vm is attached to the specified security list.





I now retry in my browser -
















Simple yet effective...