复制移动VMware Workstation虚拟机文件产生的问题

  关于I moved it和I copied it的异同——复制移动VMware Workstation虚拟机文件产生的问题

  我们在对一个虚拟机系统做复制或者移动到另一个新的位置的时候,启动虚拟机时会有如下提示:
  This virtual machine may have been moved or copied.
  In order to configure certain management and networking features VMware Workstation needs to know which.
  Did you move this virtual machine, or did you copy it?
  If you don''t know, answer "I copied it".
  为什么会产生这个问题呢,还需要从UUID谈起(UUID是指在一台机器上生成的数字,它保证对在同一时空中的所有机器都是唯一的。通常平台会提供生成UUID的API ),虚拟机同样会有一个UUID,而且这个UUID是唯一的。
  虚拟机的UUID一般和虚拟机配置文件的位置和物理主机有关。当我们对一个虚拟机系统做移动操作的时候,我们不需要新建一个UUID。让我们复制一个虚拟机的时候我们应该选择建立一个新的UUID,来保证此虚拟机的唯一性。
  当我们利用尝试拷贝或移动一个位于datastore里面的虚拟机时,系统会提示我们:
  A.I_Moved it;
  B.I_Copied it;
  同时我们能看到如下消息:
  “msg.uid.altered:This virtual machine may have been moved or copied”,那么,这一切究竟是什么意思呢??
  首先,我们应该了解一下,上面消息中所说的UUID是个什么东西?
  UUID的全称是:universally unique identifier。UUID是一个128位的数值,用它来区别每个虚拟机之间的差异。
  在虚拟机被开启或移动时,UUID会自动生成,UUDI的值是基于物理主机并且保存在*.vmx文件里面的。UUID值存储在vmx文件的2个位置:
  A.uuid.bios;
  B.uuid.location(这是虚拟机的当前路径);
  比如:uuid.bios="56 4d 5e 58 66 f5 2d 04-03 31 0a bd 6f a7 19 88"
  UUID同时还存储与虚拟机的BIOS里面。当虚拟机开启或被移动时,UUID的uuid.location值会随着虚拟机存储位置变化而相应的变化。一旦虚拟机的位置发生变化,那么uuid.location值也会发生相应的变化,这时,就会提示我们最开始描述的信息。
  那么UUID为什么那么重要呢?如果UUID相同会发生什么事儿呢?其实,最关键的一个还是UUID的最后几位是和虚拟机的MAC地址有关的,如果不发生变更,在我们克隆虚拟机时,可能导致UUID相同,那么,MAC地址会发生冲突,那么,网络就会存在问题。
  那么,究竟该选者“I Moved it”还是“I Copied it”呢?其实,这个问题,我们通过分别执行一下之后对比vmx文件里的内容就知道了:
  I Moved it:
  由于是移动这个虚拟机,那么只有uuid.location发生变化,MAC地址是没有变化的。
  I Copied it:

  由于是拷贝虚拟机,那么uuid.bios和uuid.location都会发生变化,这是MAC地址就会发生变化。

【uuid产生的算法似乎跟mac地址是有关系的】


Each virtual machine is automatically assigned a universally unique identifier (UUID), which is stored in the SMBIOS system information descriptor. It can be accessed by standard SMBIOS scanning software (for example, SiSoftware Sandra or the IBM utility smbios2) and is used for system management in the same way you use the UUID of a physical computer.

The UUID is a 128-bit integer. The 16 bytes of this value are separated by spaces, except for a dash between the eighth and ninth hexadecimal pairs. A sample UUID looks like this:

56 4d ef 2d 3f d4 14 e2-2e 04 c5 34 3a ec ee 65

The UUID is based on the physical computer's identifier and the path to the virtual machine's configuration file. This UUID is generated when you power on or reset the virtual machine. As long as you do not move or copy the virtual machine to another location, the UUID remains constant.

If you move or copy the virtual machine, you may be offered the choice of creating a new UUID or keeping the old UUID when you first power on the virtual machine. This new UUID is based on the physical computer's identifier and path to the virtual machine's configuration file in its new location.

When you power on a virtual machine that was moved or copied to a new location, the following message usually appears:
 
In ESX/ESXi 3.x
 
The virtual machine's configuration file has changed its location since its last poweron. Do you want to create a new unique identifier (UUID) for the virtual machine or keep the old one?
  • Create
  • Keep
  • Always Create
  • Always Keep
In ESX/ESXi 4.x
 
Question (id = 0) : msg.uuid.altered:This virtual machine might have been moved or copied.
In order to configure certain management and networking features, VMware ESX needs to know if this virtual machine was moved or copied.
If you don't know, answer "I copied it".
  • Cancel
  • I moved it
  • I copied it

If you moved this virtual machine, you can choose to keep the UUID. SelectKeep/I moved it, then click OK to continue powering on the virtual machine.

If you copied this virtual machine to a new location, you should create a new UUID since the copy of the virtual machine is using the same UUID as the original virtual machine. SelectCreate/I copied it, then click OK to continue powering on the virtual machine.

If the original virtual machine is being used as a template for more virtual machines, you can choose to create a new UUID the first time you power on each copy. After you configure the virtual machine and are ready to make it a template, move it to a new location and power it on. When the message appears after you power on, selectAlways Create, then click OK to continue powering on the virtual machine. The virtual machine is set up to create a new UUID every time it is moved. Power off the virtual machine and begin using it as a template by copying the virtual machine files to other locations.

If you intend to move the virtual machine numerous times and want to keep the same UUID each time the virtual machine moves, selectAlways Keep and click OK to continue powering on the virtual machine.

Note: If you want to change theAlways Keep or Always Create setting, power off the virtual machine and edit its configuration (.vmx) file. Delete the line that containsuuid.action = "create" or uuid.action = "keep". For tips for editing a .vmx file, seeKB 1714.

Sometimes the message quoted above does not appear. The message does not appear in any of the following circumstances:

  • The line uuid.bios = "" does not exist in the virtual machine's configuration file.
  • The line uuid.bios = "" exists, but has an invalid value.
  • The line uuid.bios = "" exists with a valid value, and either the lineuuid.action = "keep" or the line uuid.action = "change" exists in the virtual machine's configuration file.

Suspending and resuming a virtual machine does not trigger the process that generates a UUID. Thus, the UUID in use at the time the virtual machine was suspended remains in use when the virtual machine is resumed, even if it has been copied or moved. The next time the virtual machine is rebooted, however, the message appears, so you can choose to create a new UUID or keep the existing one.

Specifying a UUID for a Virtual Machine

In some circumstances you may want to assign a specific UUID to the virtual machine. To do this, you need to override the automatically generated UUID value. Power off the virtual machine and edit its configuration (.vmx) file to set the value of the UUID parameter. Use a text editor to edit the configuration file. The format for the line is:
uuid.bios = ""
 
The UUID value must be surrounded by quotation marks. A sample configuration line looks like:

uuid.bios = "00 11 22 33 44 55 66 77-88 99 aa bb cc dd ee ff"

After you add this line to the configuration file, power on the virtual machine. The new UUID is used when the virtual machine boots.




  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值