October 13, 2018

Converting Citrix PVS Image from XenServer to vSphere

Having repeated this nightmarish migration several times now, here's the steps I've found to be most efficient:
  1. Import your XenServer-optimized PVS image (as a VHD) in to XenCenter as a new VM.
  2. Snapshot and boot the VM (just in case you mess up the next step you won't need to import again).
  3. Uninstall the Citrix PVS and Citrix Guest Tools / Xen Tools bits. 
  4. Delete xen*.sys from c:\windows\system32 and c:\windows\system32\drivers
  5. Reboot and make sure everything still comes back up. It should revert to a generic Realtek network driver.
  6. Run VMware Converter on the VM. Alternatively you can export the VM from XenCenter as an OVA and then import it to vSphere.
  7. Be sure you are using a VMXNet3 NIC on the vSphere VM, not an E1000.
  8. Boot the resulting vSphere VM and install VMware tools.
  9. Delete the ghost NIC that is left from the Realtek drivers (https://support.citrix.com/article/CTX221733), otherwise you will get the BNIstack error.
  10. Install PVS target device software and run the imaging wizard again. 
  11. Follow all your normal steps for capturing a new image
If you run in to an IRQL_NOT_EQUAL_OR_LESS BSOD, you may be like me and have some piece of software set to redirect writes to the vDisk cache disk which no longer exists. Make sure you fix that prior to attempting a migration.

The most commonly recommended solutions for BNIstack errors during your first boot after capturing the image:
  1. Make sure no ghost NICs are still present
  2. Try uninstalling any antivirus and disabling IPv6
  3. Install the hotfix for KB 2550978 (https://support.microsoft.com/en-us/help/2550978/0x0000007b-stop-error-after-you-replace-an-identical-iscsi-network-ada)
  4. Consider changing the default open retry limits/interval for BNIstack (https://discussions.citrix.com/topic/377414-bsod-with-bnistack-and-cvhdmpsys/)

Happy migrations!