[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\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 ```"]]