Hyper-V to VMware conversion tips and tricks

As an IT consultant , I’m asked to assist a wide variety of tasks. Last fall , I worked on a project to convert 21 Hyper-V VMs to ESXi.

Normally, you’d use the VMware vSphere stand-alone converter for such a task, however, VMware pulled the tool in Feb of 2022, only to add it back in October 2022
Read about it here


As such, that left me the third party StarWinds V2V converter. Also great, but not as feature-rich as the VMWare tool. One key feature missing ; is adding VMware tools to the ESXi converted VM. Powershell to the rescue!

The script

I’ve had PS code to automate VMware tools re-installs for about 2 years via my Packer windows build automation work Powershell. See HERE

I’ve been writing PS code since 2015, I’ve done courses, read blogs, free-styled, and made a lot of mistakes along the way. Despite zero background in formal programming, I am a planning based person in all that I do. For scripts I’ll use with clients that are more than a few lines, I’ll create a bullet-point based design to write out what I want to do

For this project, the key functions of the new script were as follows:

Source

Destination VM

Here is the code

The script requires just 3 files, a recent VMware tools install.exe, the scheduled task XML, and the .ps1 script. The .ps1 script will setup the sched task to run in the system context on the next boot

I won’t post the code in it’s entirety, you can view it on Github here

https://github.com/getvpro/Start-PostV2V

Change the password on line 653, no other edits should be required

High-level steps for Hyper-V to ESXi conversion

Notes from the migration

The project I was working on included 21 VMs, 20 windows VMs, 1 Linux VM. Most of the conversions went smooth, a few did not. Here are some issues I noted that you might find useful should you find yourself going through a similar hypervisor VM type conversion

A Hyper-V to ESXi conversion is pretty niche, however, I learned a lot on this project and really enjoyed thew work. I hope you find the related script / notes provided useful should you be tasked with a similar work effort

Owen

Leave a comment