이 문서에서는 기존 가상 머신(VM) 인스턴스의 세부정보를 확인하는 방법을 설명합니다.
VM의 세부정보는 연결된 디스크, 생성 타임스탬프, 머신 유형, VM ID 등의 구성과 상태를 확인하는 데 유용합니다. 이러한 정보는 변경 불가능한 디스크를 사용하여 VM을 참조하는 데 사용할 수 있습니다.
시작하기 전에
-
아직 인증을 설정하지 않았다면 설정합니다.
인증은 서비스 및 API에 액세스하기 위해 ID를 확인하는 프로세스입니다. Google Cloud
로컬 개발 환경에서 코드 또는 샘플을 실행하려면 다음 옵션 중 하나를 선택하여 Compute Engine에 인증하면 됩니다.
Select the tab for how you plan to use the samples on this page:
When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
-
Install the Google Cloud CLI, then initialize it by running the following command:
gcloud init
- Set a default region and zone.
REST
로컬 개발 환경에서 이 페이지의 REST API 샘플을 사용하려면 gcloud CLI에 제공한 사용자 인증 정보를 사용합니다.
Install the Google Cloud CLI, then initialize it by running the following command:
gcloud init
자세한 내용은 Google Cloud 인증 문서의 REST 사용을 위한 인증을 참고하세요.
-
필요한 역할
VM의 세부정보를 보는 데 필요한 권한을 얻으려면 관리자에게 VM 또는 프로젝트에 대한 Compute 인스턴스 관리자(v1)(roles/compute.instanceAdmin.v1
) IAM 역할을 부여해 달라고 요청하세요.
역할 부여에 대한 자세한 내용은 프로젝트, 폴더, 조직에 대한 액세스 관리를 참조하세요.
이 사전 정의된 역할에는 VM의 세부정보를 보는 데 필요한 compute.instances.get
권한이 포함되어 있습니다.
커스텀 역할이나 다른 사전 정의된 역할을 사용하여 이 권한을 부여받을 수도 있습니다.
VM 세부정보 보기
VM 세부정보를 보려면 다음 옵션 중 하나를 선택합니다.
Google Cloud 콘솔에서 VM 인스턴스 페이지로 이동합니다.
VM 인스턴스 페이지에서 컴퓨팅 인스턴스에 대한 다음 정보를 볼 수 있습니다.
- 인스턴스 이름
- 인스턴스가 있는 영역
- 인스턴스에 사용되는 머신 유형
- 인스턴스가 스팟 VM으로 생성되었는지 여부를 나타내는 프로비저닝 모델
- 인스턴스에 사용 가능한 모든 추천
- VM 인스턴스가 인스턴스 그룹의 일부인지 여부
- 인스턴스에서 사용하는 IP 주소
이전 목록에는 VM 인스턴스 페이지에 표시되는 기본 열이 포함되어 있습니다.
열 표시 옵션을 클릭하여 각 VM에 표시되는 열을 변경할 수 있습니다.이름 열에서 VM 이름을 클릭하여 VM 인스턴스에 관한 추가 세부정보를 확인합니다.
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
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"
}
인스턴스의 CPU 및 메모리 할당 결정
컴퓨팅 인스턴스에 할당된 CPU 및 메모리 수는 인스턴스에서 사용하는 머신 유형에 따라 결정할 수 있습니다. 예를 들면 다음과 같습니다.
c3-standard-22
: C3는 머신 시리즈 이름이고standard
는 인스턴스의 메모리 할당 유형이며22
는 인스턴스에 할당된 vCPU 수입니다. 일반적으로standard
머신 유형은 vCPU당 4GB의 메모리 비율을 사용합니다. 따라서 이 머신 유형에는 RAM이 88GB 있습니다.standard
,highmem
,highcpu
,ultamem
,megamem
머신 유형의 메모리 대비 CPU 비율은 각 머신 시리즈마다 약간 다를 수 있으므로 머신 시리즈 페이지를 참고하여 각 머신 유형에 할당되는 정확한 메모리 양을 결정합니다.n2-custom-8-16384
: 맞춤 머신 유형의 경우 머신 유형의 첫 번째 부분이 머신 시리즈입니다. 단, 머신 시리즈를 전혀 포함하지 않는 N1 머신 유형은 예외입니다.custom
다음의 첫 번째 숫자는 vCPU 수이고 마지막 숫자는 인스턴스에 할당된 메모리 양(MB)입니다.
머신 유형에 대한 자세한 내용은 머신 계열 리소스 및 비교 가이드를 참고하세요.
다음 단계
VM 이름을 바꾸는 방법 알아보기
VM을 중지하거나 시작하는 방법을 알아보세요.
VM을 일시중지 또는 재개하는 방법을 알아보세요.
VM 수명 주기 자세히 알아보기