When To Create a Resource DLL

One of the most common questions about cluster programming is: Should I create a resource DLL to manage my [application or other resource], or can I use the Generic Application or Generic Service resource type?

This section is intended as a guide toward answering that question. For procedures and examples of creating a resource DLL, see Creating Resource Types.

To answer the question, keep in mind that one of the goals of clustering is high availability of resources. failover clusters depend on resource DLLs to maintain resource availability. Resource DLLs do the actual work of bringing resources online, taking resources offline, checking for failure, processing control codes, and performing other management tasks.

Therefore, the question of whether to create a resource DLL can be rephrased as follows: Can the Generic Application or Generic Service resource types maintain high availability for my resource?

The Generic Application and Generic Service resource types provide very basic implementations of the entry point functions. They start and stop their resources simply by starting and terminating a process, and look for resource failure by checking if the process still exists. They do not support resource-specific private properties or user-defined control codes.

Use the following checklist to determine whether you need to create a resource DLL:

  • If your resource is a device, you should create a resource DLL. This is especially true of storage class devices. The Generic resource types are not designed to manage hardware.
  • If your resource is an application or service, you should create a resource DLL if any of the following statements are true:
    • The resource depends on other resources, such as storage class devices, file shares, and so on.
    • The resource manages critical transaction-based or state-dependent data.
    • The resource requires special initialization procedures.
    • The resource requires special shutdown or emergency termination procedures.
    • The resource has unique attributes that would be best managed as private properties.
    • The resource offers special functionality that you want to expose through a user-defined control code.

If your resource is stateless, has no dependencies or special functionality, and can be started and stopped easily, then the Generic Application or Service resource type is adequate for managing the resource. Otherwise, to ensure high availability, you should create a resource DLL. For procedures and examples, see Creating Resource Types.