Have you used Sequential Tasks for Software Delivery Solution? For complex rollouts with updates, patches, and add-ons you want installed on target systems, Sequential Tasks are for you. Sequential Tasks can accomplish this with a single Policy configured to roll each piece out in order, with the ability to setup dependencies to ensure no execution occurs that has not had the prerequiste software installed first.
Introduction
Sequential Software Delivery Tasks can extend the functionality of Software Delivery Solution. Understanding how it works will help in configuring it the best way possible and avoid potential problems. This document also covers the technical details of how a Sequential Task works, from creation to execution on target Altiris Agent managed systems.
Sequential Task Configuration Details
Sequential Tasks have multiple executions associated with them. Sequential Tasks are linked to Package/Programs as line items. Each execution item links to a Package and Program much the same way a Task links to a Package and Program. Consider each of these line items as 'Tasks' within the Sequential Task. The following details outline the configuration and
General Tab
The following shows the main configuration screen for Sequential Tasks under the General tab. Many of the options are the same as standard Software Delivery Tasks and will only be covered lightly here.
- Execution Order: To add package-programs to the list of executing items, click the blue + to the right of the screen.
- NOTE! Selector dialog: This dialog shows no results by default so a search can be performed. You can search by Package Name or Program Name.
- SHOW ALL: To show all package and programs, check either option and click 'Search' to see the complete tree under the 'Package Folder:' section.
- Package-Program: Note the relationship of Package to Programs. If you check a package (Blue cube icon) it will select all Programs underneath. To avoid adding unintended Programs, select items by check the Program box (green check mark clipboard icon).
- Select all items you wish to execute in the Sequential Task, and then click OK.
- Dependencies -- The ability to create dependencies on the previously run Package/Programs hinges off successful completion of the task. If a task fails but the next task is not dependent on that completing successfully, it will subsequently run, continuing the 'chain' of Programs. Creating dependencies can avoid sequential failures for those items that require a successful run of a previous execution line-item in the Sequential Task.
Advanced Tab
The Advanced tab provides the same Altiris Agent Download and Execute options a regular Software Delivery Task supplies. This overrides the settings of the Altiris Agent Configuration Policy found in the Altiris Console at Configuration > Altiris Agent > Altiris Agent Configuration > select the Policy that applies to the target computers.
Software Portal Tab
This tab controls what Sequential Tasks show up in the Software Portal. The way Sequential Tasks are used in the Portal is different than standard Software Delivery items. Note that a regular Software Delivery Task does not have the Software Portal tab. That tab is reserved for the Packages directly. Thus regular Portal entries represent a Package > Program selection, where as Sequential Tasks are tied first to the Task, which automatically inherits all Packages and Programs contained therein.
Status Tab
This tab provides a reporting interface similar to a regular Software Delivery Task. If this tab does not fulfill your reporting needs, see the Sequential Reports found under the Reports tab, under Software Management, Software Delivery, Windows.
Best Practices
This section provides practical advice and Best approaches in using Sequential Task gleaned from working on issues associated with Sequential Tasks, and seeing what various customers have done to utilize this type of task.
Managing a Sequential Task
NOTE! IMPORTANT!! Modifying the "Execution Order:" items will require the Sequential Task to be assigned a new Task Guid, and that every subtask will also receive a new Task Guid. This means any system that already ran the Sequential Task will run it again if they still reside within the Collection. Please note the following:
- It is highly recommended you carefully plan the construction of the Sequential Task before rolling it out into production so you do not run into problems modifying the 'Execution Order:'.
- Modifications to the actual Package/Programs associated with the Sequential Task will not cause a new Guid to be generated. The actions that cause a new Guid generations are:
- Changing Execution Order -- Using the up and down errors to modify the order in which Programs execute
- Adding additional Programs -- Adding additional Package-Programs to the execution list.
- Removing Programs -- Removing Package-Programs from the execution list.
Conducting Reboots
When conducting a Reboot in the middle of a Sequential Task the Program configuration option 'After running the Altiris Agent should: Reboot' should execute the Reboot not the execution running (MSI or other Installer initiating the reboot).
This ensures that the status of the Sequential Task is properly written to the hard disk before the computer shuts down for the reboot. If the Task Synch Agent is unable to write the status down the Task Synch Agent will rerun previous steps according to the last time the Synchronization.xml file was saved.
Scripting for Conditions
By default a Sequential Task only has one type of condition. This condition is a dependency on the successful execution result of a previous task as configured in the Sequential Task. While there is some room to add different 'success' return codes to a Program and thus extend what qualifies as a successful run, this is the only condition available.
I am not a scripter, but many customers have created Programs that run a script instead of directly calling an EXE or MSI. For example, the script can conduct the following:
- Runs a command to see if a certain application and version is installed.
- If not, it runs a command to install it and repeats the steps.
- If yes, it installs an update to the program.
- This becomes one line item in the task.
Sequential Task Technical Details
As explained previously Sequential Tasks are a list of Package > Program execution line-items. The list of items to execute does not link to Tasks, but to the Package/Programs relationships.
The following steps detail how the Task is architected:
- A Sequential Task Guid is generated for the entire 'Task'. The task appears as such in the Altiris Agent's Client Policy XML file:
<Policy guid="{78939175-0C4A-4A55-A164-60DC888BDDC2}" name="Synchronization Task for Sequential Software Delivery Task : Sequential Task" version="6.0.6074.0">
<ClientPolicy agentClsid="Altiris.Synch">
<Task guid="{28193450-be96-46f7-954b-5ea2762a28f1}" priority="1" ExeName="" />
<Task guid="{c34568c9-dfc6-4e70-8fcd-11fc7440986c}" priority="2" ExeName="">
<Dependency guid="{28193450-be96-46f7-954b-5ea2762a28f1}" returncodes="0" />
</Task>
<TaskCreatedForSWPortal ReportFinalStatusToServer="False" />
<ValidPeriod after="2006-10-25 00:00:00" afterGMT="false" />
<Schedule ScheduleRetry="false">
<Schedule>
<Trigger Type="-1" Description="As soon as possible" />
</Schedule>
</Schedule>
</ClientPolicy>
</Policy>
- Note that the Task includes two Task Guids, listed in the XML snippet as <Task guid=. Each Task is generated when the Sequential Task is created and saved. These tasks are not viewable in the console, but have standard entries in the Client Policy XML.
NOTE! These Tasks very closely resemble standard Software Delivery Solution Tasks in the Database architecture. The Client Policy entries for the sub-tasks look like a standard Task, for example:
<Policy guid="{C34568C9-DFC6-4E70-8FCD-11FC7440986C}" name="Software Delivery Task for program : Sequential Task Program #2" version="6.0.6074.0">
<ClientPolicy agentClsid="Altiris.SWD">...etc...
- The naming convention is as follows for these subtasks: Software Delivery Task for program: <Name of the Program in the line-item within the Sequential Task>.
- The main Sequential Task is not executed by the standard AeXSWDAgent.dll (Altiris Agent built-in Software Delivery Agent), but is managed by the AeXTaskSynchAgent.dll (Task Synchronization subagent). The Task Synch Agent passes the Tasks to the core AeXSWDAgent.dll for execution.
- The Task Synch Agent keeps track of where in the Sequential execution list the client is at. This information is stored in the synchronization.xml file located at C:\Program Files\Altiris\Altiris Agent\Task Synchronization\. This file is loaded into memory by the Task Synch Agent, and changes are made at the memory level.
- At all status points the synchronization.xml file is written back to the hard disk (ie: Agent shutdown, end of Task within a sequence, after successful completion, etc).
- In the Agent UI you cannot access the Sequential Task, but only the individual Tasks within the Sequence, as shown:
Note the 'Application Tasks' section. This is the hidden Task created by the Sequential Task when create and saved. In other words there is no way to kick off a Sequential Task manually.
Other Considerations
The following items are for considerations when using Sequential Tasks.
- The longer the list of applications being installed, the greater chance for errors and failure, and the harder it is to test properly. Different OS, applications installed, and hardware configurations already natural add complexity to any base Software Delivery Task, but the complexity level deepens the more items are added to the Task sequence.
- Known Issue: Task looping amidst a reboot > The following KB details an issue where a reboot would set back the execution to a previous item already executed, which in turn would kick off the same reboot, causing a potentially unending loop of reboots and executions: https://kb.altiris.com/article.asp?article=28777&p=1. Software Delivery Solution 6.1 SP3 has this fix included, but if you are using a previous version to SP3 either apply the hotfix or upgrade to SP3.
Conclusion
If Sequential Tasks do not meet your needs, consider using the Software Delivery for Task Server Plug-in, which will be covered in another article. However Sequential Tasks are policy based and provide functionality that Task Server does not. As such the use case should be considered when deciding what mechanism would best work.