May 2007 - Posts

How to create a scheduled task within a Windows 2000/2003 Cluster

You have a need to run a procedure on the active node within a cluster. This procedure needs to occur at the same time each day. This procedure needs to run only on the active node for a given group. You are not alone; this is a very common request. The not so easy answer is below.

Modify Scheduled Jobs default location on all nodes

By default the scheduled job information is located in %systemroot%\tasks subdirectory. To work within a cluster the location needs to move to the shared disk.

Modify the following registry key so that the tasks folder location is pointed to the tasks subdirectory on the shared disk.

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SchedulingAgent

This key has the following value:  TasksFolder  reg_expand_sz
%SystemRoot%\Tasks  (change this path to task directory on the shared disk, I suggest you create a dedicated directory)

NOTE:  There may be an issue performing the work and test from a terminal server session as the jobs may initially fail.  Log off and back on terminal server (see KB 232276) and then the jobs will work.

Create the task on the active node in the cluster:

 

Go to Start-> Control Panel -> Scheduled Tasks -> Add Scheduled Task.  Follow the prompts, for Application use the path to the batch file or program.  Make sure you store the batch file or program on the shared disk.

Create a resource within the cluster:

 

1. Go into HKLM\SYSTEM\CURRENTCONTROLSET\SERVICES and write down the exact
name of the service as it shows in the list as you will need this for later. In this case it will be Schedule, but you could use this process for any service.


2. Go into Cluster Administrator and highlight the group you want to put this in and then right click on the group and choose New and Resource.


3. In the Name box, input whatever you want shown in Cluster Administrator, in the Description box, put whatever you want if anything or leave it blank, for the Resource Type field, choose Generic Service, in the Group field, it should already have the group you want and click Next.


4.  Make sure that all the nodes are listed as Possible owners and choose Next.


5. For dependencies, add the Disk and the Network Name and choose Next.
NOTE:  The Task Scheduler Generic resource must also be setup with a dependency on the physical disk and network name to prevent the resource from starting before the other resources are online.

6. For the Service Name field type Schedule, (or exactly what you wrote above for the name of the Service if different).  If it does not identically match, the service will fail to come online. For the Startup Parameters type %SystemRoot%\System32\svchost.exe -k netsvcs (you would normally leave this blank.  If the Service requires any parameters, it is generally in the registry for the service) and select the Use Network Name check box and choose Next.


7.  For the registry key, go ahead and add the complete exact path to the registry.  HKEY_LOCAL_MACHINE is a given, so you would use SOFTWARE\Microsoft\SchedulingAgent and then click OK and then Finish.
You can bring the resource online at this point. The Task Scheduler is changed from Automatic to Manual during the above process. If it is not, ensure that every node has the service set to manual.

Important Note for the remaining node(s):

The security credentials for each job are contained in the Protected Storage Database on the local node and not with the job.  So in order for a job to work on all nodes you need to refresh the credentials of the job on each node.  To do that, create the job on first node, set the credentials.
Move the generic service resource to the 2nd node and enter the credentials for the job again.  This issue is discussed in the following KB 317529 – Scheduled Task Does Not Run When You Push It to Another Computer.

 

Cluster Validation in Windows Server "Longhorn" - by Jim Teague

This session was great today and will be available online - https://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032336489&EventCategory=4&culture=en-US&CountryCode=US the event code is 1032336489.

 Here are the Q&A that may not be part of the rebroadcast:

 
Question:
Will Longhorn Cluster Validation include any application-specific best practice guidelines (i.e. Exchange)?
Answer:
The Longhorn Validation tool will test the core cluster requirements, there are tools available to test individual applications. Such as the Exchange Best Practice analyzer. In future releases we may make Validate extendable to include application plug-in's
Question:
what are the boundaries / limits for the network and disk I/O latencies?
Answer:
If networking exceeds 500 ms or if I/O latency exceeds 1 sec, it will generate a Warning. Cluster heartbeating and cluster presistent reservation timing is configurable in Longhorn. So you can evaluate the warning, and adjust your timing as necessary
Question:
Does the Validate tool report if the entire configuration is in the "Windows Server Catalog" as a Microsoft Certified Cluster
Answer:
In Windows Server Longhorn, we are radically changing the way we qualify clusters for supportablity. Validate will define supportability, we are moving away from the model of having clusters listed on the Windows Server Catalog
Question:
what kind of issues can be self healing?
Answer:
In Windows Server 2003 the way disks were identified was by the Disk Signature. In Longhorn clustered disks are identified by multiple attributes, including the Disk Signature and the SCSI Inquiry data. If a disk can't be found by one attribute, it will attempted to be found in another way. If found the service will self heal and update it's records of the disk. So in Longhorn disks will self heal and should elimate support issues of disk signatures changing and disks not coming online
Question:
can we achieve full hardware failover? how?
Answer:
Failover Clustering is loosely coupled clustering, services and applications can failover from one machine to another. This can be done with standard hardware
Question:
How are you working with the HW vendors so the HW we buy today is Longhorn Cluster Certified? When should we expect to see those certifications?
Answer:
We are actively working with all storage vendors to ensure Longhorn Cluster compatability. Most current shipping storage today is compatible. We recommend downloading beta 3 and trying out your hardware to verify compatibility, and talking to your hardware vendors.
Question:
Please provide hardware compatibility list for server in order to support Longhorn
Answer:
In Longhorn there will be no static list on the Windows Server Catalog that defines supportability. You use the Validate tool to test your hardware. If Validate passes, your solution is compatible and you are supported
Question:
Are there any virtual labs or other means to "try" out Longhorn clustering?
Answer:
You can download Beta 3 and try out clustering for yourself, see http://www.microsoft.com/getbeta3. We will also have a Longhorn Hands-on-Lab available with Tech-Ed '07, you will see it post after the event to http://www.microsoft.com/windowsserver2003/enterprise/clustering.mspx
Question:
Demo resolution is way too high...
Answer:
what is your resolution?
Question:
will the tool work on geo clusters?
Answer:
Yes, you can use Validate to test stretched clusters. Note: The storage tests will be skipped on clusters with no shared storage.
Question:
do virtual disks created by Microsoft virtual server support the presistent reservation, if it does not when will this be available?
Answer:
Virtual Server 2005 R2 uses a virtual parallel-SCSI adapter to cluster shared disks with Windows Server 2003. In Longhorn support for parallel-SCSI has been depricated, so you can not use the built in parallel-SCSI virtual adapters to create Longhorn clusters. You can use the Microsoft iSCSI Software Initator and a iSCSI target to create a Longhorn Clusters
Question:
Can we cluster GPT disks in Longhorn
Answer:
Yes, you can cluster GPT disks in Longhorn and with Windows Server 2003 that has Service Pack 2 and 919117 applied
Question:
When you say the validation is required, does that mean a failed validation will prevent going forward with a cluster build?
Answer:
You 'can' choose to bypass the Validation and create a cluster. Note: A cluster is not supported by Microsoft unless it passes Validate
Question:
Will there be corresponding updates to the cluster testing tools in the HCT (hardware compatibility test) tool for IHVs?
Answer:
Yes, we will ship a Cluster HCT kit in DTM for vendors to test solution. However, vendors will not be required to submit logs to Microsoft for inclusion on the Windows Server Catalog. It is for internal testing
Question:
Are there any plans for Longhorn clustering to support clustering of Virtual Servers, the Virtual Server role included with Longhorn?
Answer:
Yes, Longhorn will have extensive integration with with Failover Clustering and Microsoft Virtualization. Which will support failing over of VM's from one host to another with VERY fast failover times.
Question:
for Geo clusters, will they be supported even thou the storage check is skipped
Answer:
Yes, stretched clusters will be supported if the storage tests are skipped, this is expected with these types of configurations.
Question:
can the ClusPrep v2.0 tool be run multiple times over the lifecycle of the cluster for revalidation when needed?
Answer:
Yes, Validate can be run again... and is intended to be. If you make a change to your cluster (add a node, apply a new HBA driver, etc..) you then run Validate again to ensure the cluster works correctly. You can also use Validate as a diagnostic tool to troubleshoot clusters. Having problems failing over a disk?... Run validate and it should help give you information to troubleshoot the issue
Question:
Since this replaces the HCL, will the toool itself be supported? (In the past, Clusdiag and similar tools were not supported)
Answer:
Validate is built right into Windows Server and is a fully supported tool
Question:
Do both node need to be on line at the same time, when the cluster test is running
Answer:
Yes, when running Validate the machines that are going to be tested must be up and online to be tested
Question:
Can the tool be run against an already formed cluster? That is, will every test be able to be run? (previous betas of this tool required unformed clusters)
Answer:
Yes, you can run Validate on a configured cluster. The only catch is that in order for a disk to be tested, it must be Offline. So you can run Validate and run it on all disks, or a sub-set of the disks. Just bring the disks Offline to run Validate against them

New Clustering Blog in Town

 

http://msmvps.com/blogs/jtoner/

 

John Toner the long time clustering and Geo-Clustering Guru has a blog now. This is truly exciting news...

Posted by clustering | with no comments