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

    Migrating VM fails with DUPLICATE_VM error part2

    Scheduled Pinned Locked Moved Xen Orchestra
    47 Posts 3 Posters 13.2k Views 1 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.
    • olivierlambertO Offline
      olivierlambert Vates 🪐 Co-Founder CEO
      last edited by

      Hmm can you try to migrate with xe then? 🤔

      A 2 Replies Last reply Reply Quote 0
      • A Offline
        AndreS @olivierlambert
        last edited by

        @olivierlambert Sure, need to figure out the command line parms. Nothing against it but not used to it so I need to read and figure it out.

        1 Reply Last reply Reply Quote 0
        • A Offline
          AndreS @olivierlambert
          last edited by

          @olivierlambert

          [20:10 xen2 ~]# xe vm-migrate remote-master=172.25.10.11 remote-username=root remote-password=xxxxxxxx vif:f4b175c2-0082-212c-b9d9-bd616cd83d2c=a014b230-2db6-adb4-ba4f-0b1cc07fdcae vm=Win10vm
          Performing a Storage XenMotion migration. Your VM's VDIs will be migrated with the VM.
          Will migrate to remote host: xen1, using remote network: Pool-wide network associated with eth0. Here is the VDI mapping:
          VDI 4d4a809d-6801-4462-8e52-811882106821 -> SR 270f8f4a-a24c-ced6-99c7-9bc2ba5f5008
          VDI 6a30ca10-a386-4e00-91aa-89c3e5bd43de -> SR 270f8f4a-a24c-ced6-99c7-9bc2ba5f5008
          Cannot restore this VM because it would create a duplicate
          vm: abd338e4-0ae1-24fa-38be-91fc0fe57332
          
          
          1 Reply Last reply Reply Quote 0
          • olivierlambertO Offline
            olivierlambert Vates 🪐 Co-Founder CEO
            last edited by

            That's weird indeed. Maybe it's not the VM itself that will be duplicated, but an object with it.

            Have you checked MAC address on destination? There's something we need to dig in XAPI to learn what it means in terms of duplicate 🤔

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

              Yeah after taking a look, found this: https://github.com/xapi-project/xen-api/blob/d496b90c4172f71337841dcacb3496751141f712/ocaml/xapi/import.ml#L246

              It might be duplicated MAC address related.

              A 1 Reply Last reply Reply Quote 0
              • A Offline
                AndreS @olivierlambert
                last edited by AndreS

                @olivierlambert
                Funny you say that, look at where we both commented on last year
                https://xcp-ng.org/forum/topic/3182/centos-ovas-imported-from-esx-network-hang/34?_=1636230593687

                Checked the MAC addresses of the two vms (the imported ones) but they are different. I'll try a side by side comparison of all the objects.

                A 1 Reply Last reply Reply Quote 0
                • A Offline
                  AndreS @AndreS
                  last edited by

                  @andres
                  Both vms exported from esxi

                  Windows 10 vm

                  other-config (MRW): auto_poweron: true; import_task: OpaqueRef:680ed8f5-22a5-4a4b-af3b-6988f7734441; install-repository: cdrom; vgpu_pci: ; base_template_name: Other install media; mac_seed: 5e88eb6a-d680-c47f-a94a-028886971ba4; install-methods: cdrom
                  

                  Gentoo linux vm

                  other-config (MRW): auto_poweron: true; vgpu_pci: ; base_template_name: Other install media; mac_seed: 5e88eb6a-d680-c47f-a94a-028886971ba4; install-methods: cdrom
                  

                  the mac-seed id is the same.

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

                    Can you check if you don't have any similar MAC on the destination host?

                    About the seed, well, in theory that shouldn't be a problem, but you can always replace it by another random UUID (here is one I got with uuidgen: 3ec7fc14-1e25-4453-b3f9-5a7b6554d241).

                    A 1 Reply Last reply Reply Quote 0
                    • A Offline
                      AndreS @olivierlambert
                      last edited by

                      @olivierlambert
                      Similar, but not the same; the two imported vms have MAC addresses that differ only by one ( 9e:86:37:32:02:d7 vs 9e:86:37:32:02:d8) which should be enough.
                      Visually checked all MAC addresses on the destination host via XO, nothing even close except the D7 vs D8.
                      Is there a way to dump all object from all vms on a host?

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

                        Yes but I don't remember. Let me try if I can find this quickly.

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

                          You can do a xe vm-vif-list params=vm-name-label,MAC to see all your VMs MACs at once.

                          A 1 Reply Last reply Reply Quote 0
                          • A Offline
                            AndreS @olivierlambert
                            last edited by

                            @olivierlambert Thanks, this confirms that there is no MAC address clash.
                            The fact that they are both imported the same way from the same source system is a strong suggestion that something is clashing, especially after the MAC address issue found last year.

                            Suggestions are welcome, otherwise I might entertain myself and recreate a Windows 10 vm on the destination and symply copy over and connect the disks.

                            Let me know if you want me to provide details or create a ticket somewhere.

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

                              Well, I'd love that we could find the culprit 😄

                              xe vm-list params=all will give you all the params for all VMs on a given host.

                              Then, you should try to compare between 2 hosts and see if there's similar fields that shouldn't be similar (I know, it's vague).

                              In the mean time, let me ask around to some XAPI devs.

                              A 2 Replies Last reply Reply Quote 0
                              • A Offline
                                AndreS @olivierlambert
                                last edited by

                                @olivierlambert Appreciated. I will go through the fields to see if anything looks odd..

                                1 Reply Last reply Reply Quote 0
                                • A Offline
                                  AndreS @olivierlambert
                                  last edited by

                                  @olivierlambert Nothing odd that stands out for me when comparing the data.

                                  Additionally I tried migrating the (most likely) offending vm from the other host and I get the same error.
                                  Migrated two other (created on xcp-ng) vms but those fail with a VDI_COPY_FAILED but the migration starts properly. Only at the end I get this error.

                                  vm.migrate
                                  {
                                    "vm": "0ab24395-becb-71f4-4f93-066c2d660cff",
                                    "mapVifsNetworks": {
                                      "651db47e-129a-7152-f988-cc4408abce0a": "a014b230-2db6-adb4-ba4f-0b1cc07fdcae"
                                    },
                                    "migrationNetwork": "a014b230-2db6-adb4-ba4f-0b1cc07fdcae",
                                    "sr": "270f8f4a-a24c-ced6-99c7-9bc2ba5f5008",
                                    "targetHost": "3b57d90b-983f-46bb-8f52-4319025d1182"
                                  }
                                  {
                                    "code": 21,
                                    "data": {
                                      "objectId": "0ab24395-becb-71f4-4f93-066c2d660cff",
                                      "code": "VDI_COPY_FAILED"
                                    },
                                    "message": "operation failed",
                                    "name": "XoError",
                                    "stack": "XoError: operation failed
                                      at operationFailed (/opt/xo/xo-builds/xen-orchestra-202111061645/packages/xo-common/src/api-errors.js:21:32)
                                      at file:///opt/xo/xo-builds/xen-orchestra-202111061645/packages/xo-server/src/api/vm.mjs:482:15
                                      at Object.migrate (file:///opt/xo/xo-builds/xen-orchestra-202111061645/packages/xo-server/src/api/vm.mjs:469:3)
                                      at Api.callApiMethod (file:///opt/xo/xo-builds/xen-orchestra-202111061645/packages/xo-server/src/xo-mixins/api.mjs:304:20)"
                                  }
                                  

                                  Now I need to figure out what the real issue is.

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

                                    Can you also try with xe too? Maybe the error message will be more clear.

                                    A 1 Reply Last reply Reply Quote 0
                                    • A Offline
                                      AndreS @olivierlambert
                                      last edited by

                                      @olivierlambert Life happened, just spent some time working through scenarios.

                                      Using xe vm-migrate I can move vms from one host to the other (this is across pools) and back. For me this rules out a host level issue.

                                      When I try to move the vms that won't migrate in both cases I get the error

                                      Cannot restore this VM because it would create a duplicate
                                      

                                      This clearly points at the two vms that were imported from esxi last year.

                                      Reviewed the output of xe vm-list params=all uuid=<relevant vm uuid> again and finaly noticed that they both have the same mac_seed: value under other-config (MRW):

                                      other-config (MRW): auto_poweron: true; vgpu_pci: ; base_template_name: Other install media; mac_seed: 5e88eb6a-d680-c47f-a94a-028886971ba4; install-methods: cdrom
                                      

                                      and

                                      other-config (MRW): auto_poweron: true; import_task: OpaqueRef:680ed8f5-22a5-4a4b-af3b-6988f7734441; install-repository: cdrom; vgpu_pci: ; base_template_name: Other install media; mac_seed: 5e88eb6a-d680-c47f-a94a-028886971ba4; install-methods: cdrom
                                      

                                      Could that cause a clash/duplicate error?

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

                                        Please modify the mac seed and see if it still trigger the error 🙂

                                        A 1 Reply Last reply Reply Quote 0
                                        • A Offline
                                          AndreS @olivierlambert
                                          last edited by

                                          @olivierlambert Thanks. Done that.
                                          Next stop is

                                          xe vm-migrate remote-master=172.25.10.11 remote-username=root remote-password=xxxxxx vif:f4b175c2-0082-212c-b9d9-bd616cd83d2c=a014b230-2db6-adb4-ba4f-0b1cc07fdcae vm=Win10vm
                                          Performing a Storage XenMotion migration. Your VM's VDIs will be migrated with the VM.
                                          Will migrate to remote host: xen1, using remote network: Pool-wide network associated with eth0. Here is the VDI mapping:
                                          VDI 4d4a809d-6801-4462-8e52-811882106821 -> SR 270f8f4a-a24c-ced6-99c7-9bc2ba5f5008
                                          VDI 6a30ca10-a386-4e00-91aa-89c3e5bd43de -> SR 270f8f4a-a24c-ced6-99c7-9bc2ba5f5008
                                          There were no servers available to complete the specified operation.
                                          

                                          Doesn't matter what I set the mac_seed to: empty, just a few characters or change one character. Setting it back to the 'original' value reproduces the earlier error about creating a duplicate so the mac_seed value is making a difference. But there seems to be more.

                                          I couldn't find anything specific on There were no servers available to complete the specified operation. on the forum, just one hit; someone asking what it means.

                                          A wider internet search showed some Citrix /Xen related posts; one about a DVD image not being available anymore so I disabled the DVD but that also made no difference. There is more than enough storage available on the receiving SR; more than double what is needed.

                                          But now it gets interesting. When I try to start the vm again I get this:

                                          vm.start
                                          {
                                            "id": "afe623be-5451-fd48-3f24-60120e53f5ab",
                                            "bypassMacAddressesCheck": false,
                                            "force": false
                                          }
                                          {
                                            "code": "NO_HOSTS_AVAILABLE",
                                            "params": [],
                                            "call": {
                                              "method": "VM.start",
                                              "params": [
                                                "OpaqueRef:3947721f-7307-4560-aa59-dec8a8e26bfb",
                                                false,
                                                false
                                              ]
                                            },
                                            "message": "NO_HOSTS_AVAILABLE()",
                                            "name": "XapiError",
                                            "stack": "XapiError: NO_HOSTS_AVAILABLE()
                                              at Function.wrap (/opt/xo/xo-builds/xen-orchestra-202111061645/packages/xen-api/src/_XapiError.js:16:12)
                                              at /opt/xo/xo-builds/xen-orchestra-202111061645/packages/xen-api/src/transports/json-rpc.js:41:27
                                              at AsyncResource.runInAsyncScope (async_hooks.js:197:9)
                                              at cb (/opt/xo/xo-builds/xen-orchestra-202111061645/node_modules/bluebird/js/release/util.js:355:42)
                                              at tryCatcher (/opt/xo/xo-builds/xen-orchestra-202111061645/node_modules/bluebird/js/release/util.js:16:23)
                                              at Promise._settlePromiseFromHandler (/opt/xo/xo-builds/xen-orchestra-202111061645/node_modules/bluebird/js/release/promise.js:547:31)
                                              at Promise._settlePromise (/opt/xo/xo-builds/xen-orchestra-202111061645/node_modules/bluebird/js/release/promise.js:604:18)
                                              at Promise._settlePromise0 (/opt/xo/xo-builds/xen-orchestra-202111061645/node_modules/bluebird/js/release/promise.js:649:10)
                                              at Promise._settlePromises (/opt/xo/xo-builds/xen-orchestra-202111061645/node_modules/bluebird/js/release/promise.js:729:18)
                                              at _drainQueueStep (/opt/xo/xo-builds/xen-orchestra-202111061645/node_modules/bluebird/js/release/async.js:93:12)
                                              at _drainQueue (/opt/xo/xo-builds/xen-orchestra-202111061645/node_modules/bluebird/js/release/async.js:86:9)
                                              at Async._drainQueues (/opt/xo/xo-builds/xen-orchestra-202111061645/node_modules/bluebird/js/release/async.js:102:5)
                                              at Immediate.Async.drainQueues [as _onImmediate] (/opt/xo/xo-builds/xen-orchestra-202111061645/node_modules/bluebird/js/release/async.js:15:14)
                                              at processImmediate (internal/timers.js:464:21)
                                              at process.topLevelDomainCallback (domain.js:152:15)
                                              at process.callbackTrampoline (internal/async_hooks.js:128:24)"
                                          }
                                          

                                          Setting it back to the 'original' mac_seed value does not even allow me to start the vm. I do get the ' duplicate' error on vm migration.

                                          When I start via xe I get

                                          xe vm-start vm=Win10vm
                                          There are no suitable hosts to start this VM on.
                                          The following table provides per-host reasons for why the VM could not be started:
                                          
                                          xen2    : Cannot start here [Not enough free memory]
                                          
                                          
                                          There were no servers available to complete the specified operation.
                                          

                                          There is enough free memory (9 Gb available, 6 Gb requested). Even freeing up 15 Gb of memory does not make a diffence. Same errors in XOA and via xe.

                                          Any other suggestions?

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

                                            1. So it seems that MAC SEED was the initial issue?
                                            2. Can you display the xe vm-param-list uuid=<VM UUID>?
                                            A 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post