psm stack create

Use this command to create a stack instance.

Syntax

In the following syntax, line breaks have been added for clarity. Do not include them when entering the command.

psm stack create -n|--name stackName 
  -t|--template templateName
  [-d|--description stackDescription]
  [-g|--tags stringOfTags]
  [-f|--on-failure RETAIN|ROLLBACK]
  [-p|--parameter-values key:value key:value ...]
  [-pf|--parameter-file file]
  [-of|--output-format json|html|short]
  [-wc|--wait-until-complete true|false]

Parameters

All parameters are required unless otherwise noted.

Parameter Description
-n|--name stackName Name of the stack to be created.
-t|--templatetemplateName Name of the template from the template library. Import a template if one does not yet exist.
-d|--description stackDescription (Optional) Description of the stack.
-g|--tags stringOfTags (Optional) A string representation of a JSON array of tags.
-f|--on-failure RETAIN|ROLLBACK (Optional) This flag specifies if the stack should be retained on failure.

Accepted values: ROLLBACK, RETAIN

Default: ROLLBACK

Description:

  • ROLLBACK (default): Any service instances that were created as part of this stack will be deleted

  • RETAIN: For troubleshooting purposes, any service instances that were created as part of this stack are not deleted

-p|--parameter-values key:value key:value ... (Optional) Parameter values for the template, specified as key:value pairs. One or more pairs are allowed, and each pair is separated by a space.

Refer to the stack template for a list of available parameters.

-pf|--parameter-file file (Optional) The name and location of a JSON file that specifies the parameter values.
{
  "key":"value",
  "key":"value",
  ...,
  "key":"value"
}

Refer to the stack template for a list of available parameters.

-of|--output-format json|html|short (Optional) Desired output format.

Accepted values: json, html, short

The default output format is the one you specified when using the psm setup command to configure the psm CLI.

-wc|--wait-until-complete true|false

(Optional) A boolean value that, when set to true, makes the command behave synchronously; that is, it does not return until the submitted job is complete. The following message is displayed until the job is complete:
Waiting for the job to complete... (it cannot be cancelled)
Default: false

Example

$ psm stack create -n MyStack -t ExampleTemplate -d MyExampleStack -f RETAIN -p shape:OC3 clusterSize:2
{
    "details":{
        "message":"Submitted job to create stack [MyStack] in domain [stackdomain].",
        "jobId":"80521"
    }
}
Job ID : 80521

Note that this command returned a job ID. To see the status of your psm stack create operation, use this job ID with psm stack operation-status command:

$ psm stack operation-status -j 80521