Windows Server Summit 2024
Mar 26 2024 08:00 AM - Mar 28 2024 04:30 PM (PDT)
Microsoft Tech Community
LIVE
Creating and Configuring a Generic Application Resource
Published Mar 15 2019 01:36 PM 7,723 Views
Microsoft
First published on MSDN on Apr 09, 2009

Windows Server 2008 (and R2) Failover Clustering supports virtually every workload which comes with Windows Server, however there are many custom and 3 rd 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.       A1C1F4X64 N1


2.       A1C1F4X64 N2


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 (A1C1F4X64 GApp ) 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 (A1C1F4X64 GApp ) under Services and applications . This is the container (also known as the group) for the generic application resource.




Above image shows that group A1C1F4X64 GApp is online on node A1C1F4X64 N2 .  The name of the generic application resource is “notepad Application”.
Tlist command on A1C1F4X64 N2 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 A1C1F4X64 GApp -StaticAddress 172.24.11.96


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


Name                         OwnerNode                        State
----                         ---------                        -----
A1C1F4X64 GApp a1c1f4x64 n2 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

Version history
Last update:
‎Mar 15 2019 01:36 PM
Updated by: