CancelClusterGroupOperation 함수(clusapi.h)

클라이언트가 그룹에 대해 보류 중인 MoveClusterGroup 또는 MoveClusterGroupEx 작업을 취소할 수 있도록 합니다. 그런 다음 그룹이 영구 상태로 반환됩니다.

구문

DWORD CancelClusterGroupOperation(
  [in] HGROUP hGroup,
  [in] DWORD  dwCancelFlags_RESERVED
);

매개 변수

[in] hGroup

클러스터 그룹에 대한 핸들입니다.

[in] dwCancelFlags_RESERVED

이 매개 변수는 나중에 사용할 수 있도록 예약되어 있으며 0으로 설정해야 합니다.

반환 값

CancelClusterGroupOperation 은 그룹의 이동 작업이 성공적으로 취소된 경우 ERROR_SUCCESS 반환합니다.

CancelClusterGroupOperation 은 이동 작업의 취소가 현재 진행 중인 경우 ERROR_IO_PENDING 반환합니다.

CancelClusterGroupOperation 은 지정된 그룹의 이동 그룹 작업에 대한 취소를 실행하는 데 오류가 발생한 경우 다른 0이 아닌 오류 코드를 반환합니다.

설명

CancelClusterGroupOperationERROR_IO_PENDING 반환하고 아직 진행 중인 MoveClusterGroup 또는 MoveClusterGroupEx 호출을 통해 발급된 클러스터 그룹에서 보류 중인 이동 작업을 취소하려고 시도합니다. 호출은 보류 중인 이동 작업을 취소하고 그룹을 영구 상태로 전환하려고 시도합니다.

예제

#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
#include <ClusAPI.h>


#define DemoResDllTypeName L"dummy"
#define DemoGroupName L"DemoGroup"

int __cdecl main( void )
{
    HCLUSTER hCluster= NULL;
    HGROUP hGroup = NULL;
    DWORD error = 0;

    hCluster = OpenCluster( NULL );
    if ( hCluster == NULL )
    {
        error = GetLastError();
        wprintf( L"Failed to open cluster: 0x%x\n", error );
        goto Cleanup;
    }

    hGroup = OpenClusterGroup( hCluster, DemoGroupName );
    if ( hGroup == NULL )
    {
        error = GetLastError();
        wprintf( L"Failed to open cluster group " DemoGroupName L": 0x%x\n", error );
        goto Cleanup;
    }


    // Cancel Move Group example
    error = MoveClusterGroupEx( hGroup,
                                NULL,
                                CLUSAPI_GROUP_MOVE_RETURN_TO_SOURCE_NODE_ON_ERROR | CLUSAPI_GROUP_MOVE_IGNORE_RESOURCE_STATUS,
                                NULL,
                                0);

    if ( error == ERROR_IO_PENDING  )
    {
        wprintf( L"Group move pending" DemoGroupName L": 0x%x\n", error );
        error = ERROR_SUCCESS;

        // Issuing cancel to the move operation
        error = CancelClusterGroupOperation(hGroup, 0);
        if ( error == ERROR_IO_PENDING  || error == ERROR_SUCCESS )
        {
            // the cancel was registered successfully
            wprintf( L"Cancel issued for move operation for the group " DemoGroupName L"\n" );
        }
        else
        {
            wprintf( L"Failed to Cancel move operation for the group " DemoGroupName L": 0x%x\n" );
        }
    }
    else if ( error != ERROR_SUCCESS)
    {
        wprintf( L"Failed to move group" DemoGroupName L": 0x%x\n", error );
    }
    else 
    {
        wprintf( L"Group move completed" DemoGroupName L": 0x%x\n");
    }


Cleanup:

    if ( hGroup != NULL )
    {
        CloseClusterGroup( hGroup );
        hGroup = NULL;
    }
    if ( hCluster != NULL )
    {
        CloseCluster( hCluster );
        hCluster = NULL;
    }

    return (int)error;
}

요구 사항

요구 사항
지원되는 최소 클라이언트 지원되는 버전 없음
지원되는 최소 서버 Windows Server 2012
대상 플랫폼 Windows
헤더 clusapi.h
라이브러리 ClusAPI.lib
DLL ClusAPI.dll