method 1
#get the VM uuid:
xe vm-list name-label="<VM name;>" --minimal
# if found, you get an overview of the requested vm and it's state.
# now, shut it down
xe vm-shutdown uuid=<vm uuid> force=true
# after some time, you should see this vm pop up in your xen tool or xcp-ng center
# when it does, check which disks are connected to it, and make sure to note the correct order if there's more than 1!
# now, you can find the correct uuid for these disks by entering:
xe vdb-list vm-uuid=<vm uuid>
# you get a list of several disks. Ignore the ones labeled with vdi-uuid: not in database
#
# write down the vdi UUID's of the disks that are correct, and one after another disconnect them by:
xe vdi-forget uuid=<vdi uuid>
# now it will take a bit of time sometimes, but you should see these disks being removed from that vm in xentools
# in xen tools, go to the storage that these virtual disks are on and click 'rescan'
# or, instead, you could list all the known storages with their uuid's:
xe sr-list
# and then rescan it using the command
xe sr-scan uuid=<uuid of the correct storage>
# in xentools, re-attach the storage in the correct order they were.
method 2
# get a complete VDI list so you have a complete overview of all virtual disks on the cluster. (this might be a looong list!)
xe vdi-list > vdilist.txt
# get the VM uuid:
xe vm-list name-label="<VM name;>" --minimal
# if found, you get an overview of the requested vm and it's state.
# now, shut it down
xe vm-shutdown uuid=<vm uuid> force=true
# after some time, you should see this vm pop up in your xen tool or xcp-ng center
# when it does, check which disks are connected to it, and make sure to note the correct order if there's more than 1!
# open the file vdilist.txt and find those disks. make a note of the uuid and detach it by entering this for each one of them:
xe vdi-forget uuid=<vdi uuid>
# after a while, you should see no disks anymore in xentool. Now, rescan the sr again, which is shown as the sr-uuid of each virtual disk
xe sr-scan uuid=<uuid of the correct storage>
# in xentools, re-attach the storage in the correct order they were.
Once this is done, it is possible to start the vm on any of the remainder xen servers.