Linux中是否存在可以唯一标识VM实例的UUID类型的值? [英] Is there a UUID type of value in Linux that can uniquely identify an instance of a VM?

查看:668
本文介绍了Linux中是否存在可以唯一标识VM实例的UUID类型的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Linux上运行的应用程序.每个人都将尝试从OS中获取UUID并报告给集中式服务器.我想确保所有实例都使用全局唯一的UUID运行.

I have an app that runs in Linux. Each one will try to get a UUID from OS and report to a centralized server. I want to make sure all instance are running with globally unique UUID.

如果linux是裸机,则它只能读取UUID(例如,来自dmidecode命令).但是,如果在VM上,由于可以复制或移动VM,因此dmidecode中的UUID可能相等.

If the linux is on bare metal, it can just read the UUID (say, from dmidecode command). But if it's on VM, the UUID (from dmidecode) can potentially be equal since the VM can be copied or moved.

有什么想法吗?

顺便说一句,对于在物理硬件(而非VM)上运行的Linux,如果用户更改内存,NIC等,UUID会更改吗?

By the way, for Linux running on physical hardware (not on VM), if user changes memory, NIC etc, will UUID change?

谢谢.

推荐答案

如果linux是裸机,则它只能读取UUID(例如,来自dmidecode命令).但是,如果在VM上,由于可以复制或移动VM,因此dmidecode中的UUID可能相等.

If the linux is on bare metal, it can just read the UUID (say, from dmidecode command). But if it's on VM, the UUID (from dmidecode) can potentially be equal since the VM can be copied or moved.

VMware产品实际上不是这种情况. BIOS UUID(由dmidecode返回的UUID)用作ESX主机和vCenter的清单UUID属性,并且不允许在同一系统上复制UUID.这意味着每个vCenter或每台主机(如果没有vCenter)只能有一个UUID.过去,我已经成功地将这个UUID用作标识符.

This is not actually the case for VMware products. The BIOS UUID (the one returned by dmidecode) is used as the inventory UUID property of ESX hosts and vCenter, and duplication of the UUID is not allowed on the same system. This means only one machine can have that UUID per vCenter, or per host if there is no vCenter. I've used this UUID as an identifier in the past with success.

要多次运行您的程序,他们必须将其安装在单独主机上的VM或完全不同的vCenter中.仅运行一个程序就需要大量资源,而且我认为这远远超出了许可证执行收益递减的情况.

To run your program more than once, they'd have to install it in a VM on a separate host, or in an entirely different vCenter. That's an awful lot of resources required just to run more than one of your program, and I think it's well beyond the diminishing returns of license enforcement.

工作站使用与ESX/vCenter相同的数据布局,因此我希望它具有相同的限制.

Workstation uses the same data layout as ESX/vCenter, so I expect that it has the same restriction.

这篇关于Linux中是否存在可以唯一标识VM实例的UUID类型的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆