Skip to main content

Recently I had the possibility to work with VMs running Xen App, especially on XEN. One request from the customer was the possibility to move the VMs from XEN to VMware without reinstalling everything, so porting a part of existing infrastructure and VMs into VMware. I spent quite a lot of time finding the proper procedure that avoids the issue to the VMs when moved to VMware related basically to a lot of BSOD based on dirty XEN drivers mainly related to the SCSI controller.
Long story short I’ll put here the procedure (this procedure is not supported from VMware or XEN, so use it at your own risk):

XEN TO VMWARE:

– Remove VM on the Citrix Farm, Disable app published on a specific server

– Shut down the VM on XenCenter

– Clone it

– Power on the clone, and took a snapshot

– Uninstall Citrix XenServer Management Agent

– Uninstall Citrix XenServer Windows Guest Agent

– Uninstall Citrix Xen Windows x64 PVDrivers

– Uninstall Citrix XenServer Tools Installer

– Launch from: Program Files x86 Citrix  XenTools – unistall-Xenprovide

– Device Manager: Uninstall all XEN Drivers for Disks, Network,Controllers, CD/DVD Drives, Hidden Devices (NO REBOOT)

– Check the Devices

– Remove if present RegKeys HKEY_LOCAL_MACHINE/SYSTEM\CurrentControlSet\Services\XEN \xenbus \xenvif \xendisk

– Remove if present RegKeys HKEY_LOCAL_MACHINE/SYSTEM\CurrentControlSet001\Services\XEN \xenbus \xenvif \xendisk

– Remove if present RegKeys HKEY_LOCAL_MACHINE/SYSTEM\CurrentControlSet002\Services\XEN \xenbus \xenvif \xendisk
– Remove if present RegKeys HKEY_LOCAL_MACHINE/SYSTEM\CurrentControlSet\Control\Class – check if there is a key with upperfilter XEN*

– Remove if present RegKeys HKEY_LOCAL_MACHINE/SYSTEM\CurrentControlSet001\Control\Class – check if there is a key with upperfilter XEN*

– Remove if present RegKeys HKEY_LOCAL_MACHINE/SYSTEM\CurrentControlSet002\Control\Class – check if there is a key with upperfilter XEN*

– Remove from C:\Windows\System32\Drivers\Xen.sys-xenbus.sys-xencrsh.sys-xendisk.sys-xenfilt.sys-xennet.sys

Then you can Reboot

Once the VM is back you can install vCenter Converter, if you don’t have it you can download it free from the VMware site.
I highly recommend if you have it running on your system to stop the following Citrix Service: Citrix System Monitoring Agent service

Also if needed I recommend to increase the timeout for the service start, vCenter Converter creates the following regkey on:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control

ServicesPipeTimeout   = 300000

Reboot, check again if the Citrix System Monitoring Agent service is stopped and then start the conversion, wait of course al the vCenter Converter services are running (this will require based on the server 5 to 15 minutes)

Then you can start the migration of your VM with vCenter Converter

I hope this could be helpful if you have questions or you want to add your own procedure please write a comment!

Update 11/2021

Remember when you finalize the vCenter Converter to select the virtual nic created on the vCenter or the Host to select VMxnet3. (VMtools must be installed on the VM, you can after you power on the VM on vSphere)

With the help of my colleague Fabio that developed a quick and easy script we automated all the parts of regkey deletion and file deletion, so with this you just need to Uninstall the Xen software from the control panel and from the Device Manager and the boring Regedit part will be done by this script (this script will also create a local user “vmware” inside the administrator in case of need):

Create a powershell file and copy the following text:

$Keys = Get-ChildItem -Path “HKLM:\SYSTEM\CurrentControlSet\Control\Class” -Recurse -ErrorAction SilentlyContinue | Where-Object {$_.GetValueNames() -contains ‘UpperFilters’}
$Keys += Get-ChildItem -Path “HKLM:\SYSTEM\ControlSet001\Control\Class” -Recurse -ErrorAction SilentlyContinue |Where-Object {$_.GetValueNames() -contains ‘UpperFilters’}
$Keys += Get-ChildItem -Path “HKLM:\SYSTEM\ControlSet002\Control\Class” -Recurse -ErrorAction SilentlyContinue | Where-Object {$_.GetValueNames() -contains ‘UpperFilters’}
$xenfilt_keys = $Keys | Get-ItemProperty | Where-Object{$_.UpperFilters -like “XENFILT”}
$xenfilt_keys | ForEach-Object {Remove-ItemProperty -path $_.PSPath -Name “UpperFilters”}

reg add HKLM\SYSTEM\CurrentControlSet\Control\ /v ServicesPipeTimeout /t REG_DWORD /d 300000 /f

net user vmware VMware1! /add
net localgroup administrators vmware /add

reg delete HKLM\SYSTEM\CurrentControlSet\Services\xenbus /f
reg delete HKLM\SYSTEM\ControlSet001\services\xenbus /f
reg delete HKLM\SYSTEM\ControlSet002\services\xenbus /f

reg delete HKLM\SYSTEM\CurrentControlSet\Services\xenfilt /f
reg delete HKLM\SYSTEM\ControlSet001\services\xenfilt /f
reg delete HKLM\SYSTEM\ControlSet002\services\xenfilt /f

reg delete HKLM\SYSTEM\CurrentControlSet\Services\xeniface /f
reg delete HKLM\SYSTEM\ControlSet001\services\xeniface /f
reg delete HKLM\SYSTEM\ControlSet002\services\xeniface /f

reg delete HKLM\SYSTEM\CurrentControlSet\Services\xenlite /f
reg delete HKLM\SYSTEM\ControlSet001\services\xenlite /f
reg delete HKLM\SYSTEM\ControlSet002\services\xenlite /f

reg delete HKLM\SYSTEM\CurrentControlSet\Services\xennet /f
reg delete HKLM\SYSTEM\ControlSet001\services\xennet /f
reg delete HKLM\SYSTEM\ControlSet002\services\xennet /f

reg delete HKLM\SYSTEM\CurrentControlSet\Services\XenPVInstall /f
reg delete HKLM\SYSTEM\ControlSet001\services\XenPVInstall /f
reg delete HKLM\SYSTEM\ControlSet002\services\XenPVInstall /f

reg delete HKLM\SYSTEM\CurrentControlSet\Services\XenSvc /f
reg delete HKLM\SYSTEM\ControlSet001\services\XenSvc /f
reg delete HKLM\SYSTEM\ControlSet002\services\XenSvc /f

reg delete HKLM\SYSTEM\CurrentControlSet\Services\xenvbd /f
reg delete HKLM\SYSTEM\ControlSet001\services\xenvbd /f
reg delete HKLM\SYSTEM\ControlSet002\services\xenvbd /f

reg delete HKLM\SYSTEM\CurrentControlSet\Services\xenvif /f
reg delete HKLM\SYSTEM\ControlSet001\services\xenvif /f
reg delete HKLM\SYSTEM\ControlSet002\services\xenvif /f

cd C:\Windows\System32\Drivers
Del xen.sys
Del xenbus.sys
Del xencrsh.sys
Del xenfilt.sys
Del xeniface.sys
Del xennet.sys
Del xenvbd.sys
Del xenvif.sys

 

2 Comments

  • Davide ha detto:

    Salve, ho trovato un sistema un pò più semplice per migrare da xen a vmware
    1. installare su una macchina gli ultimi xentools di citrix (9.3.x)
    2. recuperare la cartella xentools e metterla da qualche parte in rete perchè contiene un preziosissimo uninstall.exe fatto da citrix che pulisce realmente tutto
    3. copiare la cartella da qualche parte sulla macchina che si vuole migrare (occorre copiarla perchè durante la disinstallazione si perde la rete)
    4. lanciare uninstall purge verbose
    5. riavviare la macchina e poi spegnerla
    6. sganciare il/i dischi dalla macchina
    7. creare un vm su xen senza disco che faccia il boot da un immagine iso di clonezilla
    8. agganciare alla macchina i dischi della macchina da migrare
    9. creare su vmware una macchina che faccia il boot da un immagine iso di clonezilla e con dischi uguali a quelli di xen + 1Gb (potrebbe forse bastare meno ma meglio tenersi larghi)
    10. avviare il clonezilla su xen, remote source
    11. avviare il clonezilla su vmware, remote destination
    12. copiare il/i dischi uno alla volta, clonezilla non permette di farne più d’uno contemporaneamente
    13. finita la copia su vmware, riavviare ed installare i vmware tools

    Hope this helps

    • Giovanni Dominoni ha detto:

      Come sempre ci sono sempre più modi per fare la stessa cosa, grazie per il commento 😉
      Interessante la parte dell’unistall che pulisce correttamente tutto senza dover fare i salti da un a parte all’altra soprattutto sul registro di sistema, non lo ricordavo.

Leave a Reply