Move a vSphere vSAN ESXi VM to VMware Workstation

So, in the home lab environment, I had a use case come up for moving one of my DevOps VMs from my VMware vSphere vSAN environment to VMware Workstation for better local interaction on my workstation, using VMware Workstation. VMware has done a great job with VMware Workstation and VMware vSphere interoperability between the two. Things are getting more seamless when moving VMs from one to the other and back again. I wanted to detail the process I went through to move a vSphere vSAN ESXi VM to VMware Workstation.

Can’t see the flat VMDK on the vsanDatastore

To level set on my environment, the process I am showing below and tasks were going from the following versions in my lab environment:

  • VMware vSphere 7.0 Update 2 (VMware ESXi, 7.0.2, 18426014)
  • VMware Workstation 16 Pro

One of the first challenges you may run into like myself is you can’t just grab your flat VMDKs from your vsanDatastore as you would imagine using SCP (actually not best practice to do this anyway). I have a feeling this has to do with dedup and compression and other tricks vSAN is doing behind the scenes copying data and metadata. I would like to do more digging on this myself as well. This is important as you need your files from the vSphere vsanDatastore to import into VMware Workstation.

Notice the view of the machine I want to move from the vsanDatastore. You see the VMDK descriptor file but no flat VMDK. I have all files shown in WinSCP and hidden files, so this is not just a view issue. Compare the screenshots below. Both environments are running vSphere 7.0 Update 2 with the latest patches at the time of writing.

From vsanDatastore:

Viewing VM files low level on the vsanDatastore in vSphere
Viewing VM files low level on the vsanDatastore in vSphere

From a traditional datastore:

Viewing a VM from a traditional datastore
Viewing a VM from a traditional datastore

You can, however, download the files from the vSphere client web UI.

Download the files from the vSphere web client
Download the files from the vSphere web client
Size of files displayed after choosing to download
Size of files displayed after choosing to download

In starting the download from the vSphere client, I was not getting very good throughput from the browser session and this was the reason I initially wanted to use an SCP copy. However, I decided to simply restore the VM files to a folder using Veeam as I already had regular backups of the VM.

Restoring the VM files using Veeam
Restoring the VM files using Veeam

Move a vSphere vSAN ESXi VM to VMware Workstation

After the restore was completed successfully, I copied the files from my backup to the local workstation storage where VMware Workstation would have access.

Copy the restored VM folder to the local location you want to use for VMware Workstation
Copy the restored VM folder to the local location you want to use for VMware Workstation

Next, I imported the VMX file contained in the folder with the Open virtual machine option in VMware Workstation.

Open the VMX file in VMware Workstation to Open the VM
Open the VMX file in VMware Workstation to Open the VM

The VM is successfully imported. It is amazing there is no need to convert the disk or any other conversion process needed going from vSphere 7.0 Update 2 to VMware Workstation 16.

The vSphere VM is imported in VMware Workstation without issue
The vSphere VM is imported in VMware Workstation without issue

The VM boots successfully, again with no intervention needed. I did get the normal “did you move or copy” the VM that needed answering. After this, the power-on operation continued as expected.

The VMware Workstation copy of the VM boots without issue
The VMware Workstation copy of the VM boots without issue

No Network connectivity on the VMware Workstation VM

Everything booted great with the copied-down VMware vSphere VM to VMware Workstation. However, I noticed that I had no network connectivity. In looking at the VM, it had the Connect at power on configured, but had not connected after boot. What gives?

VM set to connect at power on but no network connectivity
VM set to connect at power on but no network connectivity

As the machine was running, I simply tried to check the Connected checkbox and received the error below. Ah now, we are getting to the bottom of the issue. The VM as it existed in the vSphere ESXi environment was connected to a Distributed Switch. So, my thinking here is that I should just be able to remove the network adapter and re-add a new one and it works as expected. Ok, so I shut down the VM and did just that.

Distributed switch error when attempting to connect the network connection
Distributed switch error when attempting to connect the network connection

After removing the network adapter, I re-added the network adapter using VMware Workstation. However, after doing this, I still had no network connectivity? Also, the symptoms are the same, checking the box for Connected gives the vDS error. So, removing the network adapter was not removing the configuration.

Removing and readding the network adapter to the virtual machine
Removing and readding the network adapter to the virtual machine

Ok, at this point, it is time to get low-level and start looking at the VMX file. I powered down the machine. Sure enough, in looking at the VMX file, I see the following. So, I removed this configuration.

Viewing the VMX configuration file for the imported VMware Workstation VM
Viewing the VMX configuration file for the imported VMware Workstation VM

Just to be sure of the configuration needed, I spun up a blank Windows 10 VM as a shell to see the configuration added to the VMX file. After looking at the VMX file for that VM, I copied the following into the VMX configuration:

ethernet0.addressType = "generated"
ethernet0.virtualDev = "e1000e"
ethernet0.present = "TRUE"
ethernet0.connectionType = "custom"
ethernet0.displayName = "Servers-149"
Configuration added to the VMware Workstation VMX file
Configuration added to the VMware Workstation VMX file

To make sure I had the fresh VMX, I removed the VM from VMware Workstation and re-added it back. After booting the VM, I now have network connectivity.

Network connectivity is established after editing the VMX file to remove Distributed Switch configuration
Network connectivity is established after editing the VMX file to remove Distributed Switch configuration

Wrapping up

If like me, you have need to move a vSphere vSAN ESXi VM to VMware Workstation, VMware has made this an easy process if you are using VMware Workstation 16 as it has knowledge of all the latest technologies from a vSphere perspective. I had no issues taking a disk that resided on vSphere 7.0 Update 2 vSAN, copying it down, and running this from VMware Workstation 16 Pro.

Post a Comment

0 Comments