CLUSCTL_RESOURCE_SET_MAINTENANCE_MODE control code

Enables or disables maintenance mode for the specified disk resource. Applications use this control code as a parameter to the ClusterResourceControl function.

ClusterResourceControl( hResource,                // resource handle
                        hHostNode,                // host node
                        CLUSCTL_RESOURCE_SET_MAINTENANCE_MODE, // control code
                        lpInBuffer,               // CLUS_MAINTENANCE_MODE_INFO
                        cbInBufferSize,           // allocated buffer size
                        NULL,                     // not used
                        0,                        // not used
                        NULL );                   // not used

Parameters

The following control code function and DLL support parameters are specific to this control code. For complete parameter descriptions, see ClusterResourceControl.

lpInBuffer

Points to a CLUS_MAINTENANCE_MODE_INFO structure containing the boolean flag used to enable or disable maintenance mode. Additional private data for the resource DLL may be included immediately after the CLUS_MAINTENANCE_MODE_INFO structure, provided cbInBufferSize is adjusted appropriately.

Return value

ClusterResourceControl returns one of the following values:

ERROR_SUCCESS

0

The property list is correctly formatted and contains valid data values.

ERROR_INVALID_FUNCTION

1

The disk resource DLL does not support maintenance mode.

ERROR_INVALID_PARAMETER

87 (0x57)

The CLUS_MAINTENANCE_MODE_INFO structure pointed to by the lpInBuffer parameter is formatted incorrectly.

RPC_X_BAD_STUB_DATA

1783 (0x6F7)

The lpInBuffer parameter is NULL.

ERROR_HOST_NODE_NOT_RESOURCE_OWNER

5015 (0x1397)

A disk resource not owned by the hosting node cannot be put into maintenance mode.

ERROR_INVALID_STATE

5023 (0x139F)

The disk resource is offline.

ERROR_CLUSTER_INVALID_REQUEST

5048 (0x13B8)

A quorum resource cannot be put into maintenance mode.

System error code

The operation failed.

Remarks

Only disk resources support maintenance mode.

A resource must be online and not identified as the quorum resource in order to be placed in maintenance mode.

The calling application must direct the maintenance mode resource control codes to the node hosting the resource.

ClusAPI.h defines the 32 bits of CLUSCTL_RESOURCE_SET_MAINTENANCE_MODE (0x014001e6) as follows:

Component Bit location Value
Object code
24 31
CLUS_OBJECT_RESOURCE (0x1)
Global bit
23
CLUS_NOT_GLOBAL (0x0)
Modify bit
22
CLUS_MODIFY (0x1)
User bit
21
CLCTL_CLUSTER_BASE (0x0)
Type bit
20
External (0x0)
Operation code
0 23
CLCTL_SET_MAINTENANCE_MODE (0x4001e6)
Access code
0 1
CLUS_ACCESS_WRITE (0x2)

For more information, see Control Code Architecture.

Requirements

Minimum supported client
None supported
Minimum supported server
Windows Server 2008 Datacenter with SP1, Windows Server 2008 Enterprise with SP1
Header
ClusAPI.h

See also

External Resource Control Codes

Maintaining Physical Disk Resources

CLUS_MAINTENANCE_MODE_INFO

CLUSCTL_RESOURCE_QUERY_MAINTENANCE_MODE

ClusterResourceControl