Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Linux
Windows
Sie erstellen eine VM-Instanz entweder aus einem Betriebssystem-Image oder einem Laufwerk-Image. In diesem Dokument erfahren Sie, wie Sie das Quell-Betriebssystem-Image oder Quelllaufwerk-Image einer VM ermitteln.
Hinweise
Richten Sie die Authentifizierung ein, falls Sie dies noch nicht getan haben.
Bei der Authentifizierung wird Ihre Identität für den Zugriff auf Google Cloud -Dienste und APIs überprüft. Zum Ausführen von Code oder Beispielen aus einer lokalen Entwicklungsumgebung können Sie sich so bei Compute Engine authentifizieren:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and
APIs, you don't need to set up authentication.
gcloud
Installieren Sie die Google Cloud CLI.
Initialisieren Sie die Google Cloud CLI nach der Installation mit dem folgenden Befehl:
Wenn Sie die REST API-Beispiele auf dieser Seite in einer lokalen Entwicklungsumgebung verwenden möchten, nutzen Sie die Anmeldedaten, die Sie der gcloud CLI bereitstellen.
Installieren Sie die Google Cloud CLI.
Initialisieren Sie die Google Cloud CLI nach der Installation mit dem folgenden Befehl:
Quell-Betriebssystem-Image oder Quelllaufwerk-Image einer VM ansehen
Verwenden Sie dieGoogle Cloud Console, die Google Cloud CLI oder die Compute Engine API, um das Quell-Betriebssystem-Image oder das Quelllaufwerk-Image einer VM aufzurufen.
Erforderliche Berechtigungen für diese Aufgabe
Zum Ausführen dieser Aufgabe benötigen Sie die folgenden Berechtigungen:
compute.instances.get für die Instanz
Console
Rufen Sie in der Google Cloud Console die Seite VM-Instanzen auf:
DISK_NAME: der Name des Laufwerks, von dem die Quelle angezeigt werden soll.
ZONE: Zone, in der sich das Laufwerk befindet
SOURCE: ein Wert, der angibt, ob das Quell-Betriebssystem-Image oder das Quelllaufwerk-Image zurückgegeben wird. Legen Sie dafür sourceDisk oder sourceImage fest. Bei der Angabe von sourceDisk oder sourceImage wird kein Wert zurückgegeben, es sei denn, ein entsprechendes Quell-Betriebssystem-Image oder ein Quelllaufwerk-Image ist vorhanden. Wenn kein Wert zurückgegeben wird, geben Sie den anderen Wert an und führen Sie den Befehl noch einmal aus.
REST
Mit der folgenden Methode instances.get können Sie die Laufwerke aufrufen, die an eine VM angehängt sind:
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME
Dabei gilt:
PROJECT_ID: die Projekt-ID
ZONE ist die Zone mit der VM.
VM_NAME: Der Name der VM
Sehen Sie sich mit der disks.get-Methode das Quell-Betriebssystem-Image oder Quelllaufwerk-Image an.
Bei einer VM mit einem Quell-Betriebssystem-Image gibt diese Methode das Quell-Image zurück, mit dem das Laufwerk im Feld sourceImage erstellt wurde. Bei einer VM mit einem Quelllaufwerk-Image gibt diese Methode stattdessen das Quell-Image im Feld sourceDisk zurück.
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/disks/DISK_NAME
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003eThis guide explains how to identify the source OS image or source disk image used to create a virtual machine (VM) instance.\u003c/p\u003e\n"],["\u003cp\u003eYou can determine the source image using the Google Cloud console, the Google Cloud CLI (gcloud), or the Compute Engine API.\u003c/p\u003e\n"],["\u003cp\u003eTo 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.\u003c/p\u003e\n"],["\u003cp\u003eRequired permissions include \u003ccode\u003ecompute.instances.get\u003c/code\u003e on the specific VM instance.\u003c/p\u003e\n"],["\u003cp\u003eThe 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.\u003c/p\u003e\n"]]],[],null,["# View the source image of a VM\n\nLinux Windows\n\n*** ** * ** ***\n\nYou create a virtual machine (VM) instance from either an [OS\nimage](/compute/docs/images/os-details) or a disk image. This document\nshows you how to determine the source OS image or source disk image of a VM.\n\nBefore you begin\n----------------\n\n- If you haven't already, set up [authentication](/compute/docs/authentication). Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:\n\n Select the tab for how you plan to use the samples on this page: \n\n ### Console\n\n\n When you use the Google Cloud console to access Google Cloud services and\n APIs, you don't need to set up authentication.\n\n ### gcloud\n\n 1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n After installation,\n [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command:\n\n ```bash\n gcloud init\n ```\n\n\n If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n 2. [Set a default region and zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\n ### REST\n\n\n To use the REST API samples on this page in a local development environment, you use the\n credentials you provide to the gcloud CLI.\n 1. [Install](/sdk/docs/install) the Google Cloud CLI. After installation, [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command: \n\n ```bash\n gcloud init\n ```\n 2. If you're using an external identity provider (IdP), you must first [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n\n For more information, see\n [Authenticate for using REST](/docs/authentication/rest)\n in the Google Cloud authentication documentation.\n\nView the source OS image or source disk image of a VM\n-----------------------------------------------------\n\nTo view the source OS image or source disk image of a VM, use the\nGoogle Cloud console, Google Cloud CLI, or Compute Engine API.\n\n#### Permissions required for this task\n\nTo perform this task, you must have the following\n[permissions](/iam/docs/overview#permissions):\n\n\n- `compute.instances.get` on the instance \n\n### Console\n\n1. In the Google Cloud console, go to the **VM instances** page.\n\n [Go to VM instances](https://console.cloud.google.com/compute/instances)\n2. Click the **Name** of the VM.\n\n3. The name of the source OS image or source disk image is in\n **Storage** \\\u003e **Boot\n disk** \\\u003e **Image**.\n\n### gcloud\n\n1. View the disks attached to a VM by using the following [`gcloud compute\n instances describe`\n command](/sdk/gcloud/reference/compute/instances/describe):\n\n ```\n gcloud compute instances describe VM_NAME\n ```\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM.\n2. View the source OS image or source disk image of the disk by using the\n following [`gcloud compute disks describe`\n command](/sdk/gcloud/reference/compute/disks/describe):\n\n ```\n gcloud compute disks describe DISK_NAME \\\n --zone=ZONE \\\n --format=\"get(SOURCE)\"\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eDISK_NAME\u003c/var\u003e: the name of the disk to view the\n source of.\n\n - \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone that the disk is located in.\n\n - \u003cvar translate=\"no\"\u003eSOURCE\u003c/var\u003e: a value that specifies whether to\n return the source OS image or the source disk image. Set to `sourceDisk`\n or to `sourceImage`. No value is returned when specifying `sourceDisk`\n or `sourceImage` unless there is a corresponding source OS image or a\n source disk image. If no value is returned, specify the other value and\n run the command again.\n\n### REST\n\n1. View the disks attached to a VM by using the following [`instances.get`\n method](/compute/docs/reference/rest/v1/instances/get):\n\n ```\n GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID\n - \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone containing the VM\n - \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: the name of the VM\n2. View the source OS image or source disk image of the disk by using the\n [`disks.get` method](/compute/docs/reference/rest/v1/disks/get).\n\n For a VM that has a source OS image, this method returns the source image\n that was used to create the disk in the `sourceImage` field. For a VM\n that has a source disk image, this method instead returns the source\n image in the `sourceDisk` field. \n\n ```\n GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/disks/DISK_NAME\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID\n - \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone containing the disk\n - \u003cvar translate=\"no\"\u003eDISK_NAME\u003c/var\u003e: the name of the disk\n\nWhat's next\n-----------\n\n- Learn more about [OS images](/compute/docs/images) on Compute Engine."]]