Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Linux
Windows
In diesem Dokument wird beschrieben, wie Sie den UUID (Universally Unique Identifier) einer VM-Instanz mithilfe eines Tools abrufen, das für das Betriebssystem der VM spezifisch ist.
Jede VM hat einen UUID mit den folgenden Attributen:
Der Wert ist für jede Compute Engine-VM einzigartig.
Er wird aus der Projekt-ID, der Zone und dem Namen der VM generiert.
Er ist für die gesamte Lebensdauer der VM stabil. Wenn die VM gelöscht und im selben Projekt, in derselben Zone und mit demselben Namen neu erstellt wird, erhält sie den gleichen UUID.
UUIDs sind nur für VMs verfügbar, die am oder nach dem 30. Oktober 2014 erstellt wurden. Wenn Sie eine VM vor diesem Datum erstellt haben, erstellen Sie die VM neu, damit Compute Engine ihr einen UUID zuweisen kann.
Betriebssystem-Tools zum Abrufen der UUID einer VM verwenden
Führen Sie zum Abrufen des UUID einer VM den Befehl aus, der dem Betriebssystem der VM entspricht:
Linux
Führen Sie auf der Linux-VM den folgenden dmidecode-Befehl aus:
sudo dmidecode -t system | grep UUID
Sie sollten eine Antwort ähnlich der folgenden erhalten:
UUID: 3748eb17-a207-5bc3-aa4f-3113a1b9409d
Windows (Cmd.exe)
Führen Sie in der Eingabeaufforderung auf der Windows-VM den folgenden wmic-Befehl aus:
wmic path win32_computersystemproduct get uuid
Sie sollten eine Antwort ähnlich der folgenden erhalten:
UUID
81CBB42C-73A0-9660-6C7D-2FE94627F3A3
Windows (PowerShell)
Führen Sie in PowerShell den folgenden WMI-Befehl (Windows-Verwaltungsinstrumentation) aus:
[[["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-05-29 (UTC)."],[[["\u003cp\u003eThis guide provides instructions on how to retrieve the Universally Unique Identifier (UUID) of a virtual machine (VM) instance using operating system-specific tools.\u003c/p\u003e\n"],["\u003cp\u003eEach Compute Engine VM has a unique and stable UUID, which is generated from the VM's project ID, zone, and name, and remains consistent throughout the VM's lifetime.\u003c/p\u003e\n"],["\u003cp\u003eFor Linux VMs, you can use the \u003ccode\u003edmidecode\u003c/code\u003e command to obtain the UUID, while for Windows VMs, you can use either the \u003ccode\u003ewmic\u003c/code\u003e command in the Command Prompt or a Windows Management Instrumentation (WMI) command in PowerShell.\u003c/p\u003e\n"],["\u003cp\u003eVMs created before October 30, 2014, do not have UUIDs and will require recreation to be assigned one.\u003c/p\u003e\n"]]],[],null,["# Get the UUID of a VM\n\nLinux Windows\n\n*** ** * ** ***\n\nThis document shows you how to get the universally unique identifier (UUID) of a\nvirtual machine (VM) instance by using a tool that is specific to the VM's\noperating system.\n\nEach VM has a UUID that has the following properties:\n\n- It is unique among Compute Engine VMs.\n\n- It is generated from the VM's project ID, zone, and name.\n\n- It is stable for the lifetime of the VM. If the VM is deleted and\n recreated in the same project, zone, and with the same name, the VM receives\n the same UUID.\n\nUUIDs are only available for VMs created on or after October 30, 2014. If you\nhave a VM created before that date, recreate the VM so Compute Engine\ncan assign it a UUID.\n\nUse operating system tools to get the UUID of a VM\n--------------------------------------------------\n\nTo get the UUID of a VM, run the command that corresponds to the VM's\noperating system: \n\n### Linux\n\n1. From the Linux VM, run the following\n [`dmidecode`](http://www.nongnu.org/dmidecode/) command:\n\n ```\n sudo dmidecode -t system | grep UUID\n ```\n2. Verify a response similar to the following:\n\n ```\n UUID: 3748eb17-a207-5bc3-aa4f-3113a1b9409d\n ```\n\n### Windows (Cmd.exe)\n\n1. From the Command Prompt on the Windows VM, run the following\n [`wmic`](https://docs.microsoft.com/windows/win32/wmisdk/wmic) command:\n\n ```\n wmic path win32_computersystemproduct get uuid\n ```\n2. Verify a response similar to the following:\n\n ```\n UUID\n 81CBB42C-73A0-9660-6C7D-2FE94627F3A3\n ```\n\n### Windows (PowerShell)\n\n1. From PowerShell, run the following [Windows Management Instrumentation (WMI)](https://docs.microsoft.com/powershell/scripting/learn/ps101/07-working-with-wmi) command:\n\n ```\n (Get-WmiObject -Class Win32_ComputerSystemProduct).UUID\n ```\n2. Verify a response similar to the following:\n\n ```\n 81CBB42C-73A0-9660-6C7D-2FE94627F3A3\n ```"]]