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

    from Hyper-V

    Scheduled Pinned Locked Moved Migrate to XCP-ng
    14 Posts 5 Posters 657 Views 4 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.
    • M Offline
      McHenry
      last edited by McHenry

      Tried many times without success.

      1. Exported vhdx from Hyper-V
      2. Converted to VHD (Tried Powershell & StarWind)
      3. Changed name to UUID name
      4. Scan of disk fails

      What am I missing?

      Error:

      sr.scan
      {
        "id": "c8dc68cc-f065-f06f-9de1-946362817953"
      }
      {
        "code": "SR_BACKEND_FAILURE_40",
        "params": [
          "",
          "The SR scan failed  [opterr=uuid=25ab0e4d-a91d-4a19-964b-0f2b157818f8]",
          ""
        ],
        "task": {
          "uuid": "47ebf82e-0996-f107-f0f0-54c0c36d2416",
          "name_label": "Async.SR.scan",
          "name_description": "",
          "allowed_operations": [],
          "current_operations": {},
          "created": "20240929T09:59:42Z",
          "finished": "20240929T09:59:42Z",
          "status": "failure",
          "resident_on": "OpaqueRef:702151e8-1c6a-1208-4d10-e738b883cf1a",
          "progress": 1,
          "type": "<none/>",
          "result": "",
          "error_info": [
            "SR_BACKEND_FAILURE_40",
            "",
            "The SR scan failed  [opterr=uuid=25ab0e4d-a91d-4a19-964b-0f2b157818f8]",
            ""
          ],
          "other_config": {},
          "subtask_of": "OpaqueRef:NULL",
          "subtasks": [],
          "backtrace": "(((process xapi)(filename lib/backtrace.ml)(line 210))((process xapi)(filename ocaml/xapi/storage_access.ml)(line 36))((process xapi)(filename ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml)(line 24))((process xapi)(filename ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml)(line 39))((process xapi)(filename ocaml/xapi/message_forwarding.ml)(line 143))((process xapi)(filename ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml)(line 24))((process xapi)(filename ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml)(line 39))((process xapi)(filename ocaml/xapi/rbac.ml)(line 191))((process xapi)(filename ocaml/xapi/rbac.ml)(line 200))((process xapi)(filename ocaml/xapi/server_helpers.ml)(line 75)))"
        },
        "message": "SR_BACKEND_FAILURE_40(, The SR scan failed  [opterr=uuid=25ab0e4d-a91d-4a19-964b-0f2b157818f8], )",
        "name": "XapiError",
        "stack": "XapiError: SR_BACKEND_FAILURE_40(, The SR scan failed  [opterr=uuid=25ab0e4d-a91d-4a19-964b-0f2b157818f8], )
          at Function.wrap (file:///opt/xo/xo-builds/xen-orchestra-202409161442/packages/xen-api/_XapiError.mjs:16:12)
          at default (file:///opt/xo/xo-builds/xen-orchestra-202409161442/packages/xen-api/_getTaskResult.mjs:13:29)
          at Xapi._addRecordToCache (file:///opt/xo/xo-builds/xen-orchestra-202409161442/packages/xen-api/index.mjs:1041:24)
          at file:///opt/xo/xo-builds/xen-orchestra-202409161442/packages/xen-api/index.mjs:1075:14
          at Array.forEach (<anonymous>)
          at Xapi._processEvents (file:///opt/xo/xo-builds/xen-orchestra-202409161442/packages/xen-api/index.mjs:1065:12)
          at Xapi._watchEvents (file:///opt/xo/xo-builds/xen-orchestra-202409161442/packages/xen-api/index.mjs:1238:14)"
      }
      
      gskgerG 1 Reply Last reply Reply Quote 1
      • gskgerG Offline
        gskger Top contributor @McHenry
        last edited by

        @McHenry Maybe this old post helps Error importing large vhd file. It also links to the documentation on how to Migrate to XCP-ng from Hyper-V, but I guess you already read that.

        1 Reply Last reply Reply Quote 1
        • olivierlambertO Offline
          olivierlambert Vates πŸͺ Co-Founder CEO
          last edited by

          A filename MUST be:

          • in the format <UUID>.vhd (you MUST have the .vhd extension!)
          • use dynamic VHD format
          1 Reply Last reply Reply Quote 0
          • V Offline
            Vanny 3rd party vendor
            last edited by

            If you have problem migrating from Hyper-V to XCP-ng with vhd importing, you can try Vinchin Backup & Recovery to perform a full machine migration.

            1 Reply Last reply Reply Quote 0
            • olivierlambertO Offline
              olivierlambert Vates πŸͺ Co-Founder CEO
              last edited by olivierlambert

              I'm fine with third-party vendors, but only when they are clearly identified as such. Only 2 posts to say the same thing with a specific UTM, that's really not great…

              M 1 Reply Last reply Reply Quote 0
              • M Offline
                McHenry @olivierlambert
                last edited by

                @olivierlambert

                We have a simplified process now.

                • Shutdown VM in Hyper-V
                • Convert VHDX to VHD using PowerShell
                • Move VHD to xcp-ng using SSH
                • Generate new name using uuidgen
                • Rename VHD
                • Create VM in XO and attach VHD

                After much trial and error this works every time.

                1 Reply Last reply Reply Quote 1
                • olivierlambertO Offline
                  olivierlambert Vates πŸͺ Co-Founder CEO
                  last edited by

                  Do you have the Powershell command to do this? We can use that to improve the current doc πŸ™‚ Or you can even send us a pull request directly @McHenry πŸ™‚

                  M 2 Replies Last reply Reply Quote 0
                  • M Offline
                    McHenry @olivierlambert
                    last edited by

                    @olivierlambert

                    Convert-VHD -Path <source path> -DestinationPath <destination path> -VHDType Dynamic
                    

                    Disk type is set by extension so ensure the destination path filename ends in ".vhd"

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      McHenry @olivierlambert
                      last edited by

                      @olivierlambert

                      Not sure how to send a pull request sorry.

                      1 Reply Last reply Reply Quote 0
                      • olivierlambertO Offline
                        olivierlambert Vates πŸͺ Co-Founder CEO
                        last edited by

                        Don't worry, I'm adding @thomas-dkmt in the conversation so he can see how to update our doc for this πŸ™‚

                        thomas-dkmtT 1 Reply Last reply Reply Quote 0
                        • thomas-dkmtT Offline
                          thomas-dkmt Vates πŸͺ Docs & Knowledge Team @olivierlambert
                          last edited by

                          @olivierlambert Thanks! I'll add it to the documentation.

                          thomas-dkmtT 1 Reply Last reply Reply Quote 2
                          • thomas-dkmtT Offline
                            thomas-dkmt Vates πŸͺ Docs & Knowledge Team @thomas-dkmt
                            last edited by

                            @McHenry I need some clarification on the exporting process in Hyper-V. Should the disk be converted prior to exporting, or the other way around?

                            M 2 Replies Last reply Reply Quote 0
                            • M Offline
                              McHenry @thomas-dkmt
                              last edited by

                              @thomas-dkmt

                              Either way.

                              1. If you can have the server offline then shutdown and create the VHD from the VHDX. The process creates another disk file so the original remains unchanged and if it all goes wrong you can simply restart the VM in Hyper-V and try again another day. You will need enough disk space for the original VM & the new VHD file.

                              2. If the server cannot be offline then export the VM and then convert the VHDX to VHD. The issue being the original will VM still be updated whilst the migration to xcp-ng takes place. You will need enough disk space for the original VM, the exported VM and the new VHD file.

                              1 Reply Last reply Reply Quote 1
                              • M Offline
                                McHenry @thomas-dkmt
                                last edited by McHenry

                                @thomas-dkmt

                                Our Hyper-V servers have no GUI and the process I use is:

                                1. RDP to the Hyper-V host
                                2. Open PowerShell
                                3. Get a list of the VMs on the host
                                    Get-VM
                                
                                1. Stop the VM
                                    STOP-VM -Name <name of VM>
                                
                                1. Identify the VM's disk(s) for conversion
                                    Get-VMHardDiskDrive -VMName <name of VM>
                                
                                1. Convert the VHDX to VHD (destination file extension sets the type so use ".vhd")
                                    Convert-VHD -Path <source path> -DestinationPath <destination path> -VHDType Dynamic
                                

                                To transfer the newly created .vhd files to xcp-ng we use Putty via the cli

                                1 Reply Last reply Reply Quote 1
                                • First post
                                  Last post