Workflow Steps Reference
This topic provides details on Commander's built-in workflow steps. Administrators can always access built-in steps in any Commander installation.
Commander also supports plug-in workflow steps that you may download and install as required. Plug-in steps are not covered here. For details on plug-in steps, see the readme files included with the plug-in step JAR files added to your system at <Commander_install_directory>\tomcat\wfplugins\
. See Use Plug-In Workflow Steps.
Overview
The steps that can be added to a workflow depend on the type of workflow. For example, in the Approval Workflow, Completion Workflow, and Command Workflow wizards, the executable steps, or actions, that can be added a workflow depend on:
- The type of workflow (for example, whether it's a workflow for a virtual service versus a VM, or a workflow for a new request versus a change request).
- The cloud account type (for example, SCVMM or AWS).
Adding actions to a workflow is optional. For some scenarios it may make sense to create a workflow without actions. For example:
- You can set up an approval and pre-provisioning workflow whose only purpose is to deploy VMs and virtual services automatically.
- You can set up a completion workflow that overrides a default completion workflow. For example, let's say you have set up a default VM completion workflow to run every time a new VM is provisioned, but you don't want that workflow to run on one or more specific VMs. In this case, you can configure a VM completion workflow that contains no steps — its only purpose is to override the default VM completion workflow.
Built-in Commander workflow steps
Email workflow stepsThese steps are supported for all service types.
Workflow Step | Description | Available in |
---|
Send Approval Email | Notify one or more "approvers", people with authority to approve the service request. Can be a Commander user, a Service Portal user or an email address. For more information, see Workflow steps that send an email. Limitation: When you add a Send Approval Email step to a command workflow, request comments may not appear on the approval landing page. | |
Send Acknowledgement Email | Notify people who must take an action before next steps can be carried out. For example, you could use this step to make sure that an administrator has installed and updated an anti-virus program before performing subsequent software installations. Emails sent using a send email step are used for notification purposes only, and don't allow recipients to acknowledge an action has been completed. See also Workflow steps that send an email below. Important: To ensure that the information such as CPU count, MAC address and cost are complete and accurate in acknowledgment emails, add a "Wait for event" step to the beginning of the completion workflow. In the Wait For drop-down menu, select an option as follows: - If VMware Tools is installed, Service to obtain IP address is the recommended option. You can also select Service to obtain DNS name or Service to obtain IP address and DNS name.
- If VMware Tools isn't installed, or for a non-vCenter VM, select Time to Elapse. Specify sufficient time for the hypervisor or cloud to update all properties changed by Commander.
Acknowledgment emails will display a service cost if the user accounts associated with the target email addresses have a role that contains the "Show Cost" Service Portal permission. A service cost is also displayed if no accounts are associated with the email addresses. A service cost isn't displayed if the user accounts associated with the target email addresses don't have the "Show Cost" permission. | |
Send Email | Send an email (other than an approval or acknowledgment email). See Workflow steps that send an email below. You can choose either plain text format (the email will include only the information you specify in this step) or HTML format (the email will also include all details of the service request). | |
Quota workflow stepsWorkflow Step | Description | Available in |
---|
Quota Approval Email | Send a quota-based approval email or reject a request automatically when quota is exceeded. For more information, see Configure a Quota-Based Service Request Approval Process. In an approval workflow for a change in VM ownership or organization assignment, the Quota Approval step must appear after the Approval Email step. | |
VM action workflow stepsWorkflow Step | Description | Available in |
---|
Perform Power Action | Perform one of the following: - Start
- Stop
- Shutdown guest OS and stop
- Reset (for a database, executes a Reboot command)
- Shutdown guest OS
- Reset guest OS
Not all power actions are supported for all cloud accounts. See Manage Service Power States for details. These steps are supported only for VMs, except for Reset, which is also supported for databases. | |
Perform Remove Action | Perform one of the following:
- Remove From Inventory — supported for VMs and virtual services on vCenter cloud accounts
- Delete From Disk — supported for all service types
When all VMs are deleted from a virtual service through a policy action (that is, when VMs are deleted by a policy action or by a command workflow attached to an expiry policy), the empty virtual service isn't automatically deleted unless it too is targeted by policy. | |
Script workflow stepsYou can specify that the value returned by the script be captured as a comment, thus determining whether the request is approved or rejected. When you capture script output as comment, you can use script output as the input to a subsequent Set Custom Attribute step. See Use Script Output as Input to Workflow Steps. Scripts in approval workflows can also set deployment parameters.
When configuring the command line for script steps (with the exception of an Execute Embedded Script), you must use an absolute path to the executable.
For script syntax, see Variable Syntax for Emails and Scripts.
These steps are supported for all service types.
Workflow Step | Description | Available in |
---|
Execute Script | Execute a script that's saved on the local system. See Add Execute Script workflow steps for more details on how to configure an Execute Script. | |
Execute Embedded Script | Execute a script, whose contents is provided in the workflow step rather than on disk. For this type of execute script, you must provide the entire script contents, rather than a path to the executable. See Add Execute Embedded Script workflow steps for more details on how to configure an Execute Embedded Script. | |
Execute Approval Script | Execute an approval script. If the script output returns exit code 0, the workflow proceeds to the next step; if the script returns exit code 1, the workflow fails, and the request is automatically rejected. | |
Execute SSH Command | Execute an SSH command on any host running the SSH service. Windows: This step requires elevated privileges. On Windows, if the credentials used are those of a member of the administrator group, as opposed to the actual administrator account itself, you will likely need to disable UAC (user access control) on your templates. Linux: If you supply non-root-user credentials, the user must be able to run sudo, and you must add sudo to the command line. This step doesn't automatically use sudo with non-root-user credentials. Commander supports interactive sudo prompts. You can use variables in the Host field of this workflow step. Any variable supported for the workflow type can be used. For releases 8.1 and later, you can set the port value using either a fixed integer or a variable. The default is port 22. | |
Execute REST call | Execute a REST call. See Make REST Calls Through Workflow Steps for more details. | |
Wait for Event workflow step Workflow Step | Description | Available in |
---|
Wait for Event | Allow one of the following events to complete before the next step is started:
- Guest OS customization to complete
- Guest OS to power on
- Service to obtain DNS name
- Service to obtain IP address
- Service to obtain IP address and DNS name
- Service to power off
- Service to power on
- Time to elapse
The available events depend on the workflow type. These events are supported for VMs only, except for Service to power on, which is supported for VMs, virtual services, databases and load balancers. IMPORTANT: The first step in a component-level completion workflow for a new VM should be a Wait for Guest OS to Power On step, so that variables such as IP addresses have values before other steps are run. For Windows VMs, it may take longer than the default 300 seconds (five minutes) to obtain an IP address and DNS name. You may want to use two steps: one that waits for guest OS customization to complete, and one that waits for IP address and DNS name. AWS: If you select Wait for Guest OS to Power On, Commander waits for the instance to completely initialize before continuing to completion workflows. SCVMM: If you select Wait for Guest OS to Power On, Commander checks the power state of the container, not the power state of the guest OS itself. Microsoft Azure: Only Service to power on and Time to elapse events are supported. | |
Guest OS workflow stepsThese steps allow you to customize a VM after deployment. For examples, see Automate VM Customization through Workflows. For troubleshooting, see Troubleshooting and auditing Guest OS workflow steps. These steps are supported for VMs only.
To execute Guest OS workflow steps, Commander first attempts to connect to VMs using VMWare Tools. If VMWare Tools is unavailable, Commander will attempt to execute Guest OS workflow steps using WMI for Windows machines, or SSH for non-Windows operating systems and Windows machines where WMI is unavailable.
If the Dynamic Resource Scheduling (DRS) automation level for a cluster is set to Fully Automated and VM-level DRS control is allowed, Commander temporarily disables DRS during post-deployment configuration for new VMs deployed into the cluster. Disabling DRS ensures that vSphere won't migrate a newly provisioned VM before customization is complete. DRS is re-enabled once the service is completed or the request is rejected. A Commander event is generated for the cluster when DRS is disabled, and again when it's re-enabled. This feature is supported for VMware 4.0 or higher.
Workflow Step | Description | Available in |
---|
Run Program | Execute a program in the guest OS after deployment. For example, use this step to install software, configure a router, or run a batch file. Output from the guest OS is captured and stored as a workflow comment. This step requires you to specify guest OS credentials. Windows: This step requires elevated privileges. On Windows, if the credentials used are those of a member of the administrator group, as opposed to the actual administrator account itself, you will likely need to disable UAC (user access control) on your templates. Linux: If you supply non-root-user credentials, the user must be able to run sudo, and you must add sudo to the command line, because this step doesn't automatically use sudo with non-root-user credentials. When connecting with VMware Tools (the default method for VMware VMs), Commander doesn't support interactive sudo. This means that if the remote system prompts for a password, the step just waits until the timeout is reached. When connecting with SSH, on the other hand, Commander supports interactive sudo. This means that Commander detects password prompts from the remote system and responds with the password, so the step can run its command. vCenter VMs: Commander uses VMware Tools to obtain the IP address and run the guest OS command; Open Virtual Machine Tools will also work. SCVMM: The latest guest integration services is required to obtain the IP address. To run the command in the guest OS, Commander uses WMI (for Windows) and SSH (for Linux). Microsoft Azure: The Run Program workflow step is supported only for Linux VMs with the SSH endpoint configured. Run Program steps executed on an Azure Windows VM will fail with the following error: VM "<vm-name>" has no valid network address: can't run guest command. Ports: See Port Requirements. | |
Copy File | Copy a file from a specified source on the Commander server to a specified destination on the target VM. You can use an absolute path referencing the file system (for example, C:\vcommander\scripts\updater.ps1 ) or a UNC path to a share. The credentials used must have access to read from and write to the source and destination, respectively. You can choose to overwrite the file if it already exists in the destination. The mechanism by which this action is undertaken is the same as described for the Run Program step. | |
Copy Uploaded File | Copy a file uploaded as part of a new service request to a specified destination on the target VM. This step works with the File Upload element on the service catalog blueprint form. If multiple File Upload form elements appear on the form, provide the Display Label of the associated form element in the Display Label field for the File Upload form element. Enter the absolute path to the location where the files will be uploaded on the VM. If the path doesn't exist and the credentials you provided have the associated permissions, the folder will be created. The file name provided by the user in the File Upload form element is preserved after upload. | |
Create File | Create a file on the guest OS. Similar to the Copy File step, but accepts file contents instead of pointing to a file location. Specify the credentials, the file contents, the destination location and whether to overwrite an existing file at the destination. The maximum file size is the size allowed for a text field for the type of database in use. This step accepts variables in the Contents field. For example, if your users need to upload a file as part of a service request, you can add an Input Text Field element to the request form and then enter the following variable in the Contents field of the Create File workflow step:
#{target.settings.inputField['field name']}
For example, if your Input Text Field form element is labeled Properties File, use the following variable:
#{target.settings.inputField['Properties File']}
This step follows the same rules as the Run Program step. | |
Configure Virtual Networking | Add a NIC and assign a virtual network. Supported for vCenter only. For public cloud VMs, this step is skipped and a comment is added to the log. For complete information, see Configure Virtual Networking Through Workflow Steps. | |
Configure OS Networking | Assign network settings in the guest OS. For complete information, see Configure OS Networking Through Workflow Steps. | |
Decommission Networking | Remove host records and DHCP reservations from BlueCat™ IPAM. This step is to be used when decommissioning a VM, if you have integrated with BlueCat™ IPAM. Note: If there is no record for the VM in BlueCat™ IPAM, the step will be marked as complete, and a comment will be added; it's not necessary to make this step conditional on BlueCat™ management. | |
Join Domain | Add a VM to a Windows domain without the need for a customization spec. For example, use this step to join a VM to a domain after all software has been installed; in this case, you would create a command workflow. This step requires Guest OS Credentials (in the Guest OS category) and Domain Credentials (in the System category). See credentials for more information. If Commander can't contact the VM using WMI, the step will fail. Windows: This step requires elevated privileges. On Windows, if the credentials used are those of a member of the administrator group, as opposed to the actual administrator account itself, you will likely need to disable UAC (user access control) on your templates. Enable Restart Guest OS if you want Commander to restart the guest OS as a part of this step. For vCenter, enabling this option causes the step to wait for VMware Tools (if installed) to be ready. For other cloud account types, enabling this option causes the step to wait for the VM to power on. Domain Name and OU: Enter the domain name and optionally the OU (organizational unit), or use variables. For example, you can allow users to specify the domain name on the request form as a custom attribute. Then you can use a variable to retrieve the domain name specified on the form. The Join Domain step isn't supported for fenced VMs. For non-Windows VMs, the step is skipped, with a comment added to the log; it's not necessary to make this step conditional on the guest OS. The Join Domain Guest OS workflow step may no longer work as expected due to Microsoft hardening changes in Distributed Component Object Model (DCOM). Alternatively, you can download and use the Join Domain plug-in workflow module from the Snow public Cloud Management Integrations repository on GitHub. For more information, see Use Workflow Modules. | |
Customize VM | Customize a vCenter VM by specifying a customization spec. You can select any customization spec available on the vCenter where the VM is deployed. This step can take input from a Configure OS Networking step when Commander is integrated with BlueCat™ IPAM. You can make this step conditional on the guest OS family, so that you use one customization spec for Windows, and one for Linux. You can also assign a customization spec to a service catalog component. To avoid collisions, choose one of these methods, not both. | |
Configure Puppet | Configure provisioned VMs using Puppet. The following Puppet actions are supported: - Authorize Node: Authorize communication between the Puppet master and the Puppet agent on this VM
- Set Classes: Set the classes for this node. Overwrites any existing classes.
- Set Environment: Set the environment for this node. The default environment is Production. Overwrites any existing environment.
- Set Groups: Set the node groups this node belongs to. Overwrites any existing groups.
- Set Variables: Set the variables for this node (name/value pairs). Overwrites any existing variables.
You can use the Execute SSH Command workflow step to pass commands to the Puppet master. If you use the Configure Puppet workflow step to assign classes and variables to a node, Commander creates a group with the same name as the node and pins the node to the group. A parent group named "vCommander" is also created to contain these self-named node groups. Note that Commander can remove pinned nodes, but not unpinned nodes, from a group. For Environment, Classes and Groups, when using this step in a completion workflow, you can access the values set in the service catalog (or on the request form, if applicable) by entering the following variables: #{target.settings.puppet.environment}
#{target.settings.puppet.classes}
#{target.settings.puppet.groups}
See Integrate Puppet with Commander for details and an example. | |
Configure Chef | Configure provisioned VMs using Chef. The following Chef actions are supported:
- Create Node (Roles and Recipes): Create a node on the Chef server for this VM and optionally set individual recipes and roles. The Recipes and Roles fields accept a comma-separated list of recipes and roles, respectively. For theRecipes and Roles fields, when using this step in a completion workflow, you can access the values set in the service catalog (or on the request form, if applicable) by entering the following variables, respectively:
#{target.settings.chef.recipes}
#{target.settings.chef.roles}
The variable #{target.settings.chef.runlist} can also be used to retrieve the requested roles and recipes. This step also outputs a private RSA key for the Chef client, which must then be copied to the target VM in a later step. See Edit the example completion workflows for new requests to learn how.
- Create Node (Run-List): Create a node on the Chef server for this VM and optionally set a run-list. The Run-List field accepts a comma-separated list of roles and recipes, in Chef run-list format. For example:
role[linux],recipe[logrotate],recipe[logrotate::global]
For the Run-List field, when using this step in a completion workflow, you can access the values set in the service catalog (or on the request form, if applicable) by entering the following variable: #{target.settings.chef.runlist} This step also outputs a private RSA key for the Chef client, which must then be copied to the target VM in a later step. See Edit the example completion workflows for new requests to learn how.
- Delete Node: Delete this node from the Chef server. You should always include this action in decommissioning workflows for Chef nodes, before the step that deletes the VM from disk.
- Set Recipes: Enter a comma-separated list of recipes for this node. Overwrites any existing recipes.
For the Recipes field, when using this step in a completion workflow, you can access the values set in the service catalog (or on the request form, if applicable) by entering the following variable: #{target.settings.chef.recipes} The variable #{target.settings.chef.runlist} can also be used to retrieve the requested recipes.
- Set Run-List: Enter a comma-separated list of recipes and roles in Chef run-list format. See the Chef documentation for syntax details. For example:
role[linux],recipe[logrotate],recipe[logrotate::global]
For the Run-List field, when using this step in a completion workflow, you can access the values set in the service catalog (or on the request form, if applicable) by entering the following variable: #{target.settings.chef.runlist}
See Integrate Chef with Commander for details and an example. | |
Lifecycle management workflow stepsUsing a workflow step to set metadata for a service can be a convenient shortcut. To ensure that the proper values are set, it's best practice to set metadata through policy or through a completion workflow, not both. The metadata values that are applied last are those that take effect. These steps are supported for all service types.
Workflow Step | Description | Available in |
---|
Set Ownership | Set the primary owner, IT contact and secondary owners for a service or component. | |
Set Expiry Date | Specify that the service or component will never expire, set a fixed expiry date, or set a date relative to when the workflow executes. | |
Set Custom Attribute | Set a value for a preconfigured custom attribute. You can create a command workflow that sets values for custom attributes required for VMs to be deemed compliant. You can then attach that command workflow to a tag compliance policy. Whenever a VM becomes uncompliant, the tag compliance policy will run the command workflow to reset the custom attribute values, automatically ensuring compliance. When you capture script output as comment, you can use script output as the input to a subsequent Set Custom Attribute step in the workflow. See Use Script Output as Input to Workflow Steps. | |
Set Groups | Set one or more of the following service group types for the component:
- Expiry
- Maintenance
- Power Schedule
- Rightsizing
When adding a Set Groups workflow step, you must specify the group types and then set their values:
- Click Add Groups to add one or more group types.
- In the Add Groups dialog, select the types of group you want to assign, and click OK. The group types you added appear in the workflow wizard.
- For each group type, make a selection from the drop-down menu.
See Manage Service Groups to learn about other methods for assigning service groups and which method is best for each situation. | |
Retry StepsWorkflow Step | Description | Available in |
---|
Retry Step | Retry Steps can be added after any workflow steps that you know may have trouble completing because of infrastructure issues. A Retry Step will retry a failed workflow step for a specific number of times. See Add Retry Steps to Workflows. | |
Workflow steps that send an email
In any workflow step that sends an email, enter the recipient email address(es) in the Address List field, keeping multiple addresses separated with semi-colons. The email addresses don't have to be associated with Admin Portal or Service Portal accounts. They can include group accounts.
When an email requesting approval for a service request is sent to a group of users, all users in that group receive the email.
If the Commander embotics.workflow.approval.link.auth.enabled
system property is set to true
, recipients will be required to authenticate with a valid user account that has the sufficient roles and permissions to gain access to the approval landing page. For more information on user roles and permissions, see Require user authentication to access approval email links; for information on setting the system property, see Advanced Configuration With System Properties.
As soon as one person approves a request, other users will no longer be able to approve that request. However, if multiple levels of approval are configured (for example, if the approval workflow contains multiple Send Approval Email steps), the approval email is sent to the next user group on the approvers list. If the request is rejected, no other emails are sent.
Using variables to populate email addresses
Using variables to populate email addresses allows you to configure dynamic recipient lists. For example, to send the email to the primary contacts of the organization, enter the following variable in the Address List field:
#{request.requester.organization.email}
You can pass other variables into the email address field, email subject and email body.
Formatting in the email body
The <a> tag is automatically added to links in emails (only the http protocol is supported). For example, if the value of a custom attribute is a link, the value will be formatted as a link in the email.
If you don't use HTML markup in the email body, the body is assumed to be plain text; <br> and <p> tags are automatically added for new lines.
If you add HTML markup to the email body, however, no additional tags are added.