Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

How to get tasks to run on different machines as part of 1 job?

Created: 02 Jul 2012 | 1 comment

I have an overall job that I need to run that includes a couple different scripts to run on different machines.  Can anyone think of a good way to do this?

Full Disclosure: As part of Windows patching, I'm looking to automate the failover of a few SQL clusters so that we can minimize downtime while the servers reboot (and for a couple other reasons).  My initial idea when I realized that I couldn't assign tasks to different servers as part of a job was to use a NS task and PSEXEC listing each server and command.  That doesn't appear to be working as expected.  I'm now running thin on ideas and welcome yours...

Comments 1 CommentJump to latest comment

mclemson's picture

Can each of the tasks check the status of the cluster somehow?  It wouldn't proceed unless the entire cluster was online.  The first patch step for a server would be to disable itself so that it appears offline to the rest of the cluster.  The job condition would loop for 5 minutes at a time until the cluster is fully online, then it would take itself offline.

That just sounds kludgey though.  There are plenty of ways you could schedule tasks for multiple systems (create a scheduled task for each of four SQL servers in the cluster, schedule them for January 1, 2050, then create one job that runs on the NS and executes each scheduled task using tsksched /RUN {GUID of scheduled task} in order), but they don't accommodate checking the status of the SQL cluster.

Doesn't a SQL cluster have active and passive nodes?  You should be able to do something like this:

  1. Server A makes itself passive
  2. Server A kicks off Software Update cycle
  3. Server A reboots itself
  4. Server A makes itself active and Server B passive
  5. Server A notifies Server B to start (by telling it to run its script)
  6. Server B kicks off Software Update cycle
  7. Server B reboots itself
  8. Server B remains passive if Active/Passive cluster, or activates if Active/Active cluster

Wouldn't that work, where although Altiris is only running it on one system (Server A), server A allows it to be run on Server B by kicking off Server B at the right time?  Your task status to Altiris will end at Server A notifying Server B, however.

Mike Clemson, Senior Systems Engineer, ASC
Intuitive Technology Group -- Symantec Platinum Partner
intuitivetech.com