Create VPS with VMDK / VHD


Creating a VPS directly using VMDK / VHD is not possible but you can follow the below steps to manually migrate vmdk / vhd to Virtualizor VPS using LVM / File based storage.

Copy `vmdk` / `vhd` file from Source server to Virtualizor Server

Copy the VPS vmdk / vhd file from Source server to the Virtualizor server. (You can use SCP for it)

Note : Server must have the same amount of free space available on “/” partition so that it can fit the converted file as well.

Convert ‘vmdk’ / ‘vhd’ file to ‘img’ format

Once the file has been copied to the proper destination, you need to convert it to img format by running the following command:

For Vmdk :

qemu-img convert vpsfile.vmdk -O raw /converted.img

For Vhd :

qemu-img convert vpsfile.vhd -O raw /converted.img

Create VPS on Virtualizor panel

Create VPS on Virtualizor panel with LVM / File based storage with same or more disk space than original vps and then power off the VPS from panel.

dd the `.img` to Virtualizor VPS disk

Let’s assume the VPS created on Virtualizor is v1001. You can run the below command to dd the .img data to vps

For LVM Storage :

Syntax : dd if=/converted.img of=/dev/vg/vps-lv
Example : dd if=/converted.img of=/dev/vg/vsv1001-dvhckogpoqenoy9c-fy4xodn6olq3efvi

For Thin – LVM Storage :

Syntax : dd if=/converted.img of=/dev/vg/vps-lv conv=sparse
Example : dd if=/converted.img of=/dev/vg/vsv1001-dvhckogpoqenoy9c-fy4xodn6olq3efvi conv=sparse

Note : You can find the actual VPS disk path using lvscan command in case of LVM & Thin LVM Storage.
Example : lvscan | grep v1001

For RAW – File based storage :

Syntax : cp /converted.img /path-to-vps-disk.raw
Example : cp /converted.img /vms/v1001-dqvftoc1ccqqgiap-t2arww0xaxskh0pj.raw (You can press ‘y’ to overwrite the vps disk.)

For qcow2 – File based storage :

Syntax : dd if=/converted.img of=/path-to-vps-disk-qcow2
Example : dd if=/converted.img of=/vms/v1001-dqvftoc1ccqqgiap-t2arww0xaxskh0pj.qcow2

Once the DD operation is successful , you can start the VPS from the panel.

Note : Virtualizor may fail to perform operations on such VPS since they might be having a custom partitioning layout.

Was this helpful to you?