Skip to content

Oracle Cloud ‘Orchestrations’ – Concepts

General meaning of Orchestration is harmonious organization especially by means of clever or thorough planning or maneuvering to achieve desirable result. Orchestration in terms of Oracle Cloud is process/method to automate the provisioning and lifecycle operations of an entire virtual compute topology of Oracle Cloud. You can define the attributes and inter-dependencies of a collection of compute, networking, and storage resources in Oracle Compute Cloud Service.

Orchestration uses JSON as the communication language. See this post about basics of JSON.

you can use orchestrations to create and manage a collection of instances hosting a multi-tiered application stack with all the necessary networking, storage, and security settings.

At any time, you can delete and re-create all the instances in an orchestration just by stopping and restarting the orchestration. Storage attachments, security lists, and so on are re-associated automatically.

Note that networking and storage objects needn’t be defined in the same orchestrations that you use to create instances. You can define the networking and storage objects in separate orchestrations, and then refer to them in the orchestrations that define the instances. With this approach, you can remove and re-create instances independent of the associated resources.

To create instances using orchestrations, you build an orchestration in a JSON-formatted file, upload it to Oracle Compute Cloud Service, and then start the orchestration. The use of orchestrations is the recommended way of provisioning storage and instances in the Oracle Iaas public cloud and we plan to have separate orchestrations for storage and instances lest somebody accidentally wipe out the disk by stopping the orchestration containing a disk allocation.

BASIC TERMS:

 

1) object plan (oplan)

An object plan is the primary building block of an orchestration. object plan is also referred to as oplan. Each oplan contains all the attributes for the object type defined in that oplan.

An orchestration can contain up to 10 object plans, and each oplan can include up to 10 objects.

Relationships Between Object Plans are also maintained as per our requirements. We use relationships attribute on orchestrations to specify the sequence in which the objects must be created.

Example:

"relationships": [ { "oplan": "boot-from-storagevolume1",
"to_oplan": "storagevolume1",
"type": "depends“ } ]

Here the launch plan “boot-from-storagevolume1” depends on “storagevolume1”, and will ensure that the volume creation is done before instantiation.

 

2) object type (obj_type)

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

For example, if you want to create a storage volume, the obj_type would be storage/volume. If you want to create an instance, the obj_type would be launchplan. Possible Object Types are:

OBJECT TYPE DESCRIPTION
 ip/reservation Reserves an IP address. To associate an IP reservation with an instance that’s defined in the same orchestration, you must specify a relationship between the ip/reservation and the launchplan object plans.
 launchplan  Creates an instance. To add an instance to a security list that’s defined in the same orchestration, you must specify a relationship between the launchplan and the seclist object plans.
 network/v1/ipnetwork  Creates an IP network. You can specify an IP network in the networking attributes while creating an instance.
 network/v1/ipnetworkexchange  Creates an IP network exchange. You can add IP networks to an IP network exchange either while creating the IP network, or later, by updating the IP network.
 network/v1/route  Creates a route to a specified destination using the specified vNICset.
 network/v1/vnicset  Creates a vNICset of one or more virtual network interfaces (vNICs). A vNICset is used to specify the next hop in a route. While creating an instance, you can specify if you want a vNIC to be added to either the shared network or an IP network.
 orchestration  Starts a set of orchestrations.
 secapplication  Creates a security application. To use this security application in a security rule that’s defined in the same orchestration, you must specify a relationship between these objects.
 seciplist  Creates a security IP list. To use this security IP list in a security rule that’s defined in the same orchestration, you must specify a relationship between these objects.
 seclist  Creates a security list. To use this security list in a security rule that’s defined in the same orchestration, you must specify a relationship between these objects.
 secrule  Creates a security rule. If this security rule uses security applications, security lists, or security IP lists that are defined in the same orchestration, then you must specify a relationship between these objects.
 storage/volume  Creates a storage volume. To attach this storage volume to an instance that’s defined in the same orchestration, you must specify a relationship between the storage/volume and the launchplanobject plans.

As you can see we also kept “orchestration” as an object type for the orchestration. This is known as nesting of orchestrations. You can use one main orchestration to start and stop multiple other orchestrations by referring those orchestrations inside the main orchestration.

To understand “nesting” of orchestration see below example:

{
   "name": "/Compute-dummy/dummy@dummy.com/master_orch",
   "oplans": [
          {
          "label" : "master-orchestration",
          "obj_type" : "orchestration",
          "objects": [
          {
              "name": "/Compute-dummy/dummy@dummy.com/instances_orch"
          },
          {
              "name": "/Compute-dummy/dummy@dummy.com/networking_orch"
          },
          {
              "name": "/Compute-dummy/dummy@dummy.com/storage_orch"
          }
           
        ]
        }
   ]
}

In this example we have one main orchestration named “master_orch” and three other orchestrations “instances_orch”, “networking_orch” and “storage_orch” which are nested inside of the main orchestration. When we will start the master orchestration, all of the nested orchestrations are started.

Note that when you add a master orchestration to Oracle Compute Cloud Service, the nested orchestrations are not added automatically. You must add each of the nested and master orchestrations separately. Also we may also need to define relationships between the different orchestration object plans in the master orchestration, to ensure that the objects defined in the various orchestrations are created in the appropriate sequence. Example we will have to define relationships so that network and storage resources are created before the orchestration that defines the instances is started.

You can stop OR delete your main Orchestrations and impact will be like below:

When you stop the master orchestration, all the nested orchestrations are stopped, and the objects created by those orchestrations are deleted.

If you delete the master orchestration, the nested orchestrations aren’t automatically deleted; you must delete each individual nested orchestration separately.

3) object (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. The fields in the objects section vary depending on the specified obj_type.

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.

 


SAMPLE ORCHESTRATION SCRIPT

Below is sample Orchestration script provided by Oracle.

{
    "description": "Create instances with ssh access",
    "name": "/Compute-your_identity_domain/your_user_name/orchestration_1",
    "oplans": [
        {
            "label": "launchplan-for-vm1",
            "obj_type": "launchplan",
	    "ha_policy": "active",
            "objects": [
                {
                    "instances": [
                        {
                            "shape": "oc3",
                            "boot_order": [1],
                            "label": "vm-1",
                            "networking": {
                                "eth0": {
                                    "seclists": [
                                        "/Compute-your_identity_domain/your_user_name/For-ssh-access"
                                    ],
                                    "nat": "ipreservation:/Compute-your_identity_domain/your_user_name/ip-res-1"
                                }
                            },
                            "sshkeys": [
                                "/Compute-your_identity_domain/your_user_name/rsa-key-1"
                            ],
                            "storage_attachments": [
                                {
                                    "index": 1,
                                    "volume": "/Compute-your_identity_domain/your_user_name/bootable-vol-1"


                                }
                            ]
                        }
                    ]
                }
            ]
        },
	{
            "label": "launchplan-for-vm2",
            "obj_type": "launchplan",
			"ha_policy": "active",
            "objects": [
                {
                    "instances": [
                        {
                            "shape": "oc3",
                            "boot_order": [1],
                            "label": "vm-2",
                            "networking": {
                                "eth0": {
                                    "seclists": [
                                        "/Compute-your_identity_domain/your_user_name/For-ssh-access"
                                    ],
                                    "nat": "ipreservation:/Compute-your_identity_domain/your_user_name/ip-res-2"
                                }
                            },

                            "sshkeys": [
                                "/Compute-your_identity_domain/your_user_name/rsa-key-1"
                            ],
                            
                            "storage_attachments": [
			         {
                                    "index": 1,
                                    "volume": "/Compute-your_identity_domain/your_user_name/bootable-vol-2"
                                   
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}

 

To understand this script, let us break it into 6 parts.

1) Defining the Top-Level Attributes

Start your orchestration file with a name and description of your orchestration.

{
  "description": "Create instances with ssh access",
  "name": "/Compute-your_identity_domain/your_user_name/orchestration,

2) Specifying the Object Type

You can use an orchestration to create different types of objects: instances, storage volumes, security lists, security rules, and so on. To create an instance, in the oplans section of the orchestration, specify the object type as launchplan and give the launch plan a label.

Tip: To ensure that the instance is re-created automatically if it crashes for any reason, specify the HA policy as active.

  "oplans": [
    {
      "label": "launchplan-for-vm1",
      "obj_type": "launchplan",
      "ha_policy": "active",

3) Specifying the Shape and Image for Your Instance

Within the oplans section of the orchestration, use the objects attribute to specify the characteristics of your instance.

  • Specify the shape that you want your instance to use. The shape determines the amount of CPU and memory resources that will be allocated to the instance.
  • Also give the instance a label.
      "objects": [
        {
          "instances": [
            {
              "shape": "oc3",
              "label": "vm-1",

 

 

4) Configuring Network Access for the Instance

Next, in the networking section of the orchestration, to enable SSH access to your instance, add your instance to the security list that you created earlier, and associate an IP reservation with the instance.

              "networking": {
                "eth0": {
                  "seclists": [
                    "/Compute-your_identity_domain/your_user_name/For-ssh-access"
                   ],
                  "nat": "ipreservation:/Compute-your_identity_domain/your_user_name/ip-res-1"
                  }
               },

5) Adding SSH Public Keys to the Instance

Specify the SSH public key that must be associated with the instance.

              "sshkeys": [
                "/Compute-your_identity_domain/your_user_name/rsa-key-1"
               ],

 

Note: The keys that you specify here are stored as metadata on the instance. This metadata can be accessed from within the instance at http://192.0.0.192/latest/meta-data/public-keys.

 

6) Attaching Storage Volumes to the Instance

To set up your instance to boot from a persistent disk, you must attach a bootable storage volume, specify an index number (in the range 1 to 10) for the boot disk, and set the boot_order attribute to the appropriate index.

              "storage_attachments": [
                {
                  "index": 1,
                  "volume": "/Compute-your_identity_domain/your_user_name/bootable-vol-1"
                }
               ],
              "boot_order": [1],

 

Uploading and Starting Your Orchestration

On the Oracle Compute Cloud Service console, click the Orchestrations tab, and then click Upload Orchestration. In the Upload Orchestration dialog box, browse to select the orchestration file that you just created and then click Upload.

After your orchestration is uploaded, it is listed on the Orchestration page, with the status Stopped.

  1. From the Menu icon menu, select Start.
  2. Refresh the page to update the status.When you start an orchestration, its status changes to Starting.When all the instances defined in the orchestration are created, the status of the orchestration changes to Ready.
  3. To see your instances on the Oracle Compute Cloud Service console, click the Instances tab. If your instances are not listed, then refresh the page.

 

Brijesh Gogia
Leave a Reply