Error importing large vhd file
-
Hi,
I have been having issues importing large vhd files (This one is 127GB) using the latest XO CE and a fully updated XCP-ng server. Usually the error I get is "Uncaught TypeError: NetworkError when attempting to fetch resource". At least in Firefox. In chromium, I get "Failed to fetch":
Uncaught TypeError: Failed to fetch at r.post (fetch.js:7:3) at index.js:1805:24 at Generator.next (<anonymous>) at le (index.js:3265:63) at i (index.js:3265:63)
I tried mounting the NFS share manually on the server, copying the file over and then using something like "xe vdi-import filename=./4f8e366c-ab9c-4043-98cd-aded4389dffa.vhd uuid=4f8e366c-ab9c-4043-98cd-aded4389dffa". I couldn't import without the uuid, and when I tried "uuidgen -r" or -t for that matter, I get that uuid is not valid. Then I tried creating a new disk, copied its uuid and deleted it, and used that uuid, but still couldn't import it . Same error:
# xe vdi-import filename=./4f8e366c-ab9c-4043-98cd-aded4389dffa.vhd uuid=4f8e366c-ab9c-4043-98cd-aded4389dffa The uuid you supplied was invalid. type: VDI uuid: 4f8e366c-ab9c-4043-98cd-aded4389dffa
I don't know what to try anymore. I was really hoping of moving our small setup from standalone Hyper-V servers to XCP-ng, but I'm at a loss now. A smaller file, around 40GB imports without issues.
Anything obvious that I am missing? Any pointers would be greatly appreciated.
Thanks
-
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!
-
Hi,
It's hard to assist without having more information on Xen Orchestra Are you using XOA or XO from the sources?
-
@goreandor So you are migrating from Hyper-V to XCP-ng? I've done this several times without issue so sounds like something is missing here.
However, the way I did it was copying the VHD file over to the host (SSH into it) and then using UUID gen on it and importing the disk. I don't recall all the exact moves I made but I'm sure I can find info on it. Pretty sure Lawrence Systems had a video that got me most of the way there (had to change a few things about it, I believe it was the physical to virtual one that had most of the info I needed in regards to importing).
Are you trying to import the VHD file itself through Xen Orchestra? I've had bad luck with this myself as well so might be easier to use the SSH method.
-
@olivierlambert Hi Olivier. Apologies for that. I said XO CE. I meant the community edition. i.e. compiled from source.
-
@goreandor Is it up to date to a recent commit?
-
@planedrop Yes, I'm trying to import using Xen Orchestra. I tried importing from the command line after copying the vhd manually to a storage repository, but I can't get over the invalid uuid error I tried running uuidgen from my Linux machine and also on a XCP-ng server just in case there was something different. From what I've seen, it should be just a "uuidgen -r" to get a compatible uuid.
Maybe I'm missing something really stupid and basic. I will try to go through the Lawrence Systems videos and find that one maybe there is something that helps. Today I'm expecting have work outside for most of the day I think, so there might be a delay in my replies.
Thanks
-
@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!
-
-