Skip to content

Latest commit

 

History

History
200 lines (163 loc) · 5.82 KB

nf-clusapi-addclusterresourcedependency.md

File metadata and controls

200 lines (163 loc) · 5.82 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:clusapi.AddClusterResourceDependency
AddClusterResourceDependency function (clusapi.h)
Creates a dependency relationship between two resources.
AddClusterResourceDependency
AddClusterResourceDependency function [Failover Cluster]
PCLUSAPI_ADD_CLUSTER_RESOURCE_DEPENDENCY
PCLUSAPI_ADD_CLUSTER_RESOURCE_DEPENDENCY function [Failover Cluster]
_wolf_addclusterresourcedependency
clusapi/AddClusterResourceDependency
clusapi/PCLUSAPI_ADD_CLUSTER_RESOURCE_DEPENDENCY
mscs.addclusterresourcedependency
mscs\addclusterresourcedependency.htm
MsCS
37f173f3-514e-434b-8531-d308c6233a24
12/05/2018
AddClusterResourceDependency, AddClusterResourceDependency function [Failover Cluster], PCLUSAPI_ADD_CLUSTER_RESOURCE_DEPENDENCY, PCLUSAPI_ADD_CLUSTER_RESOURCE_DEPENDENCY function [Failover Cluster], _wolf_addclusterresourcedependency, clusapi/AddClusterResourceDependency, clusapi/PCLUSAPI_ADD_CLUSTER_RESOURCE_DEPENDENCY, mscs.addclusterresourcedependency
clusapi.h
Windows
None supported
Windows Server 2008 Enterprise, Windows Server 2008 Datacenter
ClusAPI.lib
ClusAPI.dll
Windows
19H1
AddClusterResourceDependency
clusapi/AddClusterResourceDependency
c++
APIRef
kbSyntax
DllExport
ClusAPI.dll
Ext-MS-Win-Cluster-ClusAPI-L1-1-2.dll
ext-ms-win-cluster-clusapi-l1-1-3.dll
AddClusterResourceDependency

AddClusterResourceDependency function

-description

Creates a dependency relationship between two resources. The PCLUSAPI_ADD_CLUSTER_RESOURCE_DEPENDENCY type defines a pointer to this function.

-parameters

-param hResource [in]

Handle to the dependent resource.

-param hDependsOn [in]

Handle to the resource that the resource identified by hResource should depend on.

-returns

If the operation succeeds, it returns ERROR_SUCCESS (0).

If the operation fails, AddClusterResourceDependency returns one of the system error codes. The following are possible return values.

Return code/value Description
ERROR_CIRCULAR_DEPENDENCY
1059 (0x423)
A resource depends on itself.
ERROR_DEPENDENCY_ALREADY_EXISTS
5003 (0x138B)
The resource dependency already exists.
ERROR_DEPENDENCY_NOT_ALLOWED
5069 (0x13CD)
The dependent resource is the quorum.
ERROR_INVALID_PARAMETER
87 (0x57)
The resources are not in the same group.
ERROR_RESOURCE_NOT_AVAILABLE
5006 (0x138E)
At least one of the resources is marked for deletion.
ERROR_RESOURCE_ONLINE
5019 (0x139B)
The dependent resource is already online.

-remarks

A dependency relationship created by the AddClusterResourceDependency function affects how resources are moved from one node to another after a failure. It determines the order in which resources are taken offline and brought back online.

Resources in a dependency relationship must be moved together. The dependent resource must be brought online after the resource upon which it depends.

The two resources identified by hResource and hDependsOn must be in the same group.

Do not call AddClusterResourceDependency if hResource is already online. The call fails with an ERROR_RESOURCE_ONLINE error. Note that this behavior has changed with Windows Server 2008. You can call AddClusterResourceDependency and modify resource dependencies without requiring the resource to be brought offline.

Do not call AddClusterResourceDependency from a resource DLL. For more information, see Function Calls to Avoid in Resource DLLs.

Do not pass LPC and RPC handles to the same function call. Otherwise, the call will raise an RPC exception and can have additional destructive effects. For information on how LPC and RPC handles are created, see Using Object Handles and OpenCluster.

-see-also

CanResourceBeDependent

OpenCluster

OpenClusterResource

RemoveClusterResourceDependency