Sun Update Connection - Enterprise 1.0 User's Guide

Chapter 11 Complex Jobs

This chapter explains how to manage hosts in the most consistent and efficient manner. Complex jobs are not difficult to create or use; they are complex because they combine several objects into one command from the user interface to the system dependency server. Complex jobs maintain consistency throughout the environment and to make sure that even the most complicated lifecycle management missions are orderly and error-free. Complex jobs allow you to include multiple tasks, each task combining a set of objects and operation options.

This chapter covers the following topics:

Terms

This chapter uses the following terms:

Agent

Application of Sun Update Connection – Enterprise that is installed on every managed host and that runs the Dependency Resolver, finding solutions specific to its host.

Cost-effective

Deployment solution that has the least requirements for number of dependency issues, time, and resources, to fulfill a job.

dependency manager (DM)

Sub-system of the Sun Update Connection – Enterprise system dependency server, responsible for managing jobs on hosts and communications between the user interface and agents.

dependency resolver (DR)

Set of patented algorithms to describe a solution for a job. Initiated by agent application when a job is received.

Mode

Job option that determines whether the job changes hosts (Deploy) or tests the action list on hosts (Simulate).

Job

Collection of actions and tests to be run on selected managed hosts by agents.

Knowledge Base

Sub-system of the Sun Update Connection – Enterprise system dependency server, acts as a proxy server for the universal server, keeping dependency rules for CO deployment on managed hosts and the COs themselves.

A local knowledge base is a private, on-site only, collection of NCO listings and their deployment rules as generated by the Local Expansion technology.

Policy

Set of confirmation rules for the implementation of the dependency resolver and level of automation of jobs.

Profile

Definition of a component configuration for a type of machine; what is required and what is not allowed to be installed on this type of machine.

system dependency server (SDS)

The complete management system for Sun Update Connection – Enterprise. Its sub-systems include the Server, the dependency manager, and the knowledge base.

Task

Part of a job that contains a profile, a hostlist, a policy, an optional schedule, and performance options.

Complex Job Processes

You create a single job to be run on one or multiple hosts. Each agent that receives the job runs it individually, optimizing on the software configuration of the host.

To fulfill a job, an agent uses rules and components from the knowledge base. The agent runs the dependency resolver, which takes into account installed inventory, selected policy, and selected profile.

The dependency resolver is a set of algorithms that describes the best possible solution for an agent to complete a job. The best possible solution includes:

When you create a job, the agent of each selected managed host picks up the job and runs the following processes. Each agent performs these actions only for the components of its distribution-architecture; irrelevant components are ignored. Therefore, you can safely create a multiple distribution job and send it to a mixed group of hosts.

The job process of each agent, for each task, is as follows:

Post-Fix Actions

A post-fix action is a binary that performs an action on hosts when a specific package has been installed. Sun Update Connection – Enterprise runs post-fixes without user intervention. Post-fixes ensure machine functionality after changes.


Example 11–1 Using Post-Fix Actions

You create a job that upgrades the kernel. Before the job ends, a post-fix action is triggered, which updates the boot-loader file for the new kernel version.


Agent Queuing

While an agent is running a job, it cannot perform other Sun Update Connection – Enterprise actions:

Complex Job Objects

A complex job is made up of one or more tasks, a schedule, and a set of performance options. At the time that you create the job, you set the schedule (see To Set Job Schedules) and the options (see To Set Job Options). On the other hand, you may create the objects of the tasks either on the fly, as you create the tasks, or before you begin to create the job.

A task needs a profile:

A task needs a policy:

A task needs a hostlist:

Creating Complex Jobs

In the following procedures, you will select the objects and options of a job and then run the job on selected hosts.

Before you begin a job on a Solaris machine, make sure the PKG deployment preferences are appropriate for your local needs. See Host Preferences – PKGs on Host Preferences – PKGs.

This procedure is broken up into the following parts:

ProcedureTo Set Up the Objects of a Job

  1. Make sure the Jobs panel is available in the main window by choosing Jobs from the View menu.

  2. Do one of the following:

    • From the tool bar, click the New Job button.

    • Right-click in the Jobs list and choose New Job.

    • From the Jobs menu, choose New.

      The New Job window opens.

  3. Give the job a name and a free-text description.

  4. Select a mode for the job:

    • Deploy – Perform the tasks on the selected hosts

    • Simulate – Test the job to estimate time and full action list

      A user may be restricted to executing jobs only in Simulate mode.

  5. Do the following:

    1. Create tasks for the job.

      See To Create the Tasks of a Job.

    2. Set job options or leave the default settings.

      See To Set Job Options.

    3. Set a schedule or leave the default Now schedule.

      See To Set Job Schedules.

ProcedureTo Create the Tasks of a Job

  1. In the Tasks tab of the New Job window, click Add Task.

    The Task Editor opens.

  2. Type a name for a task.

  3. Select a profile from the drop-down list, or click the profile editor button to open the Profile Editor and create a new profile.

    If you select a user-defined profile and then click the button, you can edit an existing profile.

  4. Select a policy from the drop-down list, or click the policy editor button to open the Policy Editor, to create or edit a policy as you would a profile.

  5. Click the Hosts button to the right of the Hosts field.

    The Select Hosts window opens.

  6. Select hosts and groups and then click the Add button.

    The hosts or groups are added to the Selected Hosts list.

  7. When the Selected Hosts list contains the hosts or groups that you want to receive this job, click OK.

    The Hosts window closes. The selected hosts and groups appear in the Hosts field of the Tasks tab.

  8. Click OK.

    The task is added to the Tasks list of the job. Add as many tasks as you want.

    The order of the tasks in the list is the order that they will be executed. To change this order, select a task name and click the Up or Down buttons.

    To edit a task, select the task and click the Edit button.

    To remove a task from the job, select the task and click the Delete button.

  9. Decide how to continue:

    • If you want to run the job with default settings, click OK now.

    • If you want to set a deployment schedule, go to To Set Job Schedules.

    • If you want to view and edit the job options, go to To Set Job Options.

    • If you want to save the tasks as a job template, click Save Template.

ProcedureTo Set Job Schedules

  1. Open the Schedule tab.

    This screen capture shows the Schedule tab of the New Job window.
  2. Select a schedule type:

    • Single – have the job run at a future date and time.

    • Recurring – have the job run on a recurring basis.

ProcedureTo Set a Single Schedule

  1. Select Single.

  2. In the Time text box, select the hour and the minutes.

    Type in the desired time, or use the arrows to change the selection.The time settings are by 24 hours: 13:00 = 1pm, 14:00 = 2pm, ... 00:00 = midnight.

  3. Click the button to the right of the Date box.

    The Calendar opens.

  4. Select a date and then click OK.

    The Calendar closes. The selected date appears in the Date field.

  5. In the New Job window, click OK or set job options.

    See To Set Job Options.

    The job will begin on the selected time and date.

ProcedureTo Set a Recurring Schedule

  1. Select Recurring.

  2. In the Month drop-down list, select either Every Month (all year schedule) or a specific month (monthly schedule).

  3. Select days of the month:

    • Every day – Job runs every day of the month, or year (if Every Month was selected).

    • Day in week – Select the days of the week on which the job will be run.

    • Day in month – Select dates in the month on which the job will be run.

  4. Select time of the day:

    • Earliest – Set a time (hour:minutes) for the first run of the job.

    • Interval – Set a minute interval, to have the job run multiple times during a day.

    • Latest – Set a time for the latest run of the job, if an interval for multiple runs was selected.

ProcedureTo Set Job Options

  1. Open the Options tab.

    This screen capture shows the Options tab of the New Job window.
  2. Select Use Secure Components only if you want to give priority to secure versions. Deselect it to give priority to cost-effective versions, which makes the job run faster.

  3. If you set a recurring schedule for the job, decide how the job should be handled if selected profiles and policies are changed between now and the next run of the job.

    Option 

    Selected Function 

    Deselected Function 

    Notify of changes 

    If the owner of the profiles or policies changes them, you will get an email notification. Select if using profiles/policies that other users created. 

    You are not notified of changes. Deselect if you own the selected profiles or policies and do not want the reminder emails. 

    Accept changes before next run 

    Use updated profiles or policies. Select for consistency and automation. 

    Use the profiles or policies as they were when you created the job. Deselect for predictability. 

  4. Specify how you want the task to run in relation to other tasks and how to handle failures.

    Option 

    Selected Function 

    Deselected Function 

    Parallel 

    Run the job simultaneously with other jobs. Do not run jobs that depend on the results of other jobs in parallel. Run such jobs in sequential mode only.

    Run the job after the previous job completed. By default, a job is run sequentially. 

    Sequential 

    Run the job after other jobs have completed. 

    Run the job in parallel mode. 

    Continue on failure 

    Continue to run a job even if one of the steps or tasks experienced a failure. This option is only available for jobs that run in sequential mode. 

    Terminate a job if a step or task experiences a failure. 

    Priority 

    Select or change a priority for ajob. Values are Low, Medium, and High. 

    By default, the priority is set to Medium. 

Running a Job with the CLI

The CLI command to submit a job runs one task on a single selected host or group. See Submit Job (-sj) Command.


#! /bin/bash 

echo -n “Enter your user name:” 
read user 
echo -n “Enter your password:” 
read password 

echo -n “Type a name for this job:” 
read jobname 
echo -n “Do you want to run this job on a host or a group? (h|g):” 
read hostgroup 
if [ $hostgroup = “h” ];then 
  echo “Hosts are:” 
  uce_cli -lah -u “$user” -p “$password” 
else 
  echo “Groups are:” 
  uce_cli -lg -u “$user” -p “$password” 
fi 
echo -n “Copy host or group name to receive job:” 
read selected 

echo “Profiles are:” 
uce_cli -lp -u “$user” -p “$password” 
echo -n “Copy profile to use:” 
read profile 
echo “Policies are:” 
uce_cli -lc -u “$user” -p “$password” 
echo -n “Copy policy to use:” 
read policy 

echo “Simulating $jobname” 
uce_cli -sj -j “$jobname” -P “$profile” -C “$policy” -$hostgroup “$selected” 
   -us -sm -u “$user” -p “$password” 
echo -n “Do you want to deploy $jobname? (y|n)” 
read yes 
if [ $yes = “y” ]; then 
  uce_cli -sj -j “$jobname Deployed” -P “$profile” -C “$policy” -$hostgroup 
  “$selected” -us -dp -u “$user” -p “$password” 
fi

Saving Job Templates

ProcedureTo Save a Job Template

After you have set up the objects of a job, you can save it as a template. Using a job template, you can run the job, with or without edits, whenever you want. Use this procedure if you have the job requirements, but are unsure of when it should be run, or if the hosts are not yet online.

  1. Open the New Job window and create tasks.

    If you want, you can set a schedule and select options.

  2. With any tab of the New Job window open, click Save Template.

    Sun Update Connection – Enterprise saves the job without running it, and sends you a message when the save is complete.

    The template name appears in the Jobs list, with an icon to indicate that it is not a running job.

    To create a job from the template, select the template and then right-click and select Rerun. Select Deploy or Simulate and then click OK.

Copying Jobs

ProcedureTo Copy a Job

You can use a job to be the base of another job. Use this procedure if you have a complex job that would fulfill new requirements with a few changes, rather than creating a new job.

  1. In the Jobs list, select a job to use as the source and then right-click and select Copy.

    The New Job window opens with the objects and settings of the selected job.

    The profile is listed as Based on <source profile> from <date time>. This is to notify you that the job will be based on the profile as it was at the date and time that the source job was created. If the profile has been changed since then, this new job will not reflect those changes.

    If the profile is listed as Task’s Profile, the job was not a complex job. It was created by applying job settings to inventory components. You can make a copy of this job, but you cannot view its ToDo basket.

  2. Make any changes to the job that you want and then click OK.

    The job is added to the Jobs list and begins according to its schedule settings.


    Note –

    If you do make changes to the copied job, there is no indication in the Job list. See the Job Log for details of how the changes were translated into actions.


Creating Complex Jobs

ProcedureTo Create a Simple Complex Job

This procedure is a specific example of executing Complex Jobs. This example is of a very simple job. You could follow it even if you have not yet created profiles, policies, and groups.

  1. Make sure the Jobs panel of the main window is open by choosing Jobs from the View menu.

  2. From the tool bar, click the New Job button.

    The New Job window opens.

  3. Name the job CheckAllHosts. In the description, type This job checks all hosts for missing dependencies.

  4. Select Simulate.

    This job will find any missing dependencies on any of the hosts and give you an idea of how long the actual job would take.

  5. In the Tasks tab, click Add Task and a task with:

    • Name: SingleCheck

    • Profile: Check System

    • Policy: Always ask me

    • Hosts: All Hosts

  6. Click OK in the Tasks tab.

    The SingleCheck task is added to the job.

  7. Click OK in the New Job window.

    The job is sent to all managed hosts. Each host will be checked to see whether it has any missing or conflicting dependencies.

  8. Check the progress of the hosts as they run the job, and the job log of each host when it is done.

    See To Monitor a Current Job.

    If the results of the simulation are satisfactory, rerun the job in Deploy mode. See To Rerun a Job.

    The DR finds a solution to fix any missing or conflicting dependencies. You will be asked to confirm the fixes before they are deployed. See To Confirm Tasks). On confirmation, the actions are carried out and all dependencies are fixed on all hosts.

ProcedureTo Create a Feature-Rich Complex Job

This procedure is a specific example of using the Complex Job feature. This example is of a more feature-rich job.

This example assumes the following:

  1. Make sure the Jobs panel of the main window is open by choosing Jobs from the View menu.

  2. Click the New Job button.

    The New Job window opens.

  3. Name the job: NFS Environment.

    In the description, type This job provisions NFS servers and NFS clients.

  4. Select Deploy.

    As the profiles are your own or the predefined profiles for system management, you have a good idea of what will be done on the hosts; you do not need to simulate the job before deploying it.

    Before anything is changed on any host, Sun Update Connection – Enterprise saves its inventory. If you do not like the results of the job, you can easily restore it to its previous inventory. See Restoring Managed Hosts.

  5. In the Tasks tab, click Add Task and a task with:

    • Name: IntegrityCheck

    • Profile: Check System

    • Policy: AutoFix

    • Hosts: nfs servers and nfs clients groups

  6. Click OK.

    The IntegrityCheck task is added to the job.

  7. Add another task:

    • Name: ProvisionNfsServer

    • Profile: NfsServer

    • Policy: Always ask me

    • Hosts: nfs servers groups

  8. Click OK.

    The ProvisionNfsServer task is added to the job.

  9. Add another task:

    • Name: NfsClient

    • Profile: NfsClient

    • Policy: Always ask me

    • Hosts: nfs clients groups

  10. Click OK.

    The ProvisionNfsClients task is added to the job.

    Now you have a job with three tasks: check hosts for missing dependencies, provision the NFS server profile on the nfs servers group, and then provision the NFS client on the nfs clients group.

    Let’s set a schedule for this job. If the job is run on a recurring basis, it will make sure that the hosts in the web servers group always comply with the web server profile. If they do comply, nothing is changed and the job finishes on success. If there has been an error in change management, the recurring run will find it.

  11. Open the Schedule tab.

  12. Select Recurring.

  13. Select Every Month.

  14. Select Day in week, and then select Monday.

  15. Set Earliest to 7:00.

    The job will now run every Monday, early in the morning. Let’s look at the job options now.

  16. Open the Options tab.

  17. Select Use secure components only.

  18. If you are the owner of the profiles and of the AutoFix policy, you can leave the Notify of changes option deselected. They cannot be changed by any other user.

  19. Select Accept changes before next run.

    If the requirements of an NFS server change, you need only change the profile once. This option ensures that the job will automatically use any changes you make to the profile.

    You now have a re-usable job, with multiple tasks to be run on multiple hosts in a specific order, according to what is relevant to the inventory, distribution, and hardware architecture of each managed host. The job has a schedule. You will be notified by email if there are any tasks to do or if a host goes down. The job options have been set to optimize this specific set of tasks. To execute the job, click OK in the New Job window.