仮想マシン(VM)インスタンスは、OS イメージまたはディスク イメージから作成します。このドキュメントでは、VM のソース OS イメージやソースディスク イメージを確認する方法について説明します。
始める前に
-
まだ設定していない場合は、認証を設定します。認証とは、 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 の [名前] をクリックします。
ソース OS イメージまたはソースディスク イメージの名前は、[ストレージ] > [ブートディスク] > [イメージ] にあります。
次の
gcloud compute instances describe
コマンドを使用して、VM にアタッチされたディスクを表示します。gcloud compute instances describe VM_NAME
VM_NAME
は VM の名前で置き換えます。次の
gcloud compute disks describe
コマンドを使用して、ソース OS イメージまたはディスクのソースディスク イメージを表示します。gcloud compute disks describe DISK_NAME \ --zone=ZONE \ --format="get(SOURCE)"
次のように置き換えます。
DISK_NAME
: ソースを表示するディスクの名前。ZONE
: VM が配置されているゾーン。SOURCE
: ソース OS イメージとソースディスク イメージのどちらを返すかを指定する値。sourceDisk
またはsourceImage
に設定します。sourceDisk
またはsourceImage
を指定した場合、対応するソース OS イメージまたはソースディスク イメージがない限り、値は返されません。値が返されない場合は、他の値を指定して、コマンドを再度実行します。
次の
instances.get
メソッドを使用して、VM にアタッチされたディスクを表示します。GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME
次のように置き換えます。
PROJECT_ID
: プロジェクト IDZONE
: VM を含むゾーンVM_NAME
: VM の名前
disks.get
メソッドを使用して、ディスクのソース OS イメージまたはソースディスク イメージを表示します。ソース OS イメージを持つ VM の場合、このメソッドは、ディスクの作成に使用されたソースイメージを
sourceImage
フィールドで返します。ソースディスク イメージを持つ VM の場合、このメソッドは、代わりにそのソースイメージをsourceDisk
フィールドで返します。GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/disks/DISK_NAME
次のように置き換えます。
PROJECT_ID
: プロジェクト IDZONE
: ディスクを含むゾーンDISK_NAME
: ディスクの名前
- Compute Engine の OS イメージについて学習する。
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 のソース OS イメージやソースディスク イメージの表示
VM のソース OS イメージやソースディスク イメージを表示するには、Trusted Cloud コンソール、Google Cloud CLI、または Compute Engine API を使用します。
コンソール
gcloud
REST
次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 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 guide explains how to identify the source OS image or source disk image used to create a virtual machine (VM) instance."],["You can determine the source image using the Google Cloud console, the Google Cloud CLI (gcloud), or the Compute Engine API."],["To access and use the services, authentication is needed and the methods to authenticate are explained for the Google Cloud Console, the gcloud CLI, and REST."],["Required permissions include `compute.instances.get` on the specific VM instance."],["The location of the required source image information can be found in the storage section under the boot disk in the Google Cloud Console and by using the gcloud command lines to view the disk and then its source."]]],[]] -