How to get unique ID of a Citrix XenServer VM from the guest OS?

二次信任 提交于 2019-12-12 19:16:20

问题


Let's say I have multiple Citrix XenServer VMs with the same name. Or, the names are garbage, doesn't matter.

From the guest OS on one of those VMs, how can I programatically determine the ID of the VM? I was hoping the UUID of the VM would should as the guest OS's BIOS serial number, but it doesn't. Have looked everywhere, registry, WMI, you name it.

Now, the reason I won't just use the hostname, is that I might have multiple machines with same hostname (e.g. a full lab with copies of VMs).

Using XenServer 5.x and 6.x.

Cheers.


回答1:


Ah, you can get the UUID from the guest this way (as I hoped) in Xen Server v6.x: Serial number of the BIOS. For a Windows guest, you can use WMI to query that either locally or remotely. I suspect this ID-as-BIOS-serial was only introduced in Xen Server v5.6.

For earlier versions, you can get the UUID from the guest by running the old client tools. For a Windows guest, the executable is xenstore_client.exe, run that with parameter of 'read vm'. The output of that is a string, and the part after the forward slash is the UUID. Note you could use PSEXEC to remotely execute xenstore_client.exe.



来源:https://stackoverflow.com/questions/15802876/how-to-get-unique-id-of-a-citrix-xenserver-vm-from-the-guest-os

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!