CreateCluster function

Creates and starts a cluster. The cluster consists of the set of nodes specified, with the Network Name, IP Address, and quorum resources if specified. The PCLUSAPI_CREATE_CLUSTER type defines a pointer to this function.

Syntax


HCLUSTER CreateCluster(
  _In_     PCREATE_CLUSTER_CONFIG           pConfig,
  _In_opt_ PCLUSTER_SETUP_PROGRESS_CALLBACK pfnProgressCallback,
  _In_opt_ PVOID                            pvCallbackArg
);

typedef HCLUSTER (WINAPI *PCLUSAPI_CREATE_CLUSTER)(
    _In_     PCREATE_CLUSTER_CONFIG           pConfig,
    _In_opt_ PCLUSTER_SETUP_PROGRESS_CALLBACK pfnProgressCallback,
    _In_opt_ PVOID                            pvCallbackArg
);

Parameters

pConfig [in]

Address of a CREATE_CLUSTER_CONFIG structure containing configuration information about the cluster to be created.

pfnProgressCallback [in, optional]

Address of callback function that matches the PCLUSTER_SETUP_PROGRESS_CALLBACK function pointer that will be called periodically to provide progress on the cluster creation.

pvCallbackArg [in, optional]

Argument for the callback function.

Return value

Handle to the newly created cluster or NULL. A non NULL value does not indicate complete success (all nodes will have been added, but not all IP Address or Network Name resources may have been created. The parameters passed to the function pointed to by the pfnProgressCallback parameter should be checked.

NULL

Less than a majority of nodes were successfully created. For more information about the error, call the function GetLastError.

Remarks

The PCLUSAPI_CREATE_CLUSTER type defines a pointer to this function and can be used with the GetProcAddress function to call this function.

After the CreateCluster function successfully completes, at least 30 seconds should be allowed before the AddClusterNode function is called to add additional nodes.

The CreateCluster function successfully completes after cluster quorum has been achieved. One or more cluster nodes could be in a ClusterNodeDown or ClusterNodeJoining state for a few seconds.

Before calling the CreateCluster function, the CoInitializeEx function must be called specifying both COINIT_MULTITHREADED and COINIT_DISABLE_OLE1DDE for the dwCoInit parameter, as shown in the following code.

CoInitializeEx( NULL, COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE );

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2008 Datacenter, Windows Server 2008 Enterprise

Header

ClusAPI.h

Library

ClusAPI.lib

DLL

ClusAPI.dll

See also

Cluster Management Functions
CREATE_CLUSTER_CONFIG
AddClusterNode
DestroyCluster
PCLUSTER_SETUP_PROGRESS_CALLBACK

 

 

Show: