Best Practices Guide > Controlled Computer Restart

Controlled Computer Restart

Guideline for a monitored computer shutdown and start.

General

Daily processing means that numerous tasks are executed on your hosts day and night. Running tasks are aborted if a computer shuts down unexpectedly. In order to avoid negative impacts, Automic recommends preparing the agentA program that enables the de-centralized execution of processes (such as deployments) on target systems (computers or business solutions) or a service that provides connectivity to a target system (such as for databases or middleware). An agent is also an object type in the Automation Engine. [Formerly called "Executor."] See also: host for shutdowns and restarts.

Preparations

The following basic rules apply:

1.

Ensure that no tasks are active when you shut down the computer.

2.

Execute a workflowAn object of the Automation Engine that can include several executable objects and which runs them in a specified order. [Formerly called "ProcessFlow" and "JobPlan."] that processes finishing tasks shortly before you shut down.

3.

Tasks should not start immediately after the agent has started.

4.

Instead, execute a workflow that processes some preparatory tasks.

The following objects and configurations are required in order to implement these criteria:

  1. The hostComputer, target system. characteristics include two settings that can be used to allow or prevent the start of tasks on an agent. These settings are WORKLOAD_MAX_FT and WORKLOAD_MAX_JOB. Jobs or file transfers do not start if the value "0" is specified in both of them. They wait until a positive value is specified. You can do so using the scriptA particular Automation Engine object type. statement :SET_UC_SETTING. Create two Script objects and specify the value "0" in one of them and a positive number or "UNLIMITED" in the other one. Use a script variableA placeholder for a value within a script. in order to assign the agent name to the statement :SET_UC_SETTING. In doing so, you can use the created Script objects for any number of agents.
  2. Create two workflows. One serves to process finishing tasks before the computer is shut down and the other one should be executed immediately after the computer has been restarted in order to process some preparatory tasks. Use the functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… MODIFY_UC_OBJECT in the scripts of both workflows in order to set them to "Ignore Agent Resource". This step is required because no other tasks must run at this time. "Ignore Agent Resource" then applies to all objects that are started by these two workflows.
  3. Ensure that no tasks are active before starting the finishing workflow. Create an Event objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task that uses the script function SYS_ACTIVE_COUNT in order to check in an interval of several minutes if there are active tasks on the agent. Activate this eventAction that is triggered if particular conditions apply. It can be an Automation Engine object type or an entry in a Policy Orchestrator EventBase. before you shut the computer down. It starts the finishing workflow as soon as there are no active tasks on the agent or activates a notificationAn Automation Engine object type used to send messages to users and user groups. [Formerly called "CallOperator."] if there are tasks that have not finished at this point in time. In both cases, the event can end itself using the script function CANCEL_UC_OBJECT.
  4. Create a separate AE agent variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. for the host characteristics. This variable can also be used for several agents. The variable UC_EX_HOSTCHAR  assigns them to the corresponding host characteristics. Set the default value for the host characteristics' validity keys WORKLOAD_MAX_FT and WORKLOAD_MAX_JOB  to "0" in order to prevent that tasks start immediately when the agent has been restarted. Enter the name of the workflow that should first be executed in the option EXECUTE_ON_START. This workflow's final taskAn executable object that is running. Tasks are also referred to as activities. must activate a script which sets a higher value than "0" for the settings WORKLOAD_MAX_FT and WORKLOAD_MAX_JOB in order to ensure that the regular processing of tasks can start.

Procedure

Before shutting down the computer:

After starting the computer:

 

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH