为了监视目的,我需要注册运行在真实硬件上以及虚拟机上的Linux服务器,AWS,Azure,..。通过发送他们独特的身份。我想出了
sudo dmidecode | grep UUID是最好的选择,因为它的结果是不同的,即使您已经克隆了虚拟机,而没有重新初始化MAC地址。
但是dmidecode并不是到处都安装的。因此,我试图理解to文件/sys/设备/虚拟/dmi/id/product总是包含与dmidecode提供的相同的UUID。
发布于 2016-06-15 12:07:59
dmidecode | grep UUID和/sys/devices/virtual/dmi/id/product_uuid应该相等,但取决于您的系统,输出可能是不同的。
来自dmidecode 源代码
/*
* As of version 2.6 of the SMBIOS specification, the first 3
* fields of the UUID are supposed to be encoded on little-endian.
* The specification says that this is the defacto standard,
* however I've seen systems following RFC 4122 instead and use
* network byte order, so I am reluctant to apply the byte-swapping
* for older versions.
*/另见:[修补程序] dmi,对sysfs产品UUID使用小端。
我注意到,可抗还首先尝试了/sys,然后返回到dmidecode可执行文件来收集与dmi相关的事实。
https://stackoverflow.com/questions/37829168
复制相似问题