このドキュメントでは、既存の仮想マシン(VM)インスタンスの詳細を表示する方法について説明します。
VM の詳細を表示すると、アタッチされたディスク、作成タイムスタンプ、マシンタイプ、VM の ID などの、構成とステータスを確認できます。これらは、不変値を使用して VM を参照するために使用できます。
始める前に
-
まだ設定していない場合は、認証を設定します。認証とは、 Trusted Cloud by S3NS サービスと API にアクセスするために ID を確認するプロセスです。ローカル開発環境からコードまたはサンプルを実行するには、次のいずれかのオプションを選択して Compute Engine に対する認証を行います。
Select the tab for how you plan to use the samples on this page:
Console
When you use the Trusted Cloud console to access Trusted Cloud by S3NS services and APIs, you don't need to set up authentication.
gcloud
-
After installing the Google Cloud CLI, sign in to the gcloud CLI with your federated identity and then initialize it by running the following command:
gcloud init
- Set a default region and zone.
Trusted Cloud コンソールで、[VM インスタンス] ページに移動します。
[VM インスタンス] ページでは、コンピューティング インスタンスの次の情報を表示できます。
- インスタンスの名前。
- インスタンスが配置されているゾーン。
- インスタンスで使用されるマシンタイプ。
- プロビジョニング モデル。
- インスタンスで利用可能な推奨事項。
- VM インスタンスがインスタンス グループの一部であるかどうか。
- インスタンスで使用される IP アドレス。
上のリストには、[VM インスタンス] ページに表示されるデフォルトの列が含まれています。
[列表示オプション] をクリックすると、VM ごとに表示する列を変更できます。[名前] 列で VM 名をクリックすると、VM インスタンスの詳細が表示されます。
VM_NAME
: VM 名。ZONE
: VM が配置されているゾーン。PROJECT_ID
: VM が配置されているプロジェクトのプロジェクト ID。ZONE
: VM が配置されているゾーン。VM_NAME
: VM 名。c3-standard-22
: C3 はマシンシリーズ名、standard
はインスタンスのメモリ割り当てタイプ、22
はインスタンスに割り当てられた vCPU の数です。通常、standard
マシンタイプでは、vCPU あたり 4 GB のメモリが使用されます。したがって、このマシンタイプには 88 GB の RAM が搭載されています。standard
、highmem
、highcpu
、ultamem
、megamem
の各マシンタイプのメモリと CPU の比率は、マシンシリーズごとに若干異なる可能性があります。各マシンタイプに割り当てられるメモリの正確な量を確認するには、マシンシリーズのページをご覧ください。n2-custom-8-16384
: カスタム マシンタイプのマシンタイプの最初の部分はマシンシリーズです。ただし、マシンシリーズが含まれない N1 マシンタイプを除きます。custom
の後の最初の数値は vCPU の数で、最後の数値はインスタンスに割り当てられたメモリ量(MB)です。VM の名前を変更する方法を確認する。
VM を停止または起動する方法を確認する。
VM を一時停止または再開する方法を確認する。
VM のライフサイクルの詳細を確認する。
REST
このページの REST API サンプルをローカル開発環境で使用するには、gcloud CLI に指定した認証情報を使用します。
After installing the Google Cloud CLI, sign in to the gcloud CLI with your federated identity and then initialize it by running the following command:
gcloud init
詳細については、 Trusted Cloud 認証ドキュメントの REST を使用して認証するをご覧ください。
必要なロール
VM の詳細を表示するために必要な権限を取得するには、その VM またはプロジェクトに対する Compute インスタンス管理者(v1)(
roles/compute.instanceAdmin.v1
)IAM ロールを付与するよう管理者に依頼してください。ロールの付与については、プロジェクト、フォルダ、組織へのアクセス権の管理をご覧ください。この事前定義ロールには、VM の詳細を表示するために必要な
compute.instances.get
権限が含まれています。カスタムロールや他の事前定義ロールを使用して、この権限を取得することもできます。
VM の詳細を表示する
VM の詳細を表示するには、次のいずれかのオプションを選択します。
コンソール
gcloud
VM の詳細を表示するには、
gcloud compute instances describe
コマンドを使用します。gcloud compute instances describe VM_NAME \ --zone=ZONE
次のように置き換えます。
出力は次のようになります。
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.s3ns-system.iam.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
次のように置き換えます。
出力は次のようになります。
{ "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.s3ns-system.iam.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 数とメモリは、インスタンスで使用されるマシンタイプから判断できます。次に例を示します。
マシンタイプの詳細については、マシン ファミリーのリソースと比較ガイドをご覧ください。
次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-21 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-21 UTC。"],[[["This document provides instructions on how to view the details of an existing virtual machine (VM) instance, which includes its configuration and status information."],["Authentication is required to access Google Cloud services and APIs, and can be achieved through the Google Cloud console, gcloud CLI, or REST API samples."],["To view VM details, you need the `Compute Instance Admin (v1)` role or a custom role with the `compute.instances.get` permission, granted by your administrator."],["VM details can be viewed via the Google Cloud console by navigating to the \"VM instances\" page and clicking on the VM's name, or via the gcloud CLI using the `gcloud compute instances describe` command."],["The document also shows how to use a REST request to get the details, and explains how to determine the CPU and memory allocation for an instance based on its machine type."]]],[]] -