Building Your First Orchestration v1

Before You Begin

Before building your orchestration JSON file, do the following:

  • Read Best Practices for Using Compute Classic.

  • Create the security, storage, and networking resources that you plan to reference in your orchestration.

    These tasks require the Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud My Services. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

    • If you want to create a Linux instance with SSH access enabled, upload your SSH public keys to Compute Classic. See Adding an SSH Public Key.

      Note:

      You don’t need to do this if you’re creating a Windows instance, because you can’t log in to a Windows instance using SSH.

    • If you want your instances to boot from a persistent storage disk, create bootable storage volumes. See Creating a Bootable Storage Volume.

    • Create storage volumes for the data and applications that you plan to deploy on your instances. See Creating a Storage Volume. When you create the storage volumes, don’t attach them to any existing instance. You’ll specify the storage volumes later in the orchestration.

    • If you want your instances to have fixed public IP addresses, then create the required IP reservation. See Reserving a Public IP Address.

    • Create the required security lists. See Creating a Security List.

Sample Orchestration for Creating a Single Instance

You can use the following sample orchestration as a starting point for building your first orchestration.

{
  "description": "Simple oplan with an ssh key and a security list",
  "name": "/Compute-acme/joe.jonathan@example.com/simple_orchestration",
  "oplans": [
    {
      "label": "simple_oplan",
      "obj_type": "launchplan",
      "objects": [
        {
          "instances": [
            {
              "imagelist": "/oracle/public/OL_6.7_UEKR4_x86_64",
              "label": "OL_6.7",
              "networking": {
                "eth0": {
                  "seclists": [
                    "/Compute-acme/joe.jonathan@example.com/my_instances"
                  ],
                  "nat": "ipreservation:/Compute-acme/joe.jonathan@example.com/ip1"
                }
              },
              "shape": "oc3",
              "storage_attachments": [
                {
                  "index": 1,
                  "volume": "/Compute-acme/joe.jonathan@example.com/OL66_boot"
                  
                },
                {
                  "index": 2,
                  "volume": "/Compute-acme/joe.jonathan@example.com/data1"
                }
              ],
              "boot_order": [1],
              "sshkeys": [
                "/Compute-acme/joe.jonathan@example.com/ssh-key1"
              ]
            }
          ]
        }
      ]
    }
  ]
}
This sample orchestration does the following:
  • Defines an instance with the label OL_6.7, the oc3 shape, and using the /oracle/public/OL_6.7_UEKR4_x86_64 image.

  • Adds the instance to the security list/Compute-acme/joe.jonathan@example.com/my_instances.

  • Associates the IP reservation /Compute-acme/joe.jonathan@example.com/ip1 with the instance.

  • Attaches the bootable storage volume /Compute-acme/joe.jonathan@example.com/OL66_boot to the instance.

  • Attaches the data storage volume /Compute-acme/joe.jonathan@example.com/data1 to the instance.

  • Associates the SSH public key /Compute-acme/joe.jonathan@example.com/ssh-key1 with the instance.

Note:

To learn about the structure of an orchestration, see Orchestrations v1 Templates. For information about all the attributes that you can define in an orchestration, see Attributes in Orchestrations v1.

Steps for Building Your First Orchestration

  1. Copy the sample orchestration to a plain text file, and open the file in any text editor.
  2. Replace the name of the orchestration with an appropriate three-part name (/Compute-identity_domain/user/object).

    Note:

    While editing this sample file, remember to replace all placeholder values with values specific to your environment. For example, replace the identity domain name acme with your identity domain name and the user name joe.jonathan@example.com with your user name.

  3. Change the value of the imagelist attribute to any image that you want to use.
  4. Under instances, change the value of the label attribute to any label that you want.
  5. Replace the security list /Compute-acme/joe.jonathan@example.com/my_instances with a security list that you’ve already created.
    If you want to attach the instance to more security lists, remember to enclose each security-list name in double quotation marks and separate the security-list names by using commas. See the following example:
    "seclists": [
      "/Compute-acme/joe.jonathan@example.com/my_instances",
      "/Compute-acme/joe.jonathan@example.com/dev_instances",
      "/Compute-acme/joe.jonathan@example.com/prod_instances"
    ]
  6. Replace the IP reservation /Compute-acme/joe.jonathan@example.com/ip1 with an IP reservation that you’ve already created.
  7. Replace the oc3 shape with the shape that you want to use.
  8. Replace the storage volume /Compute-acme/joe.jonathan@example.com/OL66_boot with the bootable storage volume that your instance should boot from.
  9. Replace the storage volume /Compute-acme/joe.jonathan@example.com/data1 with a storage volume that you want to attach to the instance.
    If you don’t want to attach any storage volume, then remove the following section (and the comma preceding it) from the orchestration.
    {
      "index": 2,
      "volume": "/Compute-acme/joe.jonathan@example.com/data1"
    }
    If you want to attach more storage volumes, then specify the index for the storage attachment and the name of the storage volume as follows. Separate the storage volume definitions using commas. See the following example:
    {
      "index": 2,
      "volume": "/Compute-acme/joe.jonathan@example.com/admin/data1"
    },
    {
      "index": 3,
      "volume": "/Compute-acme/joe.jonathan@example.com/data2"
    }
  10. If you’re creating a Linux instance enabled for SSH access, replace the SSH key /Compute-acme/joe.jonathan@example.com/ssh-key1 with a key that you’ve created and added to Compute Classic.
    If you want to add more SSH keys, then enclose each key in double quotation marks and separate the keys by using commas. See the following example:
    "sshkeys": [
      "/Compute-acme/joe.jonathan@example.com/ssh-key1",
      "/Compute-acme/joe.jonathan@example.com/ssh-key2",
      "/Compute-acme/joe.jonathan@example.com/ssh-key3"
    ]

    Note:

    You don’t need to do this if you’re creating a Windows instance, because you can’t log in to a Windows instance using SSH. To log in to your Windows instance using RDP, see Accessing a Windows Instance Using RDP.

  11. Save the orchestration file.

    You should also validate your JSON file. You can do this by using a third-party tool, such as JSONLint, or any other validation tool of your choice. If your JSON format isn’t valid, then an error message is displayed when you upload the orchestration.

    Note:

    Oracle doesn’t support or endorse any third-party JSON-validation tool.

Your orchestration file is now ready.

To create instances by using this orchestration, you must upload it to Compute Classic. See Uploading an Orchestration v1.