Skip to main content

Automation

Automation

An automation workflow is a saved, named sequence of StorONE CLI commands that you can run as a single unit, as many times as you like, instead of typing (or scripting) each command individually. It's built for repeatable, multi-step procedures —— provisioning a standard set of volumes for a new application, running the same cleanup steps after a project wraps up, or any other sequence you find yourself repeating.

A workflow is just an ordered list of commands with their arguments already filled in. Read-only (Get) commands can't be part of a workflow —— automation is for making changes, not for querying state.

Variables

Rather than hard-coding every value, a workflow's commands can include @token@ placeholders anywhere in their arguments —— for example --capacity=@size@. When you run the workflow, you supply a value for each @token@ that appears anywhere in it, and StorONE substitutes it into every command that uses it before running the sequence. This lets you reuse the same workflow for different volumes, capacities, applications, and so on, without editing it each time.

Creating a workflow

Using the web interface

  1. Open Application Volumes > Automation.
  2. Click Create.
  3. Under Workflow Name, enter the Automation Workflow Name.
  4. Under Commands, add each command in the order it should run: the command path (e.g. applications volumes create) and its parameters (e.g. --application=finance --volume=ledgers --capacity=500GB --pool=SSD-1 --n=4 --k=2). Use the + control to add more command rows.
  5. Confirm to create the workflow.

Using the CLI

automation create --automationWorkflowName=<name> --commandPaths=<command_path...> [--commandParameters=<command_args...>]
Option Description
--automationWorkflowName=<name> The name of the automation workflow.
--commandPaths=<command_path...> The commands to run, in order (Get/read-only commands are not allowed).
--commandParameters=<command_args...> The parameters for each command, matched by position —— the nth entry in --commandParameters is passed to the nth entry in --commandPaths.

Examples

Create a two-step workflow that creates a volume and then a file system on it:

automation create --automationWorkflowName provision-share --commandPaths "applications volumes create","filesystems create" --commandParameters "--application=@app@ --volume=@vol@ --capacity=@size@ --pool=HDD-1 --n=8 --k=2","--application=@app@ --volume=@vol@ --fstype=xfs"

Create a single-step workflow with no variables, for a fixed cleanup task:

automation create --automationWorkflowName delete-scratch --commandPaths "applications volumes delete" --commandParameters "--application=scratch --volume=temp --force"

Editing a workflow

Editing a workflow replaces its entire command list —— you can't append or remove a single step, so supply the full, corrected sequence of --commandPaths/--commandParameters each time.

Using the web interface

  1. Open Application Volumes > Automation.
  2. Select the workflow and click Edit.
  3. Update the Automation Workflow Name (to rename it) and/or the Commands list.
  4. Confirm the change.

Using the CLI

automation edit --automationWorkflowName=<name> [--newAutomationWorkflowName=<name>] --commandPaths=<command_path...> [--commandParameters=<command_args...>]
Option Description
--automationWorkflowName=<name> The automation workflow to edit.
--newAutomationWorkflowName=<name> New name for the automation workflow.
--commandPaths=<command_path...> The commands to run, in order (Get/read-only commands are not allowed).
--commandParameters=<command_args...> The parameters for each command, matched by position.

Example —— rename provision-share to provision-file-share and add a third step:

automation edit --automationWorkflowName provision-share --newAutomationWorkflowName provision-file-share --commandPaths "applications volumes create","filesystems create","filesystems mount" --commandParameters "--application=@app@ --volume=@vol@ --capacity=@size@ --pool=HDD-1 --n=8 --k=2","--application=@app@ --volume=@vol@ --fstype=xfs","--application=@app@ --volume=@vol@"

Executing a workflow

Running a workflow executes its commands in order, substituting in whatever values you supply for its @token@ variables. If any command in the sequence fails, review the job's output to see which step failed —— commands before it will already have run.

Using the web interface

  1. Open Application Volumes > Automation.
  2. Select the workflow and click Execute.
  3. Under Workflow Selection, confirm the workflow name.
  4. Under Variable Values, supply a value for each variable the workflow uses.
  5. Confirm to run it.

Using the CLI

automation execute --automationWorkflowName=<name> [--variables=<text...> --values=<text...>]
Option Description
--automationWorkflowName=<name> The automation workflow to execute.
--variables=<text...> The @token@ placeholders to substitute in the workflow's commands.
--values=<text...> The value for each variable, matched by position.

Examples

Run provision-share, supplying values for its @app@, @vol@, and @size@ tokens:

automation execute --automationWorkflowName provision-share --variables app,vol,size --values finance,ledgers,500GB

Run a workflow that has no variables:

automation execute --automationWorkflowName delete-scratch

Deleting a workflow

Using the web interface

  1. Open Application Volumes > Automation.
  2. Select the workflow and click Delete.
  3. Confirm the deletion.

Using the CLI

automation delete --automationWorkflowName=<name>
Option Description
--automationWorkflowName=<name> The automation workflow to delete.

Example

automation delete --automationWorkflowName delete-scratch

Listing workflows

Using the web interface

Open Application Volumes > Automation. The list shows every configured workflow along with its commands.

Using the CLI

automation list [--automationWorkflowName=<name>]
Option Description
--automationWorkflowName=<name> Filter by workflow name.

Examples

List every workflow:

automation list

List just the provision-share workflow, to review its steps:

automation list --automationWorkflowName provision-share

See also: Applications and Volumes ·· Scheduled Reports (for emailing the output of List commands on a recurring schedule, rather than running action commands on demand)