Clone VM, Move VM, vMotion

最後更新: 2021-06-24

 


Copy VM Folder 到新 hypervisor

 

PowerOn VM 時會問你係 copy 還是 move 佢

"i copied it"

When you select that the VM has been copied then there a few more changes that are made to the VM’s configuration file when compared to just moving it.

The "I Copied It" option should be used when you’ve made, and intend to run, more than one copy of the VM in your vSphere environment.

*.vmx 會有以下改變

  • uuid.bios
  • uuid.location
  • ethernet.generatedaddress

"i moved it"

By indicating that you had moved the VM (instead of copying it)

the only UUID change that is made to the configuration file is to the ‘uuid.location’ setting,

which as you’d expect indicates a change of location for the VM.

The ‘uuid.bios’ and the existing generated network MAC address remains that same.

You will also notice that the CPUID settings have also changed which is also the case for when you indicate that the VM was copied.

*.vmx 會有以下改變

uuid.location
guestCPUID.x
hostCPUID.x
userCPUID.x

uuid.location

it is a uniquie identifier that the vmkernel creates for each VM to be able to identify it.

It will change any time your move or copy a VM (as it does with vmotion).

When a virtual machine is powered on, ESX Server generates a UUID and

compares it to the values for "uuid.location" and (if it exists) uuid.bios in the configuration file.

If the UUID does not match the value of uuid.location, the newly generated value is

used as the virtual machineís UUID and is saved to the configuration file,

replacing the previous value of uuid.location and (if it exists) uuid.bios.

Notes

 * If a virtual appliance has no CPUID information, I would assume it has no CPU constraints.

GuestCPUID 與 UserCPUID

GuestCPUID

represents the feature bits exposed to the VM

UserCPUID

It is what will be visible to the guest ring-3 code running natively when using binary translation.
  (Most ring-3 code runs natively (in a mode we refer to as "direct execution.")  Prior to the introduction of CPUID faulting)
  (no binary translation)

 * These fields are rewritten at each power-on, so there is little point in changing them manually.

 


Specifying a UUID for a VM

 

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.

Note: VMware Tools may need to be removed from the virtual machine prior changing the UUID to prevent the UUID from reverting.

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"

keep UUID 步驟

1) record UUID

當 uuid.bios 設定不在時, uuid.location 就是 VM 的 UUID

2) copy it to new hypervisor

3) Set UUID

Set the value of uuid.bios to the value you recorded and

remove the uuid.location line in the virtual machine 's configuration file.

測試

 * Any changes to the UUID take effect only after the virtual machine is rebooted.

 


保留 MAC Address

 

VMware's OUI 00:50:56

假設人手設定 MAC "00:0c:29:9c:00:01", 啟動 Instance 會出 err

Failed to power on virtual machine server.test.
Impermissible static Ethernet address: '00:0c:29:?:?:?'.
It conflicts with VMware reserved MACs. Click here for more details.

[Fix] Disable MAC Adress Checking

cd /vmfs/volumes/DatastoreName/VMFolderName

cp vmname.vmx vmname.vmx.old

vi vmname.vmx

ethernetN.checkMACAddress = "false"
ethernetN.addressType = "static"
ethernetN.Address = "XX:XX:XX:XX:XX:XX"

 


vMotion

 

By default, data for VM cold migration, cloning, and snapshots is transferred through the management network.

This traffic is called provisioning traffic.

On a host, dedicate a separate VMkernel interface to the provisioning traffic, for example, to isolate this traffic on another VLAN.

Troubleshoot

vmotion Error - Cannot Connect Host

Firewall 要開 NFC(902/tcp) & vMotion (8000/tcp)

Creative Commons license icon Creative Commons license icon