ApiOfflineResource (Opnum 18)

(Protocol Version 2) The ApiOfflineResource method instructs the server to make the specified resource inactive or unavailable.

For a successful completion of this method, the server MUST execute any implementation-specific methods and protocols between servers in order to transition the specified resource to the ClusterResourceOffline state, as specified in section

The server MUST fail this method with ERROR_INVALID_STATE (0x0000139F) if the specified resource is not in the ClusterResourceOnline state, the ClusterResourceOffline state, or the ClusterResourceFailed state, as specified in section

Otherwise, the server MUST update the persistent state in the configuration of the resource to be ClusterResourceOffline, indicating that the cluster SHOULD NOT attempt to maintain the resource in the ClusterResourceOnline state.

If the resource is in the ClusterResourceOffline state, the server MUST complete the method with ERROR_SUCCESS (0x00000000). If the resource is in the ClusterResourceFailed state, the server MUST complete the method with ERROR_RESOURCE_FAILED (0x000013AE).

The server MUST adhere to the rules of dependency relations, as specified in section In particular, if there are one or more resources with a simple dependency on the designated resource, the server MUST first bring offline the resources that depend on the designated resource before it brings offline the designated resource.

Depending on how the resource type of the designated resource specifies the procedure of bringing the resource offline, the server MAY complete this method while the offline procedure is executed asynchronously. In this case, the server MUST transition the resource to the ClusterResourceOfflinePending state, as specified in section, and return 0x000003E5 (ERROR_IO_PENDING). After the completion of the offline procedure, depending on whether the procedure succeeded or failed, the server MUST set the resource state to ClusterResourceOffline or ClusterResourceFailed, respectively.

If the server executes the full offline procedure synchronously, and if the resource fails to come offline, the server MUST return a nonzero error code other than 0x000003E5 (ERROR_IO_PENDING) and set the resource state to ClusterResourceFailed.

Whether the offline procedure is executed synchronously or asynchronously, if the resource fails to come offline and its state is thus set to ClusterResourceFailed, the server SHOULD NOT attempt recovery action. Recovery actions SHOULD NOT be triggered when the resource persistent state is ClusterResourceOffline and the current resource state is ClusterResourceFailed or ClusterResourceOffline. Recovery actions are configured and executed by using implementation-specific methods between servers.

The server MUST accept an ApiOfflineResource request only if its protocol server state is read/write, as specified in section 3.1.1.

 error_status_t ApiOfflineResource(
   [in] HRES_RPC hResource

hResource: An HRES_RPC context handle that is obtained in a previous ApiOpenResource or ApiCreateResource method call.

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

Return value/code







The data that is pointed to by the hResource parameter does not represent a valid HRES_RPC context handle.



The resource is in the process of becoming inactive or unavailable. The resource transitioned to the ClusterResourceOfflinePending state.



The cluster resource is not available.

For any other condition, this method MUST return 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 as recoverable errors and initiate the reconnect procedure as specified in section