本頁面中的部分或全部資訊可能不適用於 Trusted Cloud by S3NS。
取得 VM 的 UUID
本文說明如何使用虛擬機器 (VM) 作業系統專屬的工具,取得 VM 執行個體的通用不重複 ID (UUID)。
每個 VM 都有 UUID,且具備下列屬性:
只有在 2014 年 10 月 30 日當天或之後建立的 VM 上才有 UUID。如果 VM 是在該日期前建立,請重新建立 VM,讓 Compute Engine 指派 UUID。
如要取得 VM 的 UUID,請執行對應 VM 作業系統的指令:
Linux
在 Linux VM 中,執行下列 dmidecode
指令:
sudo dmidecode -t system | grep UUID
確認類似以下的回應:
UUID: 3748eb17-a207-5bc3-aa4f-3113a1b9409d
Windows (Cmd.exe)
在 Windows VM 的命令提示字元中,執行下列 wmic
指令:
wmic path win32_computersystemproduct get uuid
確認類似以下的回應:
UUID
81CBB42C-73A0-9660-6C7D-2FE94627F3A3
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-18 (世界標準時間)。
[[["容易理解","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-08-18 (世界標準時間)。"],[[["This guide provides instructions on how to retrieve the Universally Unique Identifier (UUID) of a virtual machine (VM) instance using operating system-specific tools."],["Each 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."],["For Linux VMs, you can use the `dmidecode` command to obtain the UUID, while for Windows VMs, you can use either the `wmic` command in the Command Prompt or a Windows Management Instrumentation (WMI) command in PowerShell."],["VMs created before October 30, 2014, do not have UUIDs and will require recreation to be assigned one."]]],[]]