Error importing large vhd file
-
@olivierlambert I was not running an old build, but I updated earlier this week or late last I think just in case. Just running an update again. My updater script says "Updating Xen Orchestra from 'c2e0c97d9' to '53e0f17c5'".
-
@goreandor Yeah check out the lawrence systems video, it helped me a ton when troubleshooting. The process for Hyper-V to XCP-ng is very similar for physical to XCP-ng.
-
@goreandor said in Error importing large vhd file:
@olivierlambert I was not running an old build, but I updated earlier this week or late last I think just in case. Just running an update again. My updater script says "Updating Xen Orchestra from 'c2e0c97d9' to '53e0f17c5'".
I just tried to import the VHD again from a VHD that is already on an SR on version 53e0f. Log below:
[07:19 xcp-ng-r550 ~]# cd /run/sr-mount/558efc11-bec3-7618-651a-bca4c90ceaba [07:19 xcp-ng-r550 558efc11-bec3-7618-651a-bca4c90ceaba]# ls 4f8e366c-ab9c-4043-98cd-aded4389dffa.vhd filelog.txt [07:20 xcp-ng-r550 558efc11-bec3-7618-651a-bca4c90ceaba]# uuidgen -r b2394f60-1235-41ed-85ab-63809d57e484 [07:20 xcp-ng-r550 558efc11-bec3-7618-651a-bca4c90ceaba]# mv 4f8e366c-ab9c-4043-98cd-aded4389dffa.vhd b2394f60-1235-41ed-85ab-63809d57e484.vhd [07:20 xcp-ng-r550 558efc11-bec3-7618-651a-bca4c90ceaba]# xe vdi-import filename=/run/sr-mount/558efc11-bec3-7618-651a-bca4c90ceaba/b2394f60-1235-41ed-85ab-63809d57e484.vhd uuid=b2394f60-1235-41ed-85ab-63809d57e484 The uuid you supplied was invalid. type: VDI uuid: b2394f60-1235-41ed-85ab-63809d57e484 [07:21 xcp-ng-r550 558efc11-bec3-7618-651a-bca4c90ceaba]#
I still have the uuid issue
-
You don't need to import a VHD that is on the SR already Just to scan the SR as soon you have the
UUID.vhd
(and you will see it in XO) -
@goreandor if it is real vhd compatible with xen, than you should be able to read it metadata with this command
vhd-util read -p -n [vhd-name].vhd
You will see what is the UUID of this vhd.
Than you should rename it to this UUID and rescan SR.
In XOA GUI You will se VHD without name.
Put the name to it and attach to VM. -
Note: you must use dynamic VHD format.
See https://docs.xcp-ng.org/installation/migrate-to-xcp-ng/#from-hyper-v
-
@olivierlambert I did try that before trying the import, but when I do a rescan, I get the error below:
Rescan all disks SR_BACKEND_FAILURE_40(, The SR scan failed [opterr=uuid=b2394f60-1235-41ed-85ab-63809d57e484], )
I installed Virtualbox and used the command below to convert from a vhdx to a vhd file:
vboxmanage clonemedium source.vhdx destination.vhd --format VHD
This worked for the VHD that was smaller in size. So did the same thing with the larger VHD. I tried originally from Hyper-V, but I had some issues if I remember correctly or maybe I did not find an option to change from vhdx to vhd. I am trying to convert again, but specifying "--variant standard" just in case. As I understand, this explicitly specifies image type as dynamic.
I just tried that command, but still stuck unfortunately.
[07:49 xcp-ng-r550 558efc11-bec3-7618-651a-bca4c90ceaba]# vhd-util read -p -n b2394f60-1235-41ed-85ab-63809d57e484.vhd Failed to get bat for b2394f60-1235-41ed-85ab-63809d57e484.vhd: -22
Googled the error, but did all results I got were Windows-related.
-
This means your VHD is not valid.
-
You could check what
vhd-util check -n your.vhd
returns, and if it fails (and you have another copy somewhere, just in case) run
vhd-util repair -n your.vhd
I have no experience with Hyper-V, but I can't use qemu-img converted VHDs without running vhd-util-repair on them.
-
Just had time to check the new conversion, and it worked using the latest Virtualbox command I pasted, copied it directly to the repository, and it was recognised and booted ok after attaching to a VM.
Many thanks for the help and apologies for the hassle!
-
No worries, happy to help!
-
-