Migration VM from XenServer to ProxMox (*.xva to *.raw)

Migration VM from XenServer to ProxMox (*.xva to *.raw)


I. Export VM to *.XVA in XenServer.

II. Create new VM in ProxMox with parameters:

  • CPU – like VM on XenServer
  • RAM – like VM on XenServer
  • HDD 1 – 20GB for system and add size of VM from XenServer. I set 100GB.
  • HDD 2 – like VM on XenServer I use template and change HDD size with GParted. But you can install new temporary system, I suggest debian ;]

III. Send *.xva file to new VM. I use scp (linux) or WinSCP (Windows).

IV. Install xva-img from github:

wget https://github.com/eriklax/xva-img/archive/master.zip

If github is offline, use this URL: master-2018-06-10

unzip master.zip
cd xva-img-master
cmake .
sudo make install

If you have some errors with installation like:

  • CMake Error: your CXX compiler: “/usr/bin/c++” was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
  • xva-img-master/src/sha1.cpp:20:25: fatal error: openssl/sha.h: No such file or directory #include <openssl/sha.h> Install packages:
aptitude install build-essential
aptitude install libssl-dev

And then try again install xva-img. Extract *.xva (change vm.xva to your file name *.xva):

mkdir my-virtual-machine
tar -xf vm.xva -C my-virtual-machine
chmod -R 755 my-virtual-machine

Extract *.xva can take a while.

V. Convert to *.raw:

Note: When you extract your VM tar creates subfolders for each hard disk attached to the VM. You will have to run this command for each Ref folder that was generated as part of the image extraction process.

xva-img -p disk-export my-virtual-machine/Ref\:1/ disk-1.raw

The *.raw file size is the same like HDD VM.

VI. Transfer files to second HDD: Name of second HDD you can check with

fdisk. In this case is /dev/sdb. You don’t need make file system or partition second HDD. The dd do everything.

sudo dd if=disk-1.raw of=<strong>/dev/sdb</strong> bs=64M

VI. Turn On VM with second HDD: In ProxMox:

  • Power Off VM.
  • Detach first HDD, in this case 100GB.
  • I deleted first HDD with temporary system.
  • In settings change boot order to start from second HDD.
  • Turn On the VM.

VII. XenServer tool: If you have tool from XenServer, you can remove package with this command:

dpkg -P xe-guest-utilities

2 komentarze so far.

  1. Unfortunately, the xva-img tool relies on sha1 checksums and Xenserver and XCP-NG moved to xxhash so the tool no longer works. There is an open issue to fix it.

Dodaj komentarz

Twój adres e-mail nie zostanie opublikowany.

Witryna wykorzystuje Akismet, aby ograniczyć spam. Dowiedz się więcej jak przetwarzane są dane komentarzy.