Creating and Configuring a Generic Application Resource

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:

–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.

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-ClusterGenericApplicationRolecmdlet.

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

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

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

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…

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.

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?

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.

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?

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.