3.1.4.2.164 ApiChangeCsvStateEx (Opnum 182)

The ApiChangeCsvStateEx method<151> SHOULD<152> instruct the server to change the accessibility of the disk associated with hResource.

If dwState is 1, the server MUST set ResourceSharedVolumes to TRUE and convert all volumes associated with hResource to cluster shared volumes. The server MUST add the volume identified by lpszVolumeName to the disk. The server MUST set the initial state of all cluster shared volumes associated with hResource such that volume maintenance mode, redirected mode, and backup mode are all disabled.

If dwState is 1, the server MUST also designate the group associated with hResource as a special group, as specified in section 3.1.1.1.4.

If dwState is 0, the server MUST set ResourceSharedVolumes to FALSE and stop making the volumes associated with hResource accessible to all nodes as cluster shared volumes.

If dwState is 0, the server MUST also remove the special group designation of the group associated with hResource.

The server MUST accept an ApiChangeCsvStateEx request if its protocol server state is read-only, and the server MUST accept the request for processing if it is in the read/write state, as specified in section 3.1.1.

The server MUST require that the access level associated with the hResource context handle is "All" (section 3.1.4).

 error_status_t
 ApiChnageCsvStateEx (
   [ in ] HRES_RPC hResource,
   [ in ] DWORD dwState,
   [ in, string ] LPCWSTR lpszVolumeName,
   [ out ] error_status_t *rpc_status
 );

hResource: An HRES_RPC (section 2.2.1.4) context handle that was obtained in a previous ApiOpenResource (section 3.1.4.2.9), ApiOpenResourceEx (section 3.1.4.2.119), or ApiCreateResource (section 3.1.4.2.10) method call.

DwState: This MUST be 1 to make the disk associated with hResource accessible from all cluster nodes. This MUST be 0 to make the disk associated with hResource accessible only from the cluster node that mounted the disk.

lpszVolumeName: A null-terminated Unicode string that contains the volume name of the cluster shared volume.

rpc_status: A 32-bit integer used to indicate success or failure. The RPC runtime MUST indicate by writing to this parameter whether the runtime succeeded in executing this method on the server. The encoding of the value passed in this parameter MUST conform to encoding for comm_status and fault_status, as specified in Appendix E of [C706].

Return Values: The method MUST return the following error codes for the specified conditions.

Return value/code

Description

0x00000000

ERROR_SUCCESS

Success.

0x00000046

ERROR_SHARING_PAUSED

The current protocol server state of the server is not read/write.

0x000003E5

ERROR_IO_PENDING

The operation is still in progress.

0x000006D1

RPC_S_PROCNUM_OUT_OF_RANGE

The server does not support this method.

0x00001389

ERROR_DEPENDENT_RESOURCE_EXISTS

The resource represented by the hResource parameter has other resources dependent on it.

0x00001390

ERROR_SHUTDOWN_CLUSTER

The cluster is being shut down.

0x0000138C

ERROR_RESOURCE_NOT_ONLINE

The dwState parameter is 1 and the specified resource is not online. The resource MUST be online to enable shared access.

0x000013B8

ERROR_CLUSTER_INVALID_REQUEST

The operation is invalid for the cluster or for the specified resource. It is invalid for the cluster if the dwState parameter is 1 and the requested state is not enabled for the cluster; for instance, the server EnableSharedVolumes state is FALSE (indicating that the server does not support cluster shared volumes) (see section 3.1.1.4). The operation is invalid for the specified resource if any of the following conditions are met:

§ The dwState parameter is 1 and the specified resource is already deployed to an application/service.

§ The dwState parameter is 1 and the specified resource is in maintenance mode (see section 3.1.1.1.1.2).

§ The dwState parameter is 1 and the specified resource depends on one or more additional resources.

§ The dwState parameter is 0 and the specified resource does not currently allow volumes to be shared to all nodes in a cluster (ResourceSharedVolumes is already FALSE).

0x000013D7

ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED

The dwState parameter is 1 and the specified resource is not of the correct type. Shared access can only be enabled for resources that are of the Physical Disk Resource type.

0x0000174C

ERROR_DISK_NOT+CSV_CAPABLE

The disk is not configured in a way to be used with CSV. CSV disks must have at least one partition that is formatted with NTFS or REFS.

0x0000174D

ERROR_RESOURCE_NOT_IN_AVAILABLE_STORAGE

The resource must be part of the Available Storage group to complete this action.

For any other condition, this method returns a value that is not one of the values listed in the preceding table. The client MUST behave in one consistent, identical manner for all values that are not listed in the preceding table. The client SHOULD treat errors specified in section 3.2.4.6 as recoverable errors, and initiate the reconnect procedure as specified in section 3.2.4.6