Creating a Command Workflow with a Custom Attribute
You can create a command workflow to back up a VM, set the VM backup time, and send an email to notify the VM owner that the VM has been backed up, and also provide the backup time in the email.
This topic explains how to:
- Run a script through a workflow.
- Set VM metadata using the output from a script step.
- Set up email notification through a workflow.
- Use variables to populate email addresses for notification.
Note: The following steps are similar for all workflow types.
Create a custom attribute
Before creating the workflow, create a custom attribute to store the VM's last backup time. You will set a value for the custom attribute in a workflow step.
- Click Configuration > Custom Attributes, and click Add.
- In the Configure Attribute wizard, enter a name for the attribute, such as "Last Backup Time".
These custom attributes can be displayed on the Details panel of the VM's Summary tab, so you should create user-friendly names.
- Select the Text type.
- Specify that the custom attribute should apply to Services, and click Next.
- On the Configure Attribute page, leave the default selection, and click Finish.
Create the command workflow
- Go to Configuration > Command Workflows.
- Click Add to create a new workflow.
- On the Name & Type page, do the following:
- Type a name for the workflow.
- From Target Type, leave the default value of VM.
- Click Next.
Last Backup Time), type the following value:
This syntax uses the output of Step 1 in the workflow to input a value for the custom attribute.
<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;
<p> tags are automatically added for new lines.
If you add HTML markup to the email body, however, no additional tags are added.