Automation

Provisioning -> Automation

The Automation section is composed of Tasks and Workflows. Tasks can be scripts added directly, scripts and blueprints from the Library section, recipes, playbooks, salt states, puppet agent installs, or http (api) calls. These Tasks are are combined into workflows, which can be selected to run at provision time or executed on existing instances via Actions -> Run Workflow.

Tasks

Overview

There are many Task Types available, including scripts added directly, scripts and templates from the Library section, recipes, playbooks, salt states, puppet agent installs, and http (api) calls. Tasks are primarily created for use in Workflows, but a single Task can be executed on an existing instance via Actions -> Run Task.

Role Permissions

The User Role Permission ‘Provisioning: Tasks FULL’ is required to create, edit and delete tasks.

Tasks Types that can execute locally against the Morpheus Appliance have an additional Role Permission: Tasks - Script Engines. Script Engine Task Types will be hidden for users without Tasks - Script Engines role permissions.

Task Types

Available Task Types
  Task Type Task Description Task Target Configuration Requirements Role Permissions Requirements
ansible Ansible Runs an Ansible playbook. Ansible Integration required Instance or Host Existing Ansible Integration Provisioning: Tasks
ansibletower Ansible Tower Relays Ansible calls to Ansible Tower Instance or Host Existing Ansible Tower Integration Provisioning: Tasks
chef Chef bootstrap Executes Chef bootstrap and run list. Chef Integration required Instance or Host Existing Chef Integration Provisioning: Tasks
groovy Groovy script Executes Groovy Script locally (on Morpheus app node) Local None Provisioning: Tasks, Tasks - Script Engines
email Email Send an email from a Workflow Local None Provisioning: Tasks
http HTTP Executes REST call for targeting external API’s. URL specified in Task None Provisioning: Tasks
javascript Javascript Executes Javascript locally (on Morpheus app node) Local None Provisioning: Tasks, Tasks - Script Engines
jruby jRuby Scirpt Executes Ruby script locally (on Morpheus app node) Local None Provisioning: Tasks, Tasks - Script Engines
libraryscript Library Script Creates a Task from an existing Library Script (Provisioning -> Library -> Scripts) Instance or Host Existing Library Script Provisioning: Tasks
template Library Template Creates a Task from an existing Library Template (Provisioning -> Library-> Templates) Instance or Host Existing Library Templates Provisioning: Tasks
localscript Local Shell Script Executes Bash script locally (on Morpheus app node) Local None Provisioning: Tasks, Tasks - Script Engines
puppet Puppet Agent Install Executes Puppet Agent bootstrap, writes puppet.conf and triggers agent checkin. Puppet Integration required Instance or Host Existing Puppet Integration Provisioning: Tasks
jython Python Script (jython) Executes Python script locally (on Morpheus app node) Local None Provisioning: Tasks, Tasks - Script Engines
shellscript Remote Shell Script Executes Bash script against the Instance or Host the Task or Workflow is ran on Instance or Host None Provisioning: Tasks
restart Restart Restarts target VM/Host/Container and confirms status before executing next task in Workflow Instance or Host None Provisioning: Tasks
ssh SSH Script Execute Bash script against IP specified in Task. IP specified in Task None Provisioning: Tasks
winrm WinRM Script Execute Powershell script against IP specified in Task. IP specified in Task None Provisioning: Tasks

ansible Ansible Playbook

Description:

Runs an Ansible playbook. Ansible Integration required

Target:

Instance or Host

Role Permissions:
 

Provisioning: Tasks

Task Configuration:
 
NAME

Name of the Task

CODE

Unique code name for api, cli, and variable reference

ANSIBLE REPO

Select existing Ansible Integration

GIT REF

Specify tag or branch (Option, blank assumes default)

PLAYBOOK
Name of playbook to execute

Both playbook and playbook.yml format supported

TAGS

Enter comma separated tags to filter executed tasks by (ie --tags)

SKIP TAGS

Enter comma separated tags to run the playbook without matching tagged tasks (ie --skip-tags)

Important

Using different Git Ref’s for multiple Ansible Tasks in same Workflow is not supported. Git Refs can vary between Workflows, but Tasks in each workflow must use the same Git Ref.

chef Chef Bootstrap

Description:

Executes Chef bootstrap and run list. Chef Integration required

Target:

Instance or Host

Role Permissions:
 

Provisioning: Tasks

Task Configuration:
 
NAME

Name of the Task

CODE

Unique code name for api, cli, and variable reference

CHEF SERVER

Select existing Chef Integration

ENVIRONMENT

Populate Chef environment, or leave as _default

RUN LIST

Enter Run List, eg role[web]

DATA BAG KEY

Enter data bag key (will be masked uon save)

DATA BAG KEY PATH

Enter data bag key path, eg /etc/chef/databag_secret

NODE NAME

Defaults to instance name, configurable.

NODE ATTRIBUTES

Specify attributes inside the {}

groovy Groovy script

Description:

Executes Groovy Script locally (on app node)

Target:

Local App Node

Role Permissions:
 

Provisioning: Tasks Provisioning: Tasks - Script Engines

Task Configuration:
 
NAME

Name of the Task

CODE

Unique code name for api, cli, and variable reference

RESULT TYPE
  • Single Value
  • Key/Value Pairs
  • JSON
SCRIPT

Contents of Groovy Script to execute

Email

Description:

Allows for sending of email via Workflows

Target:

Local

Role Permissions:
 

Provisioning: Tasks

Task Configuration:
 
NAME

Name of the Task

CODE

Unique code name for api, cli, and variable reference

Email Address:

Email addresses can be entered literally or Morpheus automation variables can be injected, such as <%=instance.createdByEmail%>

Subject:

Morpheus automation variables can be injected into the subject field when needed

Body:

The body of the email is HTML. Morpheus automation variables can be injected into the email body when needed

http HTTP (api)

Description:

Executes REST call for targeting external API’s.

Target:

URL specified in Task

Role Permissions:
 

Provisioning: Tasks

Task Configuration:
 
NAME

Name of the Task

CODE

Unique code name for api, cli, and variable reference

RESULT TYPE
  • Single Value
  • Key/Value Pairs
  • JSON
URL

http or https url for http task target

HTTP METHOD

GET (default), POST, PUT, PATCH, HEAD, or DELETE

AUTH USER

Username for username/password authentication

PASSWORD

Password for username/password authentication

BODY

Request Body

HTTP HEADERS
Enter requests headers
Http Header examples
Authorization Bearer token
Content-Type application/json

javascript Javascript

Description:

Executes Javascript locally (on app node)

Target:

Local App Node

Role Permissions:
 

Provisioning: Tasks Provisioning: Tasks - Script Engines

Task Configuration:
 
NAME

Name of the Task

CODE

Unique code name for api, cli, and variable reference

RESULT TYPE
  • Single Value
  • Key/Value Pairs
  • JSON
SCRIPT

Contents of Javascript to execute

jruby jRuby Script

Description:

Executes Ruby script locally (on app node)

Target:

Local App Node

Role Permissions:
 

Provisioning: Tasks Provisioning: Tasks - Script Engines

Task Configuration:
 
NAME

Name of the Task

CODE

Unique code name for api, cli, and variable reference

RESULT TYPE
  • Single Value
  • Key/Value Pairs
  • JSON
SCRIPT

Contents of jRuby Script to execute

libraryscript Library Script

Description:

Creates a Task for an existing Library Script (Provisioning -> Library -> Scripts)

Target:

Instance or Host

Role Permissions:
 

Provisioning: Tasks

Task Configuration:
 
NAME

Name of the Task

CODE

Unique code name for api, cli, and variable reference

RESULT TYPE
  • Single Value
  • Key/Value Pairs
  • JSON
SCRIPT

Search for and select existing Library Script

template Library Template

Description:

Creates a Task for an existing Library Template (Provisioning -> Library-> Templates)

Target:

Instance or Host

Role Permissions:
 

Provisioning: Tasks

Task Configuration:
 
NAME

Name of the Task

CODE

Unique code name for api, cli, and variable reference

TEMPLATE

Search for and select existing Library Template

localscript Local Shell Script

Description:

Executes Bash script locally (on Morpheus app node)

Target:

Local App Node

Role Permissions:
 

Provisioning: Tasks Provisioning: Tasks - Script Engines

Task Configuration:
 
NAME

Name of the Task

CODE

Unique code name for api, cli, and variable reference

RESULT TYPE
  • Single Value
  • Key/Value Pairs
  • JSON
GIT REPO

Select a Git Repo which can be referenced in the Script.

GIT REF

Specify git ref such as branch

SCRIPT

Bash Script to execute. If a Git Repo is specified, files in the repo can be called in the script.

puppet Puppet Agent Install

Description:

Executes Puppet Agent bootstrap, writes puppet.conf and triggers agent checkin. Puppet Integration required

Target:

Instance or Host

Role Permissions:
 

Provisioning: Tasks

Task Configuration:
 
NAME

Name of the Task

PUPPET MASTER

Select Puppet Master from existing Puppet Integration

PUPPET NODE NAME

Enter Puppet Node Name. Variables supported eg. "<%= instance.name %>"

PUPPET ENVIRONMENT

Enter Puppet Env. eg. production

jython Python Script (jython)

Description:

Executes Python script locally (on app node)

Target:

Local App Node

Role Permissions:
 

Provisioning: Tasks Provisioning: Tasks - Script Engines

Task Configuration:
 
NAME

Name of the Task

CODE

Unique code name for api, cli, and variable reference

TYPE

Python Script (jython)

RESULT TYPE
  • Single Value
  • Key/Value Pairs
  • JSON
SCRIPT

Python Script (jython) Script to execute

shellscript Remote Shell Script

Description:

Executes Bash script against the Instance or Host the Task or Workflow is ran on

Target:

Instance or Host

Role Permissions:
 

Provisioning: Tasks

Task Configuration:
 
NAME

Name of the Task

CODE

Unique code name for api, cli, and variable reference

RESULT TYPE
  • Single Value
  • Key/Value Pairs
  • JSON
SCRIPT

Enter Bash Script to execute

restart Restart

Description:

Specifically for use in Workflows after a task that requires a restart, the Restart task executes a restart on the target Instance or Host. Morpheus will wait until the restart is complete to execute the next task in the workflow phase.

Target:

Instance or Host

Role Permissions:
 

Provisioning: Tasks

Task Configuration:
 
NAME

Name of the Task

CODE

Unique code name for api, cli, and variable reference

ssh SSH Script

Description:

Execute Bash script against IP specified in Task.

Target:

IP specified in Task

Role Permissions:
 

Provisioning: Tasks

Task Configuration:
 
NAME

Name of the Task

CODE

Unique code name for api, cli, and variable reference

RESULT TYPE
  • Single Value
  • Key/Value Pairs
  • JSON
IP ADDRESS

IP Address of the ssh task target

PORT

SSH port for ssh task target (22 default)

KEY

Select existing Keypair for key auth

USERNAME

Username for ssh task target

PASSWORD

Password for ssh task target

SCRIPT

Enter Bash Script to execute

WinRM Script

winrm

Description:

Execute Powershell script against IP specified in Task.

Target:

IP specified in Task

Role Permissions:
 

Provisioning: Tasks

Task Configuration:
 
NAME

Name of the Task

CODE

Unique code name for api, cli, and variable reference

RESULT TYPE
  • Single Value
  • Key/Value Pairs
  • JSON
IP ADDRESS

IP Address of the WinRM task target

PORT

SSH port for WinRM task target (5985 default)

USERNAME

Username for WinRM task target

PASSWORD

Password for WinRM task target

SCRIPT

Enter Script to execute

Task Management

Adding Tasks

  1. Select the Provisioning link in the navigation bar.
  2. Select Automation from the sub-navigation menu.
  3. Click the Add button.
  4. From the New Task Wizard input a name for the task.
  5. Select the type of task from from the type dropdown.
  6. Input the appropriate details dependent on the task type you selected from the dropdown.
  7. Save

Editing Tasks

  1. Select the Provisioning link in the navigation bar.
  2. Select Automation from the sub-navigation menu.
  3. Click the Edit icon on the row of the task you wish to edit.
  4. Modify information as needed.
  5. Click the Save Changes button to save.

Deleting Tasks

  1. Select the Provisioning link in the navigation bar.
  2. Select Automation from the sub-navigation menu.
  3. Click the Delete icon on the row of the task you wish to delete.

Task Results

Overview

Task Results allow Tasks to use the output from preceding Tasks in the same Workflow phase via results variables.

Results are available for all tasks executed in the same phase in a workflow. For example, instead of using just one Tasks results in another Task, we can use all of the Task Results from the tasks in the same provision phase in a single task inside a workflow.

Configure Tasks

In script type tasks, if RESULT TYPE is set, Morpheus will store the Task’s output as a variable.

Results Types

  • Single Value
    Entire task output is stored in <%=results.taskCode%> or <%=results["Task Name"]%> variable.
  • Key/Value pairs
    Expects key=value,key=value output. Entire task output is available with <%=results.taskCode%> or <%=results["Task Name"]%> variable (output inside []). Individual Values are avilable with <%=results.taskCode.key%> variables.
  • JSON
    Expects key:value,key:value json formatted output. Entire task output is available with <%=results.taskCode%> or <%=results["Task Name"]%> variable (output inside []). Individual Values are avilable with <%=results.taskCode.key%> variables.

Important

The entire output of a script is treated as results, not just the last line. Ensure formatting is correct for the appropriate result type. For example, if Results Type is json and the output is not fully json compatible, the result would not return properly.

Important

Task results are not supported for Library Script task types

Script Config Examples

Single Value using Task Code:
 
Source Task Config
NAME

Var Code (single)

CODE

single

RESULT TYPE

Single Value

SCRIPT

echo "string value"

Source Task Output

string value

Results Task using task code in variable
Results Task Script

echo "single: <%=results.single%>"

Results Task Output

single: string value

Single Value using Task Name:
 
Source Task Config
NAME

Var Code

CODE

none

RESULT TYPE

Single Value

SCRIPT

echo "string value"

Source Task Output

string value

Results Task using task name in variable
Results Task Script

echo "task name: <%=results["Var Code"]%>"

Results Task Output

task name: test value

Key/Value Pairs:
 
Source Task Config
NAME

Var Code (keyval)

CODE

keyval

RESULT TYPE

Key/Value pairs

SCRIPT

echo "flash=bang,ping=pong"

Source Task Output

flash=bang,ping=pong

Results Task for all results
Results Task Script

echo "keyval: <%=results.keyval%>"

Results Task Output

keyval: [flash:bang, ping:pong]

Results Task for a single value)
Results Task Script

echo "keyval value: <%=results.keyval.flash%>"

Results Task Output

keyval value: bang

JSON:
Source Task Config
NAME

Var Code (json)

CODE

json

RESULT TYPE

JSON

SCRIPT

echo "{\"ping\":\"pong\",\"flash\":\"bang\"}"

Source Task Output

{"ping":"pong","flash":"bang"}

Results Task for all results
Results Task Script

echo "json: <%=results.json%>"

Results Task Output

json: [ping:pong, flash:bang]

Results Task for a single value
Results Task Script

echo "json value: <%=results.json.ping%>"

Results Task Output

json value: pong

Multiple Task Results:
 
Results Task Script
echo "single: <%=results.single%>"
echo "task name: <%=results["Var Code"]%>"
echo "keyval: <%=results.keyval%>"
echo "keyval value: <%=results.keyval.flash%>"
echo "json: <%=results.json%>"
echo "json value: <%=results.json.ping%>"
Results Task Output
single: string value
task name: string value
keyval: [flash:bang, ping:pong]
keyval value: bang
json: [ping:pong, flash:bang]
json value: pong

Workflow Config

Add one or multiple tasks with Results Type configured to a workflow, and the results will be available to all tasks in the same phase of the workflow via the <%=results.variables%> during the workflow execution.

  • Task Results are only available to tasks in the same workflow phase
  • Task Results are only available during workflow execution

Workflows

Add Workflow

  1. Select the Provisioning link in the navigation bar.
  2. Select Automation from the sub-navigation menu.
  3. Click the Workflows tab to show the Workflows tab panel.
  4. Click the Add button.
  5. From the New Workflow Wizard input a name for the workflow.
  6. Optionally input a description.
  7. Expand the execution phases to add tasks to, and type the name of a created task and click the task when it appears to add.
  8. If multiple tasks are added to the same execution phase, their execution order can be changed by selecting the grip icon and dragging the task to the desired execution order.
  9. For multi-tenant environments, select Public or Private visibility for the Workflow.
  10. Click the Save Changes button to save.

Workflow Execution Phases

For VM’s, Pre-Provision and Provision execute after the VM is running. Pre-Provision can be used for a blueprint so it is added before a script set at the Provision phase executes. Pre-Provision for scripts is mainly for Docker as you can execute on the host before the container is up. Post-Provision will execute after the entire provisioning process is complete.

Edit Workflow

  1. Select the Provisioning link in the navigation bar.
  2. Select Automation from the sub-navigation menu.
  3. Click the Workflows tab to show the workflows tab panel.
  4. Click the Edit icon on the row of the workflow you wish to edit.
  5. Modify information as needed.
  6. Click the Save Changes button to save.

Delete Workflow

  1. Select the Provisioning link in the navigation bar.
  2. Select Automation from the sub-navigation menu.
  3. Click the Workflows tab to show the workflows tab panel.
  4. Click the Delete icon on the row of the workflow you wish to delete.

Executions

Automation - Executions contains execution status and history from Task and Operational Workflow Executions run from Automation - Tasks and Automation - Workflows.

Note

Tasks and Workflows executed from a Job or from Instance or Host Actions do not populate in Automation -> Executions, and can be referenced from the History tab on the target resource. All task and Workflow executions can be referenced in Operations -> Activity -> History

Execution results in the ui display:

NAME
Name of the Task or Workflow Executed
TYPE
Type of execution (Task or Workflow)
START DATE
Date and time of execution
ETA/DURATION
Estimate time of completion for executions in progress, or the total execution time for completed executions.
RESULTS
Result status of execution (Succeeded, Failed, In-Progress or Pending)
Execution Detail (i)

Click on the i to view process output results

Note

Job and automation executions can be expanded to show process details by clicking on the arrow icon immediately to the right of the NAME column.

Scale Thresholds

Scale Thresholds are pre-configured settings for auto-scaling Instances. When adding auto-scaling to an instance, existing Scale Thresholds can be selected to determine auto-scaling rules.

Creating Scale Thresholds

  1. Navigate to Provisioning -> Automation -> Scale Thresholds
  2. Select + ADD
  3. Populate the following:
NAME
Name of the Scale Threshold
AUTO UPSCALE
Enable to automatically upscale per Scale Threshold specifications
AUTO DOWNSCALE
Enable to automatically downscale per Scale Threshold specifications
MIN COUNT
Minimum node count for Instance. Auto-scaling will not downscale below MIN COUNT, and will auto upscale if the MIN COUNT is not met)
MAX COUNT
Maximum node count for Instance. Auto-scaling will not upscale past MAX COUNT, and will auto downscale if MAX COUNT is exceeded.
ENABLE MEMORY THRESHOLD
Check to set auto-scaling by specified memory utilization threshold (%)
MIN MEMORY
Enter MIN MEMORY % for triggering downscaling.
MAX MEMORY
Enter MAX MEMORY % for triggering upscaling.
ENABLE DISK THRESHOLD
Check to set auto-scaling by specified disk utilization threshold (%)
MIN DISK
Enter MIN DISK % for triggering downscaling.
MAX DISK
Enter MAX DISK % for triggering upscaling.
ENABLE CPU THRESHOLD
Check to set auto-scaling by specified overall CPU utilization threshold (%)
MIN CPU
Enter MIN CPU % for triggering downscaling.
MAX CPU
Enter MAX CPU % for triggering upscaling.

Integrations

The Integrations section in Provisioning -> Automaton -> Integrations is for adding and managing Automation Integrations. Existing Automation Integrations from Administration -> Integrations are also populated and accessible from Provisioning -> Automaton -> Integrations and vice-versa.

Provisioning: Automation Integrations and Admin: Integrations are separate Role permissions, so Automations Integration access can be separated from the Administration Integrations section.

Automation Integrations

  • Ansible
  • Ansible Tower
  • Chef
  • Puppet
  • Salt

Note

Automation integrations can be added and managed in Administration -> integrations as well. Adding and editing Integrations in Provisioning -> Automaton -> Integrations and Administration -> Integrations are the same dataset and additions and updates are reflected in both sections.

Note

Role access for Integrations: Ansible determines user access to Ansible Integration detail page, which contains Ansible command line and execution access.

Power Scheduling

Set weekly schedules for shutdown and startup times for Instances and VM’s, apply Power Schedules to Instances pre or post-provisioning, apply Power Schedule policies on Group or Clouds, or use Guidance to automatically recommend and apply optimized Power Schedules.

Create Power schedules

  1. Navigate to Provisioning -> Automation -> Power Scheduling

  2. Select + ADD

  3. Configure the following options:

    NAME

    Name of the Power Schedule

    DESCRIPTION

    Description for the Power Schedule

    TIME ZONE

    Time Zone the Power Schedule times correlate to.

    TYPE
    Power On

    Power Up and then Down at scheduled times

    Power off

    Power Down then Up at scheduled times

    Enabled

    Check for Power Schedule to be Active. Uncheck to disable Power Schedule.

    DAYS

    Slide the start and end time controls for each day to configure each days Schedule. Green sections indicate Power on, red sections indicate Power Off. Time indicated applies to selected Time Zone.

    ../../_images/powerSchedule.png
  4. Select SAVE CHANGES

Tip

To view the Instances a power schedule is currently set on, select the name of a Power Schedule to go to the Power Schedule Detail Page.

Add Power Schedule to Instance

  1. Navigate to Provisioning -> Instances
  2. Select an Instance
  3. Select EDIT
  4. In the POWER SCHEDULE dropdown, select a Power Schedule.
  5. Select SAVE CHANGES

Add Power Schedule to Virtual Machine

  1. Navigate to Infrastructure -> Hosts -> Virtual Machines
  2. Select a Virtual Machine
  3. Select EDIT
  4. Expand the Advanced Options section
  5. In the POWER SCHEDULE dropdown, select a Power Schedule.
  6. Select SAVE CHANGES

Add Power Schedule Policy

Note

Power Schedule Policies apply to Instances created after the Policy is enabled.

  1. Navigate to Administration -> Policies

  2. Select + ADD

  3. Select TYPE Power Schedule

  4. Configure the Power Schedule Policy:

    NAME

    Name of the Policy

    DESCRIPTION

    Add details about your Policy for reference in the Policies tab.

    Enabled

    Policies can be edited and disabled or enabled at any time. Disabling a Power Schedule Policy will prevent the Power Schedule from running on the Clouds Instances until re-enabled.

    ENFORCEMENT TYPE
    • User Configurable: Power Schedule choice is editable by User during provisioning.
    • Fixed Schedule: User cannot change Power Schedule setting during provisioning.
    POWER SCHEDULE

    Select Power Schedule to use in the Policy. Power schedule can be added in Provisioning -> Automation -> Power Scheduling

    SCOPE
    Global

    Applies to all Instances created while the Policy is enabled

    Group

    Applies to all Instances created in or moved into specified Group while the Policy is enabled

    Cloud

    Applies to all Instances created in specified Cloud while the Policy is enabled

    User

    Applies to all Instances created by specified User while the Policy is enabled

    Role

    Applies to all Instances created by Users with specified Role while the Policy is enabled

    Permissions- TENANTS

    Leave blank to apply to all Tenants, or search for and select Tenants to enforce the Policy on specific Tenants.

  5. Select SAVE CHANGES

Execute Scheduling

Execute Scheduling creates Schedules for Jobs, including Task, Workflow and Backup Jobs.

Schedules use CRON expressions, such as 0 23 * * 2 equalling Executes every week on Tuesday at 23:00. CRON expressions can easily be created by clicking the corresponding translation in the create or edit Execution Schedule modal below the Schedule field and selecting a new value.

Create Execution Schedules

NAME

Name of the Schedule

Note

When assigning Execution Schedules, the Name will appear in the selection drop-down. Using a name that references the schedule is advised.

DESCRIPTION
Description of the Execution Schedule for reference in the Execution Schedules list
TIME ZONE
Time zone for execution
Enabled
Check to enable the schedule. Uncheck to disable all associated executions.
SCHEDULE
Enter CRON expression for the Execution Schedule. Example 0 0 * * * equals Every day at 00:00 (default)
SCHEDULE TRANSLATION
The entered CRON schedule is translated below the SCHEDULE field. Highlighted values can be updated by selecting the value, and relevant options will be presented. The CRON expression will automatically be updated.

Variables

The following are the map structures passed to scripts and templates during provisioning inside of a <%= %> block.

Variables can also be passed in Naming Policies using ${ } block.

Important

Variables are case sensitive

PowerShell Example: $app_id = "<%= instance.metadata.app_id %>"

Bash Example: HOSTNAME="<%= container.server.hostname %>"

Python Example: hostname = container['server']['hostname']

HTTP Body Example: {"name": "<%= instance.createdByUsername %>"}

Instance Naming Policy example: ${userInitials}-${cloudCode}-${platform == 'windows' ? 'W' : 'L'}-${sequence}

Tip

Variables can be extremely useful when utilized in the environment tab, metadata, and environment variables.

../../_images/Metadata-Enviornment-Variable-Spot ../../_images/Tags-Variable-Spot

Note

customOptions values are defined from custom Option Types.

container.configGroup: <%=container.configGroup%>
container.configId: <%=container.configId%>
container.configPath: <%=container.configPath%>
container.configRole: <%=container.configRole%>
container.containerTypeCode: <%=container.containerTypeCode%>
container.containerTypeName: <%=container.containerTypeName%>
container.containerTypeShortName: <%=container.containerTypeShortName%>
container.cores: <%=container.cores%>
container.dataPath: <%=container.dataPath%>
container.dateCreated: <%=container.dateCreated%>
container.domainName: <%=container.domainName%>
container.environmentPrefix: <%=container.environmentPrefix%>
container.externalIp: <%=container.externalIp%>
container.hostMountPoint: <%=container.hostMountPoint%>
container.hostname: <%=container.hostname%>
container.image: <%=container.image%>
container.internalHostname: <%=container.internalHostname%>
container.internalIp: <%=container.internalIp%>
container.logsPath: <%=container.logsPath%>
container.memory: <%=container.memory%>
container.planCode: <%=container.planCode%>
container.provisionType: <%=container.provisionType%>
container.server: <%=container.server.serverTypeName%>
container.serverId: <%=container.serverId%>
container.sshHost: <%=container.sshHost%>
container.status: <%=container.status%>
container.storage: <%=container.storage%>
container.version: <%=container.version%>
customOptions: <%=customOptions.fieldName%>
evar: <%=evars.name%>
evars: <%=evars%>
group.code: <%=group.code%>
group.datacenterId: <%=group.datacenterId%>
group.location: <%=group.location%>
group.name: <%=group.name%>
instance.autoScale: <%=instance.autoScale%>
instance.configGroup: <%=instance.configGroup%>
instance.configId: <%=instance.configId%>
instance.configRole: <%=instance.configRole%>
instance.containers[0]: <%=instance.containers[0].containerTypeName%>
instance.cores: <%=instance.cores%>
instance.createdByEmail: <%=instance.createdByEmail%>
instance.createdByFirstName: <%=instance.createdByFirstName%>
instance.createdById: <%=instance.createdById%>
instance.createdByLastName: <%=instance.createdByLastName%>
instance.createdBYUsername: <%=instance.createdByUsername%>
instance.deployGroup: <%=instance.deployGroup%>
instance.description: <%=instance.description%>
instance.displayName: <%=instance.displayName%>
instance.domainName: <%=instance.domainName%>
instance.environmentPrefix: <%=instance.environmentPrefix%>
instance.expireDate: <%=instance.expireDate%>
instance.firewallEnabled: <%=instance.firewallEnabled%>
instance.hostname: <%=instance.hostname%>
instance.instanceContext: <%=instance.instanceContext%> (tip: instanceContext = Environment)
instance.instanceLevel: <%=instance.instanceLevel%>
instance.instanceTypeCode: <%=instance.instanceTypeCode%>
instance.instanceTypeName: <%=instance.instanceTypeName%>
instance.instanceVersion: <%=instance.instanceVersion%>
instance.memory: <%=instance.memory%>
instance.metadata: <%=instance.metadata%>
instance.name: <%=instance.name%>
instance.networkLevel: <%=instance.networkLevel%>
instance.plan: <%=instance.plan%>
instance.provisionType: <%=instance.provisionType%>
instance.status: <%=instance.status%>
instance.statusMessage: <%=instance.statusMessage%>
instance.storage: <%=instance.storage%>
instance.tags: <%=instance.tags%>
instance.userStatus: <%=instance.userStatus%>
server.agentInstalled: <%=server.agentInstalled%>
server.agentVersion: <%=server.agentVersion%>
server.apiKey: <%=server.apiKey%>
server.category: <%=server.category%>
server.commType: <%=server.commType%>
server.configGroup: <%=server.configGroup%>
server.configId: <%=server.configId%>
server.configRole: <%=server.configRole%>
server.consoleHost: <%=server.consoleHost%>
server.consolePort: <%=server.consolePort%>
server.consoleType: <%=server.consoleType%>
server.consoleUsername: <%=server.consoleUsername%>
server.dataDevice: <%=server.dataDevice%>
server.dateCreated: <%=server.dateCreated%>
server.description: <%=server.description%>
server.displayName: <%=server.displayName%>
server.domainName: <%=server.domainName%>
server.externalId: <%=server.externalId%>
server.externalIp: <%=server.externalIp%>
server.fqdn: <%=server.fqdn%>
server.hostname: <%=server.hostname%>
server.internalId: <%=server.internalId%>
server.internalIp: <%=server.internalIp%>
server.internalName: <%=server.internalName%>
server.internalSshUsername: <%=server.internalSshUsername%>
server.lastAgentUpdate: <%=server.lastAgentUpdate%>
server.lvmEnabled: <%=server.lvmEnabled%>
server.macAddress: <%=server.macAddress%>
server.managed: <%=server.managed%>
server.maxCores: <%=server.maxCores%>
server.maxMemory: <%=server.maxMemory%>
server.maxStorage: <%=server.maxStorage%>
server.name: <%=server.name%>
server.nodePackageVersion: <%=server.nodePackageVersion%>
server.osDevice: <%=server.osDevice%>
server.osType: <%=server.osType%>
server.osTypeCode: <%=server.osTypeCode%>
server.parentServerId: <%=server.parentServerId%>
server.plan: <%=server.plan%>
server.platform: <%=server.platform%>
server.platformVersion: <%=server.platformVersion%>
server.powerState: <%=server.powerState%>
server.serialNumber: <%=server.serialNumber%>
server.serverModel: <%=server.serverModel%>
server.serverType: <%=server.serverType%>
server.serverTypeCode: <%=server.serverTypeCode%>
server.serverTypeName: <%=server.serverTypeName%>
server.serverVendor: <%=server.serverVendor%>
server.softwareRaid: <%=server.softwareRaid%>
server.sourceImageId: <%=server.sourceImageId%>
server.sshHost: <%=server.sshHost%>
server.sshPort: <%=server.sshPort%>
server.sshUsername: <%=server.sshUsername%>
server.status: <%=server.status%>
server.statusMessage: <%=server.statusMessage%>
server.tags: <%=server.tags%>
server.toolsInstalled: <%=server.toolsInstalled%>
server.visibility: <%=server.visibility%>
task.results (using task code): <%=results.taskCode%>
task.results (using task name): <%=results["Task Name"]%>
task.results.value: <%=results.taskCode.key%>
zone.agentMode: <%=zone.agentMode%>
zone.cloudTypeCode: <%=zone.cloudTypeCode%>
zone.cloudTypeName: <%=zone.cloudTypeName%>
zone.code: <%=zone.code%>
zone.domainName: <%=zone.domainName%>
zone.firewallEnabled: <%=zone.firewallEnabled%>
zone.location: <%=zone.location%>
zone.name: <%=zone.name%>
zone.regionCode: <%=zone.regionCode%>
zone.scalePriority: <%=zone.scalePriority%>
cypher: <%=cypher.read('secret/hello')%>
        instance {
                autoScale,
                configGroup,
                configId,
                configRole
                containers:[],
                cores,
                deployGroup,
                description,
                displayName,
                domainName,
                environmentPrefix,
                evars:[],
                expireDate,
                firewallEnabled,
                hostname,
                instanceContext,
                instanceLevel,
                instanceTypeCode,
                instanceVersion,
                memory,
                metadata:[],
                name,
                networkLevel,
                plan,
                provisionType,
                status,
                statusMessage,
                storage,
                tags,
                tenantSubdomain,
                userStatus,
                instanceTypeName
        }

.. code-block:: bash

        container {
                configGroup,
                configId,
                configPath,
                configRole,
                containerTypeCode,
                containerTypeShortName,
                cores,
                dataPath,
                dateCreated,
                domainName,
                environmentPrefix,
                externalIp,
                hostMountPoint,
                hostname,
                image,
                internalHostname,
                internalIp,
                logsPath,
                memory,
                planCode,
                provisionType,
                server:{},
                serverId,
                sshHost,
                status,
                storage,
                version,
                containerTypeName
        }
server {
        agentInstalled,
        agentVersion,
        apiKey,
        category,
        commType,
        configGroup,
        configId,
        configRole
        consoleHost,
        consolePort,
        consoleType,
        consoleUsername,
        dataDevice,
        dateCreated,
        description,
        displayName,
        domainName,
        externalId,
        externalIp,
        fqdn,
        hostname,
        internalId,
        internalIp,
        internalName,
        internalSshUsername,
        lastAgentUpdate,
        lvmEnabled,
        macAddress,
        managed,
        maxCores,
        maxMemory,
        maxStorage,
        name,
        nodePackageVersion,
        osDevice,
        osType,
        osTypeCode,
        parentServerId,
        plan,
        platform,
        platformVersion,
        powerState,
        serialNumber,
        serverModel,
        serverType,
        serverTypeCode,
        serverTypeName,
        serverVendor,
        softwareRaid,
        sourceImageId,
        sshHost,
        sshPort,
        sshUsername,
        status,
        statusMessage,
        tags,
        toolsInstalled,
        visibility,
        volumes {
                name
                id
                deviceName
                maxStorage
                unitNumber
                displayOrder
                rootVolume
        }
}
zone {
        agentMode,
        cloudTypeCode,
        cloudTypeName,
        code,
        datacenterId,
        domainName,
        firewallEnabled,
        location,
        name,
        regionCode,
        scalePriority
}
group {
        code,
        location,
        datacenterId,
        name
}
customOptions {
        customOptions.fieldName
}