XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Error importing large vhd file

    Scheduled Pinned Locked Moved Solved Xen Orchestra
    17 Posts 5 Posters 2.0k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G Offline
      goreandor
      last edited by

      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

      planedropP 1 Reply Last reply Reply Quote 0
      • G Offline
        goreandor @olivierlambert
        last edited by

        olivierlambert

        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! 🙂

        1 Reply Last reply Reply Quote 1
        • olivierlambertO Offline
          olivierlambert Vates 🪐 Co-Founder CEO
          last edited by olivierlambert

          Hi,

          It's hard to assist without having more information on Xen Orchestra 😞 Are you using XOA or XO from the sources?

          G 1 Reply Last reply Reply Quote 0
          • planedropP Offline
            planedrop Top contributor @goreandor
            last edited by

            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.

            G 1 Reply Last reply Reply Quote 0
            • G Offline
              goreandor @olivierlambert
              last edited by

              olivierlambert Hi Olivier. Apologies for that. I said XO CE. I meant the community edition. i.e. compiled from source.

              olivierlambertO 1 Reply Last reply Reply Quote 0
              • olivierlambertO Offline
                olivierlambert Vates 🪐 Co-Founder CEO @goreandor
                last edited by

                goreandor Is it up to date to a recent commit?

                G 1 Reply Last reply Reply Quote 0
                • G Offline
                  goreandor @planedrop
                  last edited by

                  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

                  planedropP 1 Reply Last reply Reply Quote 1
                  • G Offline
                    goreandor @olivierlambert
                    last edited by

                    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'".

                    G 1 Reply Last reply Reply Quote 0
                    • planedropP Offline
                      planedrop Top contributor @goreandor
                      last edited by

                      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.

                      1 Reply Last reply Reply Quote 0
                      • G Offline
                        goreandor @goreandor
                        last edited by

                        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 😞

                        splastunovS 1 Reply Last reply Reply Quote 0
                        • olivierlambertO Offline
                          olivierlambert Vates 🪐 Co-Founder CEO
                          last edited by olivierlambert

                          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)

                          G 1 Reply Last reply Reply Quote 0
                          • splastunovS Offline
                            splastunov @goreandor
                            last edited by splastunov

                            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.

                            1 Reply Last reply Reply Quote 0
                            • olivierlambertO Offline
                              olivierlambert Vates 🪐 Co-Founder CEO
                              last edited by olivierlambert

                              Note: you must use dynamic VHD format.

                              See https://docs.xcp-ng.org/installation/migrate-to-xcp-ng/#from-hyper-v

                              1 Reply Last reply Reply Quote 0
                              • G Offline
                                goreandor @olivierlambert
                                last edited by

                                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.

                                splastunov

                                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.

                                1 Reply Last reply Reply Quote 0
                                • olivierlambertO Offline
                                  olivierlambert Vates 🪐 Co-Founder CEO
                                  last edited by

                                  This means your VHD is not valid.

                                  G 1 Reply Last reply Reply Quote 0
                                  • M Offline
                                    Momi_V
                                    last edited by

                                    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.

                                    1 Reply Last reply Reply Quote 0
                                    • G Offline
                                      goreandor @olivierlambert
                                      last edited by

                                      olivierlambert

                                      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! 🙂

                                      1 Reply Last reply Reply Quote 1
                                      • olivierlambertO Offline
                                        olivierlambert Vates 🪐 Co-Founder CEO
                                        last edited by

                                        No worries, happy to help!

                                        1 Reply Last reply Reply Quote 0
                                        • olivierlambertO olivierlambert marked this topic as a question on
                                        • olivierlambertO olivierlambert has marked this topic as solved on
                                        • First post
                                          Last post