Creating and Configuring a Generic Application Resource

Creating and Configuring a Generic Application Resource

Rate This
  • Comments 12

Windows Server 2008 (and R2) Failover Clustering supports virtually every workload which comes with Windows Server, however there are many custom and 3rd party applications which take advantage of our infrastructure to provide high-availability.  Additionally there are some applications which were not originally designed to run in a failover cluster.  These can be created, managed by and integrated with Failover Clustering using a generic container, with applications using the Generic Application resource type.  For more information about cluster-unaware applications, visit http://msdn.microsoft.com/en-us/library/aa369166(VS.85).aspx.

We use the Generic Application resource type to enable such applications to run in a highly-available environment which can benefit from clustering features (i.e. high availability, failover, etc.).
When a generic application resource is online, it means that the application is running. When a generic application is offline, it means that the application is not running.

 

How to Create/Configure a Generic Application Resource


In this post, we will cover how to create and configure a generic application resource using the following methods:

1.       High Availability wizard

2.       PowerShell cmdlets (“command-lets”)

3.       Cluster.exe command-line tool (to be deprecated after Windows Server 2008 R2)

We will be using notepad.exe as an example.  Notepad is the application that we would like to make highly available.

Checklist


Before creating a generic application resource, please review the checklist at below link.

http://technet.microsoft.com/en-us/library/cc782179.aspx

Cluster Configuration


I have a 2-node cluster running Windows Server 2008 R2. Cluster name is A1C1F4X64.

Name of my cluster nodes are:

1.       A1C1F4X64N1

2.       A1C1F4X64N2

Below is a partial screenshot of Failover Cluster Manager.

 

Create a Generic Application Resource Using the High Availability Wizard


Now I will walk you through the High Availability wizard of Failover Cluster Manager to create a generic application resource.  Below are the steps:

1.       Launch Failover Cluster Manager from Start menu. Connect to the cluster.

2.       Right click on Services and applications, and click on Configure a Service or Application…

 

 

 

3.       High Availability Wizard appears. After reading the information presented on Before You Begin page, click Next.

 

 

 

4.       On Select Service or Application page, select Generic Application and click Next.

 

 

 

5.       On Generic Application Settings page:

-          For Command line, enter the name of the executable. In our example, it is notepad.exe.

-          For Parameters, enter the parameters that are supplied to the executable. We will leave it blank indicating that notepad.exe is not taking any additional parameters.

 

Click Next.

 

6.       On Client Access Point page, we will be providing input for the network name and IP addresses that clients will be using when accessing our highly available generic application.  I am choosing a network name (A1C1F4X64GApp) and a static IP address suitable for my network configuration.

 

Click Next.

 

 

7.       On Select Storage page, you have an option to choose a disk for the generic application. If your generic application needs a disk resource, you can select a disk. In my example notepad.exe is not going to use any disk. So, I am not selecting any disk.

 

Click Next.

 

8.       On Replicate Registry Settings page, add the registry keys that your application will be using/updating. Once added, the registry keys will be replicated on all cluster nodes so that the application is functional on all nodes of the cluster.  In our example, notepad.exe is not going to use any registry key.  Hence we are not providing any information on this page.

 

Click Next.

 

9.       On Confirmation page, verify that the information is correct. If you need to make modifications, you can use Previous button to go back to earlier pages in the wizard and modify the information.

 

                Click Next.

 

10.   The Wizard should successfully create the generic application resource and bring the resource online. Summary page appears.

 

11.       On Summary page, you can click on View Report… button. This will show you detailed report of what actions were taken to create the generic application resource.

 

 

The report can also be located under %SystemRoot%\Cluster\Reports directory for later viewing.

 

12.       Click Finish to complete the High Availability wizard.

13.       Locate the newly created item (A1C1F4X64GApp) under Services and applications. This is the container (also known as the group) for the generic application resource.

 

Above image shows that group A1C1F4X64GApp is online on node A1C1F4X64N2.  The name of the generic application resource is “notepad Application”.
Tlist command on A1C1F4X64N2 shows that a process for notepad.exe is running.

 

 

Create a Generic Application Resource Using PowerShell Cmdlets 

I will now show you how to use PowerShell cmdlets to create generic application resources.  PowerShell is new to Failover Clustering in Windows Server 2008 R2 and will replace Cluster.exe in the next release (more information about WSFC PowerShell). The cmdlets that we need to achieve this are: Get-Cluster and Add-ClusterGenericApplicationRole.

If we are running PowerShell on a machine that is not part of the cluster, we have to retrieve the cluster object first using the Get-Cluster cmdlet.

Once we retrieve the cluster object, the object can then be passed to Add-ClusterGenericApplicationRole cmdlet.

If we are running PowerShell on a clustered node, Get-Cluster cmdlet may be omitted and Add-ClusterGenericApplicationRole can be used directly.

In this case cluster object will be retrieved from the local node (i.e. the node where the command is executing).

Here is an example (Note that A1C1F4X64 is our cluster name):

PS C:\Windows\system32> Get-Cluster A1C1F4X64 | Add-ClusterGenericApplicationRole -CommandLine notepad.exe -Name A1C1F4X64GApp -StaticAddress 172.24.11.96

Report file location: C:\Users\wolfpack\AppData\Local\Temp\tmpA662.tmp.mht

Name                         OwnerNode                        State
----                         ---------                        -----
A1C1F4X64GApp                a1c1f4x64n2                      Online

 

For additional help, run this PowerShell cmdlet:

Get-Help Add-ClusterGenericApplicationRole

The following command will show you samples:

Get-Help Add-ClusterGenericApplicationRole -examples

 For complete information use:

Get-Help Add-ClusterGenericApplicationRole -full

 

Create a Generic Application Resource Using Cluster.exe

Cluster.exe is another command line tool that can be used to administer a cluster, however Windows Server 2008 R2 is the final release, so it is recommended to use PowerShell to create new scripts and utilities.  Cluster.exe will coexist with PowerShell in Windows Server 2008 R2, however you will be able to see that PowerShell significantly simplifies the process.

Below is a sample script that creates and onlines a generic application resource. 

REM Store cluster name in a variable

set ClusterName=A1C1F4X64

 

REM Create a group and online it

cluster %ClusterName% group GenAppGroup /create

cluster %ClusterName% group GenAppGroup /on

 

REM Create a IP address resource, set required properties, and online it

cluster %ClusterName% res GenAppIP /create /group:GenAppGroup /type:"IP Address"

cluster %ClusterName% res GenAppIP /priv address=172.24.11.96 SubnetMask=255.255.255.0

cluster %ClusterName% res GenAppIP /on

 

REM Create a network name, set properties, set dependency on the IP resource, and online it

cluster %ClusterName% res GenAppNN /create /group:GenAppGroup /type:"Network name"

cluster %ClusterName% res GenAppNN /priv Name=%ClusterName%-NN

cluster %ClusterName% res GenAppNN /setdep:"[GenAppIP]"

cluster %ClusterName% res GenAppNN /on

 

REM Create a generic application resource, set the properties, and online it

cluster %ClusterName% res GenAppRes /create /group:GenAppGroup /type:"Generic Application"

cluster %ClusterName% res GenAppRes /prop RestartAction="0"

cluster %ClusterName% res GenAppRes /priv CommandLine=notepad.exe

cluster %ClusterName% res GenAppRes /priv CurrentDirectory=.

cluster %ClusterName% res GenAppRes /on

 

The script does the following:

1.       Creates and onlines a group called GenAppGroup.

2.       Creates an IP address resource called GenAppIP in group GenAppGroup.  Sets Address and SubnetMask properties of the resource.  Brings the IP resource online.

3.       Creates a network name resource called GenAppNN.  Sets the Name property of the network name resource, sets the dependency of the network name to the IP resource, and brings the network name online.

4.       Finally, it creates the generic application resource called GenAppRes, sets the properties, and brings the resource online.

 

Resources

·         Generic Application Resource Type - http://technet.microsoft.com/en-us/library/cc782775.aspx

·         Cluster-Unaware applications - http://msdn.microsoft.com/en-us/library/aa369166(VS.85).aspx

·         Checklist: Installing a Generic Application resource - http://technet.microsoft.com/en-us/library/cc782179.aspx

·         Windows Clustering - http://msdn.microsoft.com/en-us/library/aa373130(VS.85).aspx



In the upcoming weeks I will be adding posts about creating and configuring Generic Services and Generic Scripts.

 

Regards,
Daud Howlader
Software Development Engineer in Test
Clustering & High Availability
Microsoft Corporation

Leave a Comment
  • Please add 7 and 6 and type the answer here:
  • Post
  • With Windows Server 2008 (and R2) Failover Clustering you can make almost anything highly-available.

  • PingBack from http://workfromhomecareer.info/story.php?id=33405

  • For Replicate Registry Settings, If I and a Root Registry Key, what is the direction of the registry update? (e.g from active node to passive node). And how often will the registry update?

  • Hello,

    How do you use this highly available notepad application? Is there a way to see the window to type in?

    Thanks.

  • Hi Peter,

    Good question - this blog article describes how to configure a Generic Application Resource - in this case, there is not way to actually use the Notepad.exe application that the cluster will run and make Highly Available (HA) for you. Notepad.exe is usually present, so it was used as the example application. A better example would have been a back-up program or service that does not have a UI, and therefore would not have generated this question...

    Many Thanks, Peter !!!

    -Rob.

  • Hi Rob,

    In a server 2003 cluster the application would be visible on the desktop so that you could interact with it. Is this been broken in Server 2008 R2? The first issue I can see it's running as SYSTEM. So I have been trying to work around this using runas but I still can't get it to work.

    Is there anyway of working around this?

    Cheers

    Mark.

  • Hi Mark,

    Thanks for your note - actually there's not a way to run the Notepad application and use it interactively on the Desktop. The Blog article was intended to show the steps required for configuring a Generic Application. In my discussions with the team, it is clear that there is no way to interact with the application.

    A question that we have is - how useful would it be to use a program that is both interactive and has HA failover behavior? What would some common uses be?

    Many Thanks, Mark!!!

    -Rob.

  • With 2003 clustering we use the CMD generic application to open and execute software upgrades for instance.

    In Windows 2008 clustering the CMD has no interaction with desktop why does this function not work anymore?

    Followed notepad and would expect it to open also interactively.

  • Hi DH and Mark,

    Upon further research and discussions, I see that this DID indeed work with Windows Server 2003 - it was possible to create a clustered application, and the checkbox "Allow application to interact with desktop" was respected. When logged-in to the default desktop Session (Session 0), and using the Cluster Service Account, it was possible to interact with the application, and the application would fail-over when the node that it was running on went down.

    This behavior was discontinued in Windows Server 2008 for several reasons:

    (1) This feature was understood to be used very rarely.

    (2) It may have introduced a security issue in a specific situation.

    (3) There are problems saving any data that is being processed by the application, since the cluster was not able to prompt the user to save data before failing over.

    (4) Moving the group that contains the application becomes difficult because of (3).

    (5) Users really needing this behavior are better served by writing a resource DLL for their application.

    This being said, there are scenarios such as DH mentions above for updating software, and also for testing application configuration and behavior (such as MSMQ) where this behavior is useful.

    I am making a list of these scenarios so that we understand the behavior that customers would like to see with their clusters - if you have a scenario where interaction with a clustered desktop application is useful, please let me know here, or directly by email - use the "Email Blog Author" link on the Blog homepage.

    Many Thanks, DH and Mark !!!

    -Rob.

  • Hi Rob,

    This blog post answers a similar question that I had. In my case, I am trying to integrate legacy applications into a clustered server environment. The existing UI is integral to monitoring and troubleshooting the application. Seeing as how the ability to interact with the desktop has been removed, I may have to write a custom resource DLL that can independently launch the legacy applications.

    In the meantime then, my question becomes whether it is possible to launch generic applications under a separate domain user account, or must it run under the Cluster's local system account?

    Thanks,

    -Mike

  • The Interact with Desktop option was removed several releases ago back in Windows Server 2008 as part of a security hardening effort.

    There is no way to run the cluster service under another user context.  If you application requires credentials on the wire, then you need to handle impersonation in your application.

    Thanks!

    Elden

  • We have 2003 2 node clusters running plant production and shipping applications that have SQL server running on 1 node and the apps with GUI interfaces on the other node. They are configured so that if either node has a failure the failing node apps or database will switch to the other node. We are attempting to upgrade our apps to 2012 cluster, but we cannot get our apps to show on the owner node's desktop. These apps (.exe programs) must display status (i.e. Hand Held scanner status) and allow some user input such as pause, restart, etc. Is there any way around this issue without writing a lot of new code. We currently have 5 such clusters in our plants. Please reconsider allowing applications to interact with the desktop on new clusters.

Page 1 of 1 (12 items)