Creating a Cloud Stack

Create a cloud stack in Oracle Cloud Stack Manager to provision a group of related cloud services. After selecting a template and initiating the creation of a stack, monitor its progress and status.

Tutorial icon Tutorials are also available to help you create your first cloud stack.

You can use one of the standard Oracle stack templates, or use a custom template that you previously created or imported into Oracle Cloud Stack Manager.

You cannot create a stack from a custom template that is in the unpublished state. See Publishing a Template.

In order to create a cloud stack you must have a valid subscription to all of the Oracle Cloud services of which the stack is comprised. For example, in order to use a stack template that includes an Oracle Java Cloud Service instance, your Oracle Cloud account must have a subscription to Oracle Java Cloud Service and it also must have the appropriate entitlements to use the desired features of Oracle Java Cloud Service. If these requirements are not met, you will receive a Forbidden error message.

A stack template defines zero or more named templates parameters. Values for these parameters can be provided when a stack is created. A template parameter may be mandatory (does not have a default value) or optional. A parameter’s value can also be limited to certain values or have to meet certain requirements.

If the creation of a stack fails, Oracle Cloud Stack Manager can take one of these actions:

  • Rollback (default): Any resources that were created as part of this stack will be deleted.

  • Retain: For troubleshooting purposes, any resources that were created as part of this stack are not deleted. See Troubleshooting for Oracle Cloud Stack Manager.

Creating a Cloud Stack with the Console

Use the web console to create a cloud stack in Oracle Cloud Stack Manager.

  1. Sign in to the Oracle Cloud Stack Manager console and navigate to the Stacks page.
  2. Click Create Stack.

    Alternatively, go to the Templates page and click the Create Stack icon to the right of the template you want to use.

    The Create New Oracle Cloud Stack — Details page is displayed.

  3. Enter a Name and optional Description for the stack.

    Hyphens are not permitted in a stack’s name.

  4. Select a Template from which to create the stack.
  5. Optional: For Notification Email, enter an email address that should receive a message when the stack’s creation is complete.
  6. Optional: For Tags, select one or more existing tags to assign to this stack, and/or click Create a tag Gear icon to create and assign new tags to this stack.

    Tags can be simple values or key:value pairs.

  7. Optional: Select the On Failure Retain Resources check box to retain (not delete) any successfully created resources, in the event the stack creation fails.
  8. Enter values for the remaining template parameters. The available parameters are specific to the template you selected.
    • Mandatory parameters are indicated with an asterisk.

    • Read-only parameters cannot be modified.

    • Click Help Question mark next to a parameter to learn more information about it.

  9. For any secure shell (SSH) key parameters, do the following:
    1. Click the Edit button.
    2. Choose from one of these options:
      • Select Key File Name. Click Choose File and select a public key file on your local machine.

      • Select Key Value and paste the value of the public key into the text area.

      • Select Create a New Key if you want Oracle Cloud to generate a public/private key pair for you.

    3. Click Enter.
    4. If you selected the Create a New Key option, click Download and save the generated keys to your local machine. Then click Done.

      Note:

      Be sure to download the generated keys to a permanent location. Without the private key file, you will not be able to access and administer the nodes that are created as part of this cloud stack.
  10. Click Next.
  11. Review the values you provided for the template parameters and click Confirm to create your stack.

    Tip:

    Click Download Payload Download Payload to save your parameter values as a JSON file. You can use this file to create a stack with the CLI or REST API.

    Click Back if you want to change the parameter values. Click Cancel if you want to exit the creation wizard without creating a stack.

  12. Your new stack appears on the Stacks page. Click its status to monitor the progress of your stack’s creation.

    You can also monitor this operation by:

    • Expanding the Stack Create and Delete History section of the Stacks page.

    • Navigating to the Activity Page.

Creating a Cloud Stack with the CLI

Use the CLI to create a cloud stack in Oracle Cloud Stack Manager.

To discover the available parameters for a template, you can download it as a file and view its contents. See Exporting a Template.

You can specify parameter values for a stack using either of these methods:

  • Enter a single string, and separate each parameter with a space.

    param1:value1 param2:value2 ... paramN:valueN
  • Provide the location of a JSON file.

    {
      "param1":"value1",
      "param2":"value2",
      ...,
      "paramN":"valueN"
    }

To create a stack with the CLI:

  1. Execute the stack create command.

    Provide a name for the new stack and the name of the existing template. You can also optionally provide a description, template parameters and a failure action (ROLLBACK or RETAIN ).

    psm stack create -n name -d description -t template -f RETAIN|ROLLBACK [-p parameters | -pf parameterFile]

    For example:

    psm stack create -n dev1 -t dev_template -f RETAIN -p shape:OC3 clusterSize:2
    psm stack create -n dev2 -t dev_template -pf params_dev2.json

    Hyphens are not permitted in a stack’s name.

  2. The output of the stack create command includes a job ID number. Use the stack operation-status command to periodically check the state of the create operation:
    psm stack operation-status -j jobID
  3. If you created the stack with the -f RETAIN or --on-failure RETAIN options and stack creation failed, you can attempt to correct the cause of the failure and then execute the stack resume command:
    psm stack resume -n name
    Oracle Cloud Stack Manager will resume the creation of the stack and attempt to recreate the failed resource.
  4. Execute the stack describe command to view details about the stack and the services of which it is comprised:
    psm stack describe -n name

    Note:

    You can also view a list of all cloud stacks in this account by using the stack list command.

For more information about the CLI commands for Oracle Cloud Stack Manager, see psm stack Commands.