프라이빗 클라우드 리소스 및 활동 관리

프라이빗 클라우드를 만든 후에는 관련 정보를 확인하고 리소스 및 활동을 관리하고 VMware 관리 어플라이언스에 액세스할 수 있습니다. 각 프라이빗 클라우드에는 클러스터가 한 개 이상 포함되고 각 클러스터에는 ESXi 호스트에 해당하는 노드가 포함됩니다.

프라이빗 클라우드의 클러스터에 적용된 자동 확장 정책은 리소스 소비를 모니터링하고 자동으로 클러스터에서 노드를 추가하거나 삭제합니다. 프라이빗 클라우드의 클러스터에서 노드를 추가 또는 삭제하여 프라이빗 클라우드를 수동으로 확장하거나 축소할 수도 있습니다. 예를 들어 현재의 요구사항을 기반으로 프라이빗 클라우드를 만든 후 소비가 증가할 때 노드를 추가하여 프라이빗 클라우드를 확장할 수 있습니다.

프라이빗 클라우드 목록을 보려면 먼저 리소스 요약 페이지에 액세스합니다.

  1. Google Cloud VMware Engine 포털에 액세스합니다.
  2. 기본 탐색 메뉴에서 리소스로 이동합니다.
  3. 프라이빗 클라우드 목록에서 관리하려는 프라이빗 클라우드를 선택합니다.

gcloud 및 API 요구사항

gcloud 명령줄 도구나 API를 사용하여 VMware Engine 리소스를 관리하려면 다음 설명대로 도구를 구성하는 것이 좋습니다.

gcloud

  1. 기본 프로젝트 ID를 설정합니다.

    gcloud config set project PROJECT_ID
    
  2. 기본 리전 및 영역을 설정합니다.

    gcloud config set compute/region REGION
    gcloud config set compute/zone ZONE

gcloud vmware 도구에 대한 자세한 내용은 Cloud SDK 참조 문서를 검토하세요.

API

이 문서 집합의 API 예시는 cURL 명령줄 도구를 사용하여 API를 쿼리합니다. cURL 요청의 일부로 유효한 액세스 토큰이 필요합니다. 유효한 액세스 토큰을 가져오는 방법에는 여러 가지가 있습니다. 다음 단계에서는 gcloud 도구를 사용하여 액세스 토큰을 생성합니다.

  1. Google Cloud에 로그인합니다.

    gcloud auth login
    
  2. 액세스 토큰을 생성하여 TOKEN으로 내보냅니다.

    export TOKEN=`gcloud auth print-access-token`
    
  3. TOKEN이 제대로 설정되었는지 확인합니다.

    echo $TOKEN
    
    Output:
    TOKEN
    

이제 API에 대한 요청에 승인 토큰을 사용합니다. 예를 들면 다음과 같습니다.

curl -X GET -H "Authorization: Bearer \"$TOKEN\""  -H "Content-Type: application/json; charset=utf-8" https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations

Python

이 문서의 Python 코드 샘플은 VMware Engine 라이브러리를 사용하여 API와 통신합니다. 이 접근 방식을 사용하려면 라이브러리를 설치해야 하며 애플리케이션 기본 사용자 인증 정보를 구성해야 합니다.

  1. Python 라이브러리 다운로드 및 설치

     pip install google-cloud-vmwareengine
    
  2. 셸에서 명령어를 실행하여 ADC 정보를 구성하거나

      gcloud auth application-default login
    

    서비스 계정 키 파일을 사용합니다.

      export GOOGLE_APPLICATION_CREDENTIALS="FILE_PATH"
    

라이브러리에 대한 자세한 내용은 참조 페이지를 확인하거나 GitHub의 코드 샘플을 확인하세요.

IP 주소 레이아웃 버전 확인

2022년 11월 이후에 생성된 프라이빗 클라우드는 IP 주소 레이아웃(IP 계획) 버전 2.0 서브넷 할당을 준수합니다. 2022년 11월 이전에 생성된 거의 모든 프라이빗 클라우드는 IP 계획 버전 1.0 서브넷 할당을 준수합니다.

프라이빗 클라우드가 준수하는 버전을 확인하려면 다음 단계를 완료하세요.

  1. Google Cloud VMware Engine 포털에 액세스합니다.
  2. 리소스 페이지에서 요약을 클릭합니다.

버전 번호가 IP 계획 버전으로 표시됩니다.

프라이빗 클라우드 요약 보기

요약에서는 이름, vSphere 클러스터 수, 노드 수, 위치, 작업 상태 등을 포함한 프라이빗 클라우드에 대한 정보를 제공합니다. 요약 페이지에는 프라이빗 클라우드에 배포된 DNS 서버도 포함됩니다.

프라이빗 클라우드 요약 페이지에서 다음 작업을 수행할 수 있습니다.

프라이빗 클라우드에 노드 추가

프라이빗 클라우드는 각각 여러 노드를 포함하는 vSphere 클러스터 한 개 이상으로 구성됩니다. 프라이빗 클라우드에 노드를 추가할 때 기존 클러스터에 노드를 추가하거나 새 클러스터를 만듭니다. 프라이빗 클라우드는 전체 노드 한도 내에서는 여러 번 확장될 수 있습니다. 프라이빗 클라우드를 확장할 때마다 기존 클러스터에 추가하거나 새 클러스터를 만듭니다.

Google은 새 클러스터 구성 중 VMware 인프라를 구성합니다. 설정에는 vSAN 디스크 그룹의 스토리지 설정, VMware 고가용성, Distributed Resource Scheduler(DRS)가 포함됩니다.

프라이빗 클라우드에 노드를 추가하려면 다음 단계를 따르세요.

콘솔

  1. 프라이빗 클라우드 요약 페이지에서 노드 추가를 클릭합니다.
  2. 기존 클러스터 중 하나에 노드를 추가할지, 새 vSphere 클러스터를 만들지 선택합니다. 변경하면 페이지의 요약 정보가 업데이트됩니다.
  3. 기존 클러스터 중 하나에 노드를 추가하려면 기존에 노드 추가를 선택합니다. 확장할 클러스터를 선택하고 추가할 노드 수를 입력합니다.
  4. 새 클러스터를 추가하려면 새로 만들기를 선택합니다. 그런 다음 아래 세부정보를 제공합니다.
    1. 클러스터 이름을 입력합니다.
    2. 기존 vSphere 데이터 센터를 선택하거나 이름을 입력하여 새 데이터 센터를 만듭니다.
    3. 노드 수를 선택합니다. 새 클러스터마다 노드가 최소 3개 이상 있어야 합니다.
    4. 선택사항: 관리 클러스터의 각 노드에서 사용 가능한 코어 수를 줄이려면 코어 맞춤설정 전환 버튼을 클릭합니다. 자세한 내용은 커스텀 코어 수를 참조하세요.
  5. 제출을 클릭합니다.

gcloud

update 명령어를 사용하면 클러스터의 총 노드 수를 변경할 수 있습니다. 이 명령어를 사용하려면 클러스터 및 프라이빗 클라우드의 이름이 필요합니다.

  1. 클러스터를 나열합니다.

    gcloud vmware private-clouds clusters list \
     --private-cloud=PC_NAME \
     --location=ZONE
  2. 클러스터를 업데이트합니다. 예를 들어 다음 명령어는 노드 수를 4개로 변경합니다.

    gcloud vmware private-clouds clusters update CLUSTER_NAME \
    --location=ZONE \
    --private-cloud=PC_NAME --node-type-config=type=standard-72,count=4

    다음을 바꿉니다.

    • CLUSTER_NAME: 이 프라이빗 클라우드에서 업데이트할 클러스터의 이름입니다.
    • ZONE: 프라이빗 클라우드의 영역입니다.
    • PC_NAME: 프라이빗 클라우드의 이름입니다.
    • PROJECT_ID: 이 요청의 프로젝트 ID입니다.

API

Update API를 사용하면 클러스터의 총 노드 수를 변경할 수 있습니다. 이 명령어를 사용하려면 클러스터 및 프라이빗 클라우드의 이름이 필요합니다.

  1. 클러스터를 나열합니다.

    curl -L -X GET -H "Authorization: Bearer TOKEN" "https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/ZONE/privateClouds/PC_NAME/clusters"
    
  2. 클러스터를 업데이트합니다. 예를 들어 다음은 클러스터를 standard-72로 업데이트하고 노드 수를 4개로 변경합니다.

    curl -L -X PATCH -H "Authorization: Bearer TOKEN" \
    -H "Content-Type: application/json" \
    "https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/ZONE/privateClouds/PC_NAME/clusters/CLUSTER_NAME?updateMask=node_type_configs.*.node_count" \
    -d '{
    "nodeTypeConfigs": {
      "standard-72" : {
        "nodeCount": 4
      }
    }
    }'

    다음을 바꿉니다.

    • PROJECT_ID: 이 요청의 프로젝트 ID입니다.
    • ZONE: 프라이빗 클라우드의 영역입니다.
    • PC_NAME: 프라이빗 클라우드의 이름입니다.
    • CLUSTER_NAME: 이 프라이빗 클라우드에서 업데이트할 클러스터의 이름입니다.

Python

클러스터 업데이트 메서드를 사용하면 클러스터의 총 노드 수를 변경할 수 있습니다. 이 메서드를 사용하려면 클러스터 및 프라이빗 클라우드의 이름이 필요합니다.

  1. 클러스터를 나열합니다.
from typing import Iterable

from google.cloud import vmwareengine_v1

def list_clusters(
    project_id: str, zone: str, private_cloud_name: str
) -> Iterable[vmwareengine_v1.Cluster]:
    """
    Retrieves a list of clusters in private cloud.

    Args:
        project_id: name of the project hosting the private cloud.
        zone: zone in which the private cloud is located.
        private_cloud_name: name of the cloud of which you want to list cluster.

    Returns:
        An iterable collection of Cluster objects.
    """
    client = vmwareengine_v1.VmwareEngineClient()
    return client.list_clusters(
        parent=f"projects/{project_id}/locations/{zone}/privateClouds/{private_cloud_name}"
    )

  1. 클러스터를 업데이트합니다. 다음 메서드를 사용하면 클러스터의 standard-72 노드 수를 수정할 수 있습니다.
from google.api_core import operation
from google.cloud import vmwareengine_v1

def update_cluster_node_count(
    project_id: str,
    zone: str,
    private_cloud_name: str,
    cluster_name: str,
    node_count: int,
) -> operation.Operation:
    """
    Modify the number of nodes in a cluster in a private cloud.

    Modifying a cluster is a long-running operation and it may take over an hour.

    Args:
        project_id: name of the project you want to use.
        zone: zone in which your private cloud is located.
        private_cloud_name: name of the private cloud hosting the cluster.
        cluster_name: name of the cluster.
        node_count: desired number of nodes in the cluster.

    Returns:
        An Operation object related to cluster modification operation.
    """
    if node_count < 3:
        raise RuntimeError("Cluster needs to have at least 3 nodes")
    client = vmwareengine_v1.VmwareEngineClient()
    request = vmwareengine_v1.UpdateClusterRequest()
    request.cluster = vmwareengine_v1.Cluster()
    request.cluster.name = (
        f"projects/{project_id}/locations/{zone}/privateClouds/{private_cloud_name}"
        f"/clusters/{cluster_name}"
    )
    request.cluster.node_type_configs = {
        "standard-72": vmwareengine_v1.NodeTypeConfig()
    }
    request.cluster.node_type_configs["standard-72"].node_count = node_count
    request.update_mask = "nodeTypeConfigs.*.nodeCount"
    return client.update_cluster(request)

프라이빗 클라우드에 새 클러스터 추가

기존 프라이빗 클라우드에 새 클러스터를 추가하려면 다음 안내를 따르세요.

gcloud

새 클러스터를 추가하고 이름을 지정합니다. 예를 들면 다음과 같습니다.

gcloud vmware private-clouds clusters create CLUSTER_NAME \
   --location=ZONE --private-cloud=PC_NAME \
   --node-type-config=type=standard-72,count=4

API

새 클러스터를 추가하고 이름을 지정합니다. 예를 들면 다음과 같습니다.

curl -L -X POST -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" \
"https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/ZONE/privateClouds/PC_NAME/clusters?clusterId=CLUSTER_NAME" \
-d '{
  "nodeTypeConfigs": {
    "standard-72": {
      "nodeCount": 4
      }
  }
}'

Python

새 클러스터를 추가하고 이름을 지정합니다.

from google.api_core import operation
from google.cloud import vmwareengine_v1

def create_cluster(
    project_id: str,
    zone: str,
    private_cloud_name: str,
    cluster_name: str,
    node_count: int = 4,
) -> operation.Operation:
    """
    Create a new cluster in a private cloud.

    Creation of a new cluster is a long-running operation and it may take over an hour.

    Args:
        project_id: name of the project you want to use.
        zone: region in which your private cloud is located.
        private_cloud_name: name of the private cloud hosting the new cluster.
        cluster_name: name of the new cluster.
        node_count: number of nodes in the new cluster. (Must be >= 3)

    Returns:
        An Operation object related to started cluster creation operation.

    Raises:
        ValueError in case an incorrect number of nodes is provided.
    """
    if node_count < 3:
        raise ValueError("Cluster needs to have at least 3 nodes")

    request = vmwareengine_v1.CreateClusterRequest()
    request.parent = (
        f"projects/{project_id}/locations/{zone}/privateClouds/{private_cloud_name}"
    )

    request.cluster = vmwareengine_v1.Cluster()
    request.cluster.name = cluster_name

    # Currently standard-72 is the only supported node type.
    request.cluster.node_type_configs = {
        "standard-72": vmwareengine_v1.NodeTypeConfig()
    }
    request.cluster.node_type_configs["standard-72"].node_count = node_count

    client = vmwareengine_v1.VmwareEngineClient()
    return client.create_cluster(request)

커스텀 코어 수 구성으로 새 클러스터 만들기

커스텀 코어 수 구성을 사용하여 새 클러스터를 만들려면 다음을 수행합니다.

gcloud

새 클러스터를 추가하고 코어 수 구성을 지정합니다. 예를 들어 다음은 노드가 3개이고 커스텀 코어 수가 28개인 standard-72 노드 유형의 새 클러스터를 만듭니다.

gcloud vmware private-clouds clusters create CLUSTER_NAME \
    --location=ZONE \
    --private-cloud=PC_NAME \
    --node-type-config=type=standard-72,count=4,custom-core-count=28

API

새 클러스터를 추가하고 코어 수 구성을 지정합니다. 예를 들어 다음은 노드가 4개이고 커스텀 코어 수가 28개인 standard-72 노드 유형의 새 클러스터를 만듭니다.

curl -L -X POST -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" \
"https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/ZONE/privateClouds/PROJECT_ID/clusters?clusterId=CLUSTER_NAME" \
-d '{
      "nodeTypeConfigs": {
      "standard-72": {
        "nodeCount": 4,
        "customCoreCount": 28
        }
    }
}'

Python

새 클러스터를 추가하고 코어 수 구성을 지정합니다. 예를 들어 다음은 구성 가능한 노드 수와 코어 수가 있는 standard-72 노드 유형의 새 클러스터를 만듭니다.

from google.api_core import operation
from google.cloud import vmwareengine_v1

def create_custom_cluster(
    project_id: str,
    zone: str,
    private_cloud_name: str,
    cluster_name: str,
    node_count: int = 4,
    core_count: int = 28,
) -> operation.Operation:
    """
    Create a new cluster with custom number of cores in its nodes
    in a private cloud.

    Creation of a new cluster is a long-running operation and it may take over an hour.

    Args:
        project_id: name of the project you want to use.
        zone: region in which your private cloud is located.
        private_cloud_name: name of the private cloud hosting the new cluster.
        cluster_name: name of the new cluster.
        node_count: number of nodes in the new cluster.
        core_count: number of CPU cores in the new cluster nodes.

    Returns:
        An Operation object related to started cluster creation operation.

    Raises:
        ValueError in case an incorrect number of nodes is provided.
    """
    if node_count < 3:
        raise ValueError("Cluster needs to have at least 3 nodes")

    request = vmwareengine_v1.CreateClusterRequest()
    request.parent = (
        f"projects/{project_id}/locations/{zone}/privateClouds/{private_cloud_name}"
    )

    request.cluster = vmwareengine_v1.Cluster()
    request.cluster.name = cluster_name

    # Currently standard-72 is the only supported node type.
    request.cluster.node_type_configs = {
        "standard-72": vmwareengine_v1.NodeTypeConfig()
    }
    request.cluster.node_type_configs["standard-72"].node_count = node_count
    request.cluster.node_type_configs["standard-72"].custom_core_count = core_count

    client = vmwareengine_v1.VmwareEngineClient()
    return client.create_cluster(request)

노드 삭제 또는 클러스터 삭제

프라이빗 클라우드에서 노드를 삭제할 때는 기존 클러스터에서 노드를 삭제하거나 전체 클러스터를 삭제합니다.

프라이빗 클라우드에서 노드를 삭제하려면 몇 개의 노드로 클러스터를 업데이트합니다.

콘솔

  1. 프라이빗 클라우드 요약 페이지에서 노드 삭제를 클릭합니다.
  2. 축소하거나 삭제할 클러스터를 선택합니다.
  3. 노드 1개 삭제를 선택합니다.
  4. 클러스터 용량을 확인합니다.
  5. 제출을 클릭하여 노드 삭제 프로세스를 시작합니다.

진행 상황을 모니터링하려면 활동 > 태스크를 선택합니다. 이 프로세스에는 vSAN의 재동기화가 필요하며 데이터에 따라 몇 시간이 걸릴 수 있습니다.

gcloud

gcloud vmware private-clouds clusters update CLUSTER_NAME \
  --location=ZONE \
  --private-cloud=PC_NAME --node-type-config=type=standard-72,count=3

API

curl -L -X PATCH -H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
"https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/ZONE/privateClouds/PC_NAME/clusters/CLUSTER_NAME?update_mask=node_type_configs.*.node_count" \
-d '{
  "nodeTypeConfigs": {
    "standard-72" : {
      "nodeCount": 3
    }
  }
}'

Python

from google.api_core import operation
from google.cloud import vmwareengine_v1

def update_cluster_node_count(
    project_id: str,
    zone: str,
    private_cloud_name: str,
    cluster_name: str,
    node_count: int,
) -> operation.Operation:
    """
    Modify the number of nodes in a cluster in a private cloud.

    Modifying a cluster is a long-running operation and it may take over an hour.

    Args:
        project_id: name of the project you want to use.
        zone: zone in which your private cloud is located.
        private_cloud_name: name of the private cloud hosting the cluster.
        cluster_name: name of the cluster.
        node_count: desired number of nodes in the cluster.

    Returns:
        An Operation object related to cluster modification operation.
    """
    if node_count < 3:
        raise RuntimeError("Cluster needs to have at least 3 nodes")
    client = vmwareengine_v1.VmwareEngineClient()
    request = vmwareengine_v1.UpdateClusterRequest()
    request.cluster = vmwareengine_v1.Cluster()
    request.cluster.name = (
        f"projects/{project_id}/locations/{zone}/privateClouds/{private_cloud_name}"
        f"/clusters/{cluster_name}"
    )
    request.cluster.node_type_configs = {
        "standard-72": vmwareengine_v1.NodeTypeConfig()
    }
    request.cluster.node_type_configs["standard-72"].node_count = node_count
    request.update_mask = "nodeTypeConfigs.*.nodeCount"
    return client.update_cluster(request)

전체 클러스터를 삭제하려면 다음 안내를 따르세요.

콘솔

  1. 프라이빗 클라우드 요약 페이지에서 노드 삭제를 클릭합니다.
  2. 축소하거나 삭제할 클러스터를 선택합니다.
  3. 전체 클러스터 삭제를 선택합니다.
  4. 클러스터 용량을 확인합니다.
  5. 제출을 클릭하여 노드 삭제 프로세스를 시작합니다.

gcloud

gcloud vmware private-clouds clusters delete CLUSTER_NAME \
  --location=ZONE \
  --private-cloud=PC_NAME

API

curl -L -X DELETE -H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
"https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/ZONE/privateClouds/PC_NAME/clusters/CLUSTER_NAME"

Python

from google.api_core import operation
from google.cloud import vmwareengine_v1

def delete_cluster(
    project_id: str, zone: str, private_cloud_name: str, cluster_name: str
) -> operation.Operation:
    """
    Delete a cluster from private cloud.

    Deleting a cluster is a long-running operation and it may take over an hour..

    Args:
        project_id: name of the project you want to use.
        zone: region in which your private cloud is located.
        private_cloud_name: name of the private cloud hosting the new cluster.
        cluster_name: name of the new cluster.

    Returns:
        An Operation object related to started cluster deletion operation.
    """
    client = vmwareengine_v1.VmwareEngineClient()
    request = vmwareengine_v1.DeleteClusterRequest()
    request.name = (
        f"projects/{project_id}/locations/{zone}/privateClouds/{private_cloud_name}"
        f"/clusters/{cluster_name}"
    )
    return client.delete_cluster(request)

제한사항

프라이빗 클라우드에서 노드를 삭제하는 프로세스에는 다음과 같은 제한사항이 있습니다.

  • vSphere 클러스터에는 노드가 최소 3개 이상 있어야 합니다. 노드가 3개 이하인 클러스터에서는 노드를 삭제할 수 없습니다.
  • 사용된 총 스토리지는 클러스터에서 노드를 삭제한 후에 총 용량을 초과할 수 없습니다.
  • 프라이빗 클라우드가 생성되었을 때 생성된 첫 번째 클러스터는 삭제할 수 없습니다.
  • vSphere DRS 규칙(어피니티 및 안티어피니티)이 클러스터의 모든 노드에 적용되는 경우 클러스터에서 노드를 삭제할 수 없습니다. 규칙을 삭제하고 노드 삭제 작업을 다시 시도할 수 있습니다.

서브넷 보기

프라이빗 클라우드에 정의된 관리 서브넷 목록을 보려면 서브넷 탭을 선택합니다. 프라이빗 클라우드를 만들 때 생성된 HCX 서브넷이 목록에 포함됩니다. 서브넷 목록에는 각 서브넷의 연결된 방화벽 테이블도 포함됩니다.

활동 정보 보기

프라이빗 클라우드의 활동 정보를 보려면 활동 탭을 선택합니다. 표시된 정보는 프라이빗 클라우드에 대해 필터링된 모든 활동 목록입니다. 이 페이지에는 최대 25개의 최근 활동이 표시됩니다. 전체 활동 목록 및 연관된 작업을 보려면 VMware Engine 활동 모니터링을 참조하세요.

vSphere 관리 네트워크 보기

현재 프라이빗 클라우드에 구성되어 있는 VMware 관리 리소스 및 가상 머신의 목록을 보려면 vSphere Management Network 탭을 선택합니다. 정보에는 소프트웨어 버전, 정규화된 도메인 이름(FQDN), 리소스의 IP 주소가 포함됩니다.