X

Pat Shuff's Blog

  • Iaas
    August 4, 2016

Orchestration 2.0 - creating an instance

Today we will continue our evaluation of Oracle Orchestration by looking at how to define an instance. Yesterday we looked at creating a WordPress instance from an Oracle Marketplace image. We started by going down the structure of a storage element. Today we are going to continue with our Bitnami WordPress instance provisioning by looking at the bitnami-wordpress-4.5.3-0-linux-_20160721144012_instance.json file which describes the compute instance. The default install from Bitnami creates this file. In our example we are going to create an instance called WordPress_4_5_3 rather than the default and change the default storage from 10 GB to 60 GB as the Marketplace suggests is the minimum.

bitnami-wordpress-4.5.3-0-linux-_20160721144012_instance.json

If we look at the orchestration file we see the definition

{
"relationships" : [ ],
"account" : "/Compute-metcsgse00028/default",
"description" : "",
"schedule" : {
"start_time" : "2016-07-21T19:46:32Z",
"stop_time" : null
},
"oplans" : [ {
"obj_type" : "launchplan",
"ha_policy" : "active",
"label" : "bitnami-wordpress-4.5.3-0-linux-_20160721144012_instance",
"objects" : [ {
"instances" : [ {
"networking" : {
"eth0" : {
"seclists" : [ "/Compute-metcsgse00028/default/default" ],
"nat" : "ippool:/oracle/public/ippool"
}
},
"name" : "/Compute-metcsgse00028/cloud.admin/bitnami-wordpress-4.5.3-0-linux-_20160721144012/b531af9b-e075-4a51-a867-449fd948d374",
"storage_attachments" : [ {
"volume" : "/Compute-metcsgse00028/cloud.admin/bitnami-wordpress-4.5.3-0-linux-_20160721144012_storage",
"index" : 1
} ],
"boot_order" : [ 1 ],
"hostname" : "a2d1e4.compute-metcsgse00028.oraclecloud.internal.",
"label" : "bitnami-wordpress-4.5.3-0-linux-_20160721144012",
"shape" : "oc3",
"attributes" : {
"userdata" : {
},
"nimbula_orchestration" : "/Compute-metcsgse00028/cloud.admin/bitnami-wordpress-4.5.3-0-linux-_20160721144012_instance"
},
"imagelist" : "/Compute-metcsgse00028/marketplace01-user@oracleads.com/bitnami-wordpress-4.5.3-0-linux-oel-6.7-x86_64",
"sshkeys" : [ "/Compute-metcsgse00028/cloud.admin/2016" ],
"tags" : [ ]
} ]
} ]
} ],
"user" : "/Compute-metcsgse00028/cloud.admin",
"name" : "/Compute-metcsgse00028/cloud.admin/bitnami-wordpress-4.5.3-0-linux-_20160721144012_instance"
}

If we break down this file it can be abbreviated as

{
"relationships" : [ ],
"account" : "/Compute-metcsgse00028/default",
"description" : "",
"schedule" : { … },
"oplans" : [ … ],
"user" : "/Compute-metcsgse00028/cloud.admin",
"name" : "/Compute-metcsgse00028/cloud.admin/bitnami-wordpress-4.5.3-0-linux-_20160721144012_storage"
}

Note that this is exactly what it looked like for the storage definition. The differences happen in the oplans parameter field. For the instance definition we define the obj_type as launchplan. The launchplan parameters are detailed in the documentation. The required field for the launchplan object type is the instances parameter. All of the other fields are optional. The instances fields are defined in the documentation on instances. The shape parameter is the only required parameter with all other parameters being optional. The oplans field for our instance looks like

    "obj_type" : "launchplan",
"ha_policy" : "active",
"label" : "bitnami-wordpress-4.5.3-0-linux-_20160721144012_instance",
"objects" : [ {
"instances" : [ {
"networking" : {
"eth0" : {
"seclists" : [ "/Compute-metcsgse00028/default/default" ],
"nat" : "ippool:/oracle/public/ippool"
}
},
"name" : "/Compute-metcsgse00028/cloud.admin/bitnami-wordpress-4.5.3-0-linux-_20160721144012/b531af9b-e075-4a51-a867-449fd948d374",
"storage_attachments" : [ {
"volume" : "/Compute-metcsgse00028/cloud.admin/bitnami-wordpress-4.5.3-0-linux-_20160721144012_storage",
"index" : 1
} ],
"boot_order" : [ 1 ],
"hostname" : "a2d1e4.compute-metcsgse00028.oraclecloud.internal.",
"label" : "bitnami-wordpress-4.5.3-0-linux-_20160721144012",
"shape" : "oc3",
"attributes" : {
"userdata" : {
},
"nimbula_orchestration" : "/Compute-metcsgse00028/cloud.admin/bitnami-wordpress-4.5.3-0-linux-_20160721144012_instance"
},
"imagelist" : "/Compute-metcsgse00028/marketplace01-user@oracleads.com/bitnami-wordpress-4.5.3-0-linux-oel-6.7-x86_64",
"sshkeys" : [ "/Compute-metcsgse00028/cloud.admin/2016" ],
"tags" : [ ]
} ]
} ]

In this definition the object type is launchplan. The ha_policy is active which means that the instance will be rebooted if it fails. The label is the name of the compute instance. The default installed by Bitnami is "bitnami-wordpress-4.5.3-0-linux-_20160721144012_instance" but our example would be WordPress_4_5_3_instance. The objects parameter holds the meat of the definition. We have the required field shape that defines our instance as an oc3 size instance. We give it a name as well as network connection using the default security list association. The default security list opens up port 22 that allows us to ssh into the Linux instance to configure the application. We have one storage volume attached that we looked at in the previous blog post. Note that we attach the volume by name and associate it with logical unit 1. We also define some optional attributes that give the boot loader a hint so that we can not only boot this image from a boot file but associate ssh keys to the instance so that we can log in once the system is up and running. The only additional information that we see in this file is the hostname used to address this system. In this example we use the hostname of a2d1e4.compute-metcsgse00028.oraclecloud.internal. This is the internal name that can be used through the DNS service provided by the Oracle Cloud services.

bitnami-wordpress-4.5.3-0-linux-20160721144012_master.json

The third file that is defined for our instance is the master json file. The default file name created by Bitnami is bitnami-wordpress-4.5.3-0-linux-20160721144012_master.json for our instance. The key differences in this file is the oplan obj_type being orchestration and the relationships entry being non null. The obj_type of orchestration tells the Oracle Cloud service that this is the file that is used to describe the instance and how to load and boot it. The relationships parameter shows that there are two plans that we need to reference for booting. We require the "bitnami-wordpress-4.5.3-0-linux-_20160721144012_instance" file to describe the instance and this file depends upon the file "bitnami-wordpress-4.5.3-0-linux-_20160721144012_storage". The storage file defines the disk that we will boot from and use to run our instance. If there were multiple disks we would have multiple dependencies listed. The full contents of this file look like

{
"relationships" : [ {
"to_oplan" : "bitnami-wordpress-4.5.3-0-linux-_20160721144012_storage",
"oplan" : "bitnami-wordpress-4.5.3-0-linux-_20160721144012_instance",
"type" : "depends"
} ],
"account" : "/Compute-metcsgse00028/default",
"description" : "",
"schedule" : {
"start_time" : "2016-07-21T19:40:33Z",
"stop_time" : null
},
"oplans" : [ {
"obj_type" : "orchestration",
"ha_policy" : "",
"label" : "bitnami-wordpress-4.5.3-0-linux-_20160721144012_storage",
"objects" : [ {
"info" : {
"errors" : {
}
},
"status" : "ready",
"name" : "/Compute-metcsgse00028/cloud.admin/bitnami-wordpress-4.5.3-0-linux-_20160721144012_storage",
"status_timestamp" : "2016-07-21T19:45:16Z",
"uri" : null
} ]
}, {
"obj_type" : "orchestration",
"ha_policy" : "",
"label" : "bitnami-wordpress-4.5.3-0-linux-_20160721144012_instance",
"objects" : [ {
"info" : {
"errors" : {
}
},
"status" : "ready",
"name" : "/Compute-metcsgse00028/cloud.admin/bitnami-wordpress-4.5.3-0-linux-_20160721144012_instance",
"status_timestamp" : "2016-07-21T19:47:16Z",
"uri" : null
} ]
} ],
"user" : "/Compute-metcsgse00028/cloud.admin",
"name" : "/Compute-metcsgse00028/cloud.admin/bitnami-wordpress-4.5.3-0-linux-_20160721144012_master"
}

These two files define the instance and the instance relationship with storage. When we look at the Orchestration part of the Compute Console we note that we can view, start, delete, resize, and download the orchestration. If the instance is running we can stop the instance.

If we view the orchestration it allows us to look at the download the json code. The download allows us to download the json code to our desktop. The delete function for an instance has moved from the Instances tab to this tab. To delete an instance you need to stop the instance through the Orchestations tab then delete the components that make up the instance. Note that the Resize Instance only appears for a compute instance. This allows us to size up or size down an instance to a different shape. We can’t size up and down storage but need to edit the orchestration to make it bigger. Making it smaller is currently not supported. It is important to note that editing of the json files is currently not supported from this interface. If you want to edit a json file you need to download it, edit it on your desktop, then upload it with a different name. The upload is done using the Upload Orchestration button on the Orchestrations tab.

Yesterday we looked at the storage json file that makes up a storage orchestration. Today we looked at the instance and master orchestration files that define an instance. All three of these files help us define an instance and how to start it. The example that we started with is a simple example that creates an Apache web server with PHP and MySQL on a Linux instance. We then layer WordPress on this configuration and define security ports to allow us to log in and manage the instance as well as see the http and https ports. Automation of instances can be done through REST apis once we have the orchestrations defined. We can use tools like Enterprise Manager to catch errors and exceptions thrown if an instance fails and initiate a restart function. We can also use Enterprise Manager to reconfigure or rescale services if utilization goes above a threshold over a period of time. Amazon uses CloudFormation to make this happen but it is specific for Amazon AWS services only. Oracle uses Enterprise Manager because these scripts and monitoring utilities can be used for on premise servers, virtual instances running in your data center, or compute instances running in the Oracle or other cloud service.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha