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

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

Source:

 

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 – size 120GB. Temp system (20GB) and size of VM from XenServer (100GB). This drive will be removed.
  • HDD-2 – size 100GB. Size of VM from XenServer

 

III. Install temp system and cmake3 on HDD-1. 

 

IV. Send *.xva file to new VM on HDD-1. I use scp (linux) or WinSCP (Windows).

 

V. Install xva-img from github:

wget https://github.com/eriklax/xva-img/archive/master.zip
unzip master.zip
cd xva-img-master
cmake .
sudo make install

If you have some errors with installation like:

  • … noexcept(false);…, use cmake like this:
cmake -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON .
  • 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
aptitude install libxxhash-dev

 

VI. Extract *.xva (change vm.xva to your file name *.xva):

mkdir my-virtual-machine
tar --warning=no-timestamp -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 HDD-2: Name of HDD-2 you can check with fdisk or lsblk. In this case is /dev/sdb. You don’t need make file system or partition. The dd do everything.

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

 

VII. Turn On VM with HDD-2: In ProxMox:

  • Power Off VM.
  • Detach HDD-1.
  • I deleted HDD-1 with temporary system.
  • In settings change boot order to start from HDD-2.
  • Turn On the VM.

 

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

dpkg -P xe-guest-utilities

IX. Sometimes you need to update grub.

3 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.