VM 세부정보 보기


이 문서에서는 기존 가상 머신(VM) 인스턴스의 세부정보를 보는 방법을 설명합니다.

VM의 세부정보는 연결된 디스크, 생성 타임스탬프, 머신 유형, VM ID 등의 구성과 상태를 확인하는 데 유용합니다. 이러한 정보는 변경 불가능한 디스크를 사용하여 VM을 참조하는 데 사용할 수 있습니다.

시작하기 전에

  • 아직 인증을 설정하지 않았다면 설정합니다. 인증은 Google Cloud 서비스 및 API에 액세스하기 위해 ID를 확인하는 프로세스입니다. 로컬 개발 환경에서 코드 또는 샘플을 실행하려면 다음과 같이 Compute Engine에 인증하면 됩니다.

    이 페이지의 샘플 사용 방법에 대한 탭을 선택하세요.

    콘솔

    Google Cloud 콘솔을 사용하여 Google Cloud 서비스 및 API에 액세스할 때는 인증을 설정할 필요가 없습니다.

    gcloud

    1. Google Cloud CLI를 설치한 후 다음 명령어를 실행하여 초기화합니다.

      gcloud init
    2. 기본 리전 및 영역을 설정합니다.

    REST

    로컬 개발 환경에서 이 페이지의 REST API 샘플을 사용하려면 gcloud CLI에 제공한 사용자 인증 정보를 사용합니다.

      Google Cloud CLI를 설치한 후 다음 명령어를 실행하여 초기화합니다.

      gcloud init

필요한 역할

VM의 세부정보를 보는 데 필요한 권한을 얻으려면 관리자에게 VM 또는 프로젝트에 대한 Compute 인스턴스 관리자(v1)(roles/compute.instanceAdmin.v1) IAM 역할을 부여해 달라고 요청하세요. 역할 부여에 대한 자세한 내용은 액세스 관리를 참조하세요.

이 사전 정의된 역할에는 VM의 세부정보를 보는 데 필요한 compute.instances.get 권한이 포함되어 있습니다.

커스텀 역할이나 다른 사전 정의된 역할을 사용하여 이 권한을 부여받을 수도 있습니다.

VM 세부정보 보기

Google Cloud 콘솔, gcloud CLI, Compute Engine API를 사용하여 VM의 세부정보를 볼 수 있습니다.

콘솔

VM 세부정보를 보려면 다음을 수행합니다.

  1. Google Cloud 콘솔에서 VM 인스턴스 페이지로 이동합니다.

    VM 인스턴스로 이동

  2. 이름 열에 있는 VM 이름을 클릭하여 세부정보를 확인합니다.

gcloud

VM 세부정보를 보려면 gcloud compute instances describe 명령어를 사용합니다.

gcloud compute instances describe VM_NAME \
    --zone=ZONE

다음을 바꿉니다.

  • VM_NAME: VM 이름입니다.

  • ZONE: VM이 있는 영역입니다.

출력은 다음과 비슷합니다.

canIpForward: false
confidentialInstanceConfig:
  enableConfidentialCompute: false
cpuPlatform: Intel Broadwell
creationTimestamp: '2023-08-18T10:00:21.801-07:00'
deletionProtection: false
description: ''
disks:
- architecture: X86_64
  autoDelete: true
  boot: true
  deviceName: example-vm
  diskSizeGb: '10'
  guestOsFeatures:
  - type: UEFI_COMPATIBLE
  - type: VIRTIO_SCSI_MULTIQUEUE
  - type: GVNIC
  - type: SEV_CAPABLE
  index: 0
  interface: SCSI
  kind: compute#attachedDisk
  licenses:
  - https://www.googleapis.com/compute/v1/projects/debian-cloud/global/licenses/debian-11-bullseye
  mode: READ_WRITE
  source: https://www.googleapis.com/compute/v1/projects/example-project/zones/us-central1-a/disks/example-vm
  type: PERSISTENT
displayDevice:
  enableDisplay: false
fingerprint: CQp-QBEACqw=
id: '6404261768674286922'
keyRevocationActionType: NONE
kind: compute#instance
labelFingerprint: 42WmSpB8rSM=
lastStartTimestamp: '2023-08-18T10:00:28.182-07:00'
machineType: https://www.googleapis.com/compute/v1/projects/example-project/zones/us-central1-a/machineTypes/e2-medium
metadata:
  fingerprint: lQ-dD2sMrMY=
  items:
  - key: enable-oslogin
    value: 'true'
  kind: compute#metadata
name: example-vm
networkInterfaces:
- accessConfigs:
  - kind: compute#accessConfig
    name: External NAT
    natIP: 34.27.53.198
    networkTier: PREMIUM
    type: ONE_TO_ONE_NAT
  fingerprint: QR3z6TgVFjg=
  kind: compute#networkInterface
  name: nic0
  network: https://www.googleapis.com/compute/v1/projects/example-project/global/networks/default
  networkIP: 10.128.0.28
  stackType: IPV4_ONLY
  subnetwork: https://www.googleapis.com/compute/v1/projects/example-project/regions/us-central1/subnetworks/default
reservationAffinity:
  consumeReservationType: ANY_RESERVATION
scheduling:
  automaticRestart: true
  onHostMaintenance: MIGRATE
  preemptible: false
  provisioningModel: STANDARD
selfLink: https://www.googleapis.com/compute/v1/projects/example-project/zones/us-central1-a/instances/example-vm
serviceAccounts:
- email: 790569220780-compute@developer.gserviceaccount.com
  scopes:
  - https://www.googleapis.com/auth/devstorage.read_only
  - https://www.googleapis.com/auth/logging.write
  - https://www.googleapis.com/auth/monitoring.write
  - https://www.googleapis.com/auth/servicecontrol
  - https://www.googleapis.com/auth/service.management.readonly
  - https://www.googleapis.com/auth/trace.append
shieldedInstanceConfig:
  enableIntegrityMonitoring: true
  enableSecureBoot: false
  enableVtpm: true
shieldedInstanceIntegrityPolicy:
  updateAutoLearnPolicy: true
startRestricted: false
status: RUNNING
tags:
  fingerprint: 42WmSpB8rSM=
zone: https://www.googleapis.com/compute/v1/projects/example-project/zones/us-central1-a

REST

VM의 세부정보를 보려면 instances.get 메서드에 대해 GET 요청을 수행합니다.

GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME

다음을 바꿉니다.

  • PROJECT_ID: VM이 있는 프로젝트의 ID입니다.

  • ZONE: VM이 있는 영역입니다.

  • VM_NAME: VM 이름입니다.

출력은 다음과 비슷합니다.

{
  "canIpForward": false,
  "confidentialInstanceConfig": {
    "enableConfidentialCompute": false
  },
  "cpuPlatform": "Intel Broadwell",
  "creationTimestamp": "2023-08-18T10:00:21.801-07:00",
  "deletionProtection": false,
  "description": "",
  "disks": [
    {
      "architecture": "X86_64",
      "autoDelete": true,
      "boot": true,
      "deviceName": "example-vm",
      "diskSizeGb": "10",
      "guestOsFeatures": [
        {
          "type": "UEFI_COMPATIBLE"
        },
        {
          "type": "VIRTIO_SCSI_MULTIQUEUE"
        },
        {
          "type": "GVNIC"
        },
        {
          "type": "SEV_CAPABLE"
        }
      ],
      "index": 0,
      "interface": "SCSI",
      "kind": "compute#attachedDisk",
      "licenses": [
        "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/licenses/debian-11-bullseye"
      ],
      "mode": "READ_WRITE",
      "source": "https://www.googleapis.com/compute/v1/projects/example-project/zones/us-central1-a/disks/example-vm",
      "type": "PERSISTENT"
    }
  ],
  "displayDevice": {
    "enableDisplay": false
  },
  "fingerprint": "CQp-QBEACqw=",
  "id": "6404261768674286922",
  "keyRevocationActionType": "NONE",
  "kind": "compute#instance",
  "labelFingerprint": "42WmSpB8rSM=",
  "lastStartTimestamp": "2023-08-18T10:00:28.182-07:00",
  "machineType": "https://www.googleapis.com/compute/v1/projects/example-project/zones/us-central1-a/machineTypes/e2-medium",
  "metadata": {
    "fingerprint": "lQ-dD2sMrMY=",
    "items": [
      {
        "key": "enable-oslogin",
        "value": "true"
      }
    ],
    "kind": "compute#metadata"
  },
  "name": "example-vm",
  "networkInterfaces": [
    {
      "accessConfigs": [
        {
        "kind": "compute#accessConfig",
        "name": "External NAT",
        "natIP": "34.27.53.198",
        "networkTier": "PREMIUM",
        "type": "ONE_TO_ONE_NAT"
        }
      ],
      "fingerprint": "QR3z6TgVFjg=",
      "kind": "compute#networkInterface",
      "name": "nic0",
      "network": "https://www.googleapis.com/compute/v1/projects/example-project/global/networks/default",
      "networkIP": "10.128.0.28",
      "stackType": "IPV4_ONLY",
      "subnetwork": "https://www.googleapis.com/compute/v1/projects/example-project/regions/us-central1/subnetworks/default"
    }
  ],
  "reservationAffinity": {
    "consumeReservationType": "ANY_RESERVATION"
  },
  "scheduling": {
    "automaticRestart": true,
    "onHostMaintenance": "MIGRATE",
    "preemptible": false,
    "provisioningModel": "STANDARD"
  },
  "selfLink": "https://www.googleapis.com/compute/v1/projects/example-project/zones/us-central1-a/instances/example-vm",
  "serviceAccounts": [
    {
    "email": "790569220780-compute@developer.gserviceaccount.com",
    "scopes": [
        "https://www.googleapis.com/auth/devstorage.read_only",
        "https://www.googleapis.com/auth/logging.write",
        "https://www.googleapis.com/auth/monitoring.write",
        "https://www.googleapis.com/auth/servicecontrol",
        "https://www.googleapis.com/auth/service.management.readonly",
        "https://www.googleapis.com/auth/trace.append"
      ]
    }
  ],
  "shieldedInstanceConfig": {
    "enableIntegrityMonitoring": true,
    "enableSecureBoot": false,
    "enableVtpm": true
  },
  "shieldedInstanceIntegrityPolicy": {
    "updateAutoLearnPolicy": true
  },
  "startRestricted": false,
  "status": "RUNNING",
  "tags": {
    "fingerprint": "42WmSpB8rSM="
  },
  "zone": "https://www.googleapis.com/compute/v1/projects/example-project/zones/us-central1-a"
}

다음 단계