Moving a virtual machine from VMWare Workstation to VMware ESXi 6.5

In this example a F5 LTM Virtual Edition will be moved from Workstation to ESXi.

My first expectation was that moving a VM from Workstation to ESXi works out of the box and is quickly done… So I simply copied an existing VM (the .vmx file and the corresponding vmdk disk images) to the datasore of the ESXi host.

Copying the files can be done using the Web UI file browser or by enabling ssh access on the ESXi host and using scp to move the file to the host.

The datastore on the ESXi can be found at here: /vmfs/volumes/<UUID<//

The files for the F5 VM after copying them to ESXi datastore:

\[root@esxi:/vmfs/volumes/4ddcbe22-8dd05e9e-729c-e4115b0d6800/F5-testing2\] ls -la
total 5810192
drwxr-xr-x    1 root     root           700 Jun 18 09:48 .
drwxr-xr-t    1 root     root          2380 Jun 18 09:46 ..
-rw-r--r-- 1 root     root       2752512 Jun 18 09:46 f5-lb1-disk1.vmdk
-rw-r--r-- 1 root     root     5944705024 Jun 18 09:48 f5-lb1-disk2.vmdk
-rw-r--r-- 1 root     root          3454 Jun 18 09:48 f5-lb1.vmx
\[root@esxi:/vmfs/volumes/4ddcbe22-8dd05e9e-729c-e4115b0d6800/F5-testing2\]

Now that the files are on the ESXi host the VM can be imported through the WEB UI using create/register new VM:

Power on the VM

When import and creation of the VM is completed, power it on. The system asks if the machine has been copied or moved. Select option “I moved it”. This will keep some hardware device setting like Ethernet MAC addresses and system UUID unchanged. In some cases this might not be important but for the F5 VM the license is bound to the MAC address and the system UUID so it’s better to preserve them…

Error message after power on

Fehlgeschlagen  - Nicht unterstützter oder ungültiger Festplattentyp 2 für 'scsi0:0'.
Das virtuelle SCSI-Gerät für 'scsi0:0' (/vmfs/volumes/4ddcbe22-8dd05e9e-729c-e4115b0d6800/F5-testing2/f5-lb1-disk2.vmdk) konnte nicht erstellt werden.

After doing some research I found a helpful entry in vmware forums (http://vmware-forum.de/viewtopic.php?t=21402) which states that the virtual disk images must be migrated to the vmfs file system first before they can be used on ESXi.

More information about the VMFS datastores: https://pubs.vmware.com/vsphere-50/topic/com.vmware.vsphere.storage.doc_50/GUID-5EE84941-366D-4D37-8B7B-767D08928888.html

Use vmkfstools clone option to migrate the virtual disk images to correct VMFS file format

\[root@esxi:/vmfs/volumes/4ddcbe22-8dd05e9e-729c-e4115b0d6800/F5-testing2\] vmkfstools -i "f5-lb1-disk1.vmdk" "f5-lb1-disk1-esxi.vmdk" -d thin
Destination disk format: VMFS thin-provisioned
Cloning disk 'f5-lb1-disk1.vmdk'...
Clone: 100% done.
\[root@esxi:/vmfs/volumes/4ddcbe22-8dd05e9e-729c-e4115b0d6800/F5-testing2\] vmkfstools -i "f5-lb1-disk2.vmdk" "f5-lb1-disk2-esxi.vmdk" -d thin
Destination disk format: VMFS thin-provisioned
Cloning disk 'f5-lb1-disk2.vmdk'...
Clone: 100% done.
\[root@esxi:/vmfs/volumes/4ddcbe22-8dd05e9e-729c-e4115b0d6800/F5-testing2\] ls -la
total 13205520
drwxr-xr-x    1 root     root          2240 Jun 18 10:21 .
drwxr-xr-t    1 root     root          2380 Jun 18 09:46 ..
-rw------- 1 root     root     21474836480 Jun 18 10:19 f5-lb1-disk1-esxi-flat.vmdk
-rw------- 1 root     root           566 Jun 18 10:19 f5-lb1-disk1-esxi.vmdk
-rw-r--r-- 1 root     root       2752512 Jun 18 09:46 f5-lb1-disk1.vmdk
-rw------- 1 root     root     111669149696 Jun 18 10:21 f5-lb1-disk2-esxi-flat.vmdk
-rw------- 1 root     root           568 Jun 18 10:21 f5-lb1-disk2-esxi.vmdk
-rw-r--r-- 1 root     root     5944705024 Jun 18 09:48 f5-lb1-disk2.vmdk
-rw-r--r-- 1 root     root             0 Jun 18 09:52 f5-lb1.vmsd
-rw-r--r-- 1 root     root          3541 Jun 18 10:04 f5-lb1.vmx
-rw-r--r-- 1 root     root         65554 Jun 18 10:02 vmware-1.log
-rw-r--r-- 1 root     root         61218 Jun 18 10:03 vmware-2.log
-rw-r--r-- 1 root     root         61218 Jun 18 10:03 vmware-3.log
-rw-r--r-- 1 root     root         61218 Jun 18 10:03 vmware-4.log
-rw-r--r-- 1 root     root         61218 Jun 18 10:04 vmware-5.log
-rw-r--r-- 1 root     root         61218 Jun 18 10:04 vmware.log
\[root@esxi:/vmfs/volumes/4ddcbe22-8dd05e9e-729c-e4115b0d6800/F5-testing2\]
\[root@esxi:/vmfs/volumes/4ddcbe22-8dd05e9e-729c-e4115b0d6800/F5-testing2\] du -h \*
1.0M    f5-lb1-disk1-esxi-flat.vmdk
0       f5-lb1-disk1-esxi.vmdk
3.0M    f5-lb1-disk1.vmdk
7.0G    f5-lb1-disk2-esxi-flat.vmdk
0       f5-lb1-disk2-esxi.vmdk
5.5G    f5-lb1-disk2.vmdk
0       f5-lb1.vmsd
8.0K    f5-lb1.vmx
1.0M    vmware-1.log
1.0M    vmware-2.log
1.0M    vmware-3.log
1.0M    vmware-4.log
1.0M    vmware-5.log
1.0M    vmware.log
\[root@esxi:/vmfs/volumes/4ddcbe22-8dd05e9e-729c-e4115b0d6800/F5-testing2\] 

To make the VM use the new virtual disks the vmx file must be adapted. Modify the existing file or create a copy.

In the vmx file locate the disk image properties and replace the old entries with the newly created virtual disks.

Before:

scsi1:0.present = "TRUE"
scsi1:0.deviceType = "disk"
scsi1:0.fileName = "f5-lb1-disk1.vmdk"
scsi1:0.mode = "persistent"
scsi1.virtualDev = "lsilogic"
scsi1.present = "TRUE"
scsi0:0.present = "TRUE"
scsi0:0.deviceType = "disk"
scsi0:0.fileName = "f5-lb1-disk2.vmdk"
scsi0.virtualDev = "lsilogic"
scsi0.present = "TRUE" 

After:

scsi1:0.present = "TRUE"
scsi1:0.deviceType = "disk"
scsi1:0.fileName = "f5-lb1-disk1-esxi.vmdk"
scsi1:0.mode = "persistent"
scsi1.virtualDev = "lsilogic"
scsi1.present = "TRUE"
scsi0:0.present = "TRUE"
scsi0:0.deviceType = "disk"
scsi0:0.fileName = "f5-lb1-disk2-esxi.vmdk"
scsi0.virtualDev = "lsilogic"
scsi0.present = "TRUE" 

Double-Check vmx entries

Double check the uuid.bios and ethernet0.generatedAddress entries in the vmx file and ensure that they are unchanged compared to the original file from VMWare Workstation. If one of the two mentioned entries has been changed during import change it back to the original setting.

Otherwise the F5 license will not be operational!

Modify Ethernet settings in vmx file

Another issue occurred with the Ethernet adapter setting. The ESXi server is configured with a couple of different network zones (MGMT, DMZ, PROD, LAB). Normally the zone can be selected/changed through WEB UI VM settings. But in this case it’s possible to change the setting and save it. But after opening the VM settings again the old entries are still there.

To make this work the Ethernet settings in the vmx file must be adapted.

Before:

ethernet0.present = "TRUE"
ethernet0.virtualDev = "vmxnet3"
ethernet0.connectionType = "pvn"
ethernet0.startConnected = "TRUE"
ethernet0.addressType = "generated"
ethernet1.present = "TRUE"
ethernet1.virtualDev = "vmxnet3"
ethernet1.connectionType = "pvn"
ethernet1.startConnected = "TRUE"
ethernet1.addressType = "generated"
ethernet2.present = "TRUE"
ethernet2.virtualDev = "vmxnet3"
ethernet2.connectionType = "pvn"
ethernet2.startConnected = "TRUE"
ethernet2.addressType = "generated"
ethernet3.present = "TRUE"
ethernet3.virtualDev = "vmxnet3"
ethernet3.connectionType = "bridged"
ethernet3.startConnected = "TRUE"
ethernet3.addressType = "generated" 

After:

ethernet0.present = "TRUE"
ethernet0.virtualDev = "vmxnet3"
ethernet0.networkName = "MGMT"
ethernet0.addressType = "generated"
ethernet0.wakeOnPcktRcv = "FALSE"
ethernet0.uptCompatibility = "TRUE"
ethernet1.present = "TRUE"
ethernet1.virtualDev = "vmxnet3"
ethernet1.networkName = "LAB"
ethernet1.addressType = "generated"
ethernet1.wakeOnPcktRcv = "FALSE"
ethernet1.uptCompatibility = "TRUE"
ethernet2.present = "TRUE"
ethernet2.virtualDev = "vmxnet3"
ethernet2.networkName = "LAB"
ethernet2.addressType = "generated"
ethernet2.wakeOnPcktRcv = "FALSE"
ethernet2.uptCompatibility = "TRUE"
ethernet3.present = "TRUE"
ethernet3.virtualDev = "vmxnet3"
ethernet3.networkName = "DMZ"
ethernet3.addressType = "generated"
ethernet3.wakeOnPcktRcv = "FALSE"
ethernet3.uptCompatibility = "TRUE" 

Import the VM

After all this is done import the new vmx file through the WEB UI again using create/register new VM and start it up.

This looks better now and the F5 VM is booting.

esxi  f5  ltm  vmware 

See also