Remap VM to a new datastore

Hello,

I’ve removed a Gluster Volume DS and readded it under a new folder /var/lib/one/datastores/129 . I ensure to mount the path properly on the ON Server, Physical #1 and Physical $2.

Now I want to change the VM’s that were using the previous DS to use this one, /var/lib/one/datastores/129, since that is where the data disk exists. How can I do this? More specifically, I need to VM to use the original UUID. (Not sure how that got changed) Need to get the VM to use it’s earlier UUID and boot up. Right now it’s stuck looking for its disks.

Now I get this error:

Mon Mar 9 00:08:01 2020 [Z0][VMM][I]: Successfully execute network driver operation: pre.
Mon Mar 9 00:08:04 2020 [Z0][VMM][I]: Command execution fail: cat << EOT | /var/tmp/one/vmm/kvm/restore '/var/lib/one//datastores/129/35/checkpoint' 'mdskvm-p06.nix.mds.xyz' 'one-35' 35 mdskvm-p06.nix.mds.xyz
Mon Mar 9 00:08:04 2020 [Z0][VMM][E]: restore: Command "virsh --connect qemu:///system restore /var/lib/one//datastores/129/35/checkpoint --xml /var/lib/one//datastores/129/35/checkpoint.xml" failed: error: Failed to restore domain from /var/lib/one//datastores/129/35/checkpoint
Mon Mar 9 00:08:04 2020 [Z0][VMM][I]: error: operation failed: domain 'one-35' already exists with uuid b1c73d1b-db71-4d5f-a0f2-f12031332bbc
Mon Mar 9 00:08:04 2020 [Z0][VMM][E]: Could not restore from /var/lib/one//datastores/129/35/checkpoint
Mon Mar 9 00:08:04 2020 [Z0][VMM][E]: restore: Command "virsh --connect qemu:///system restore /var/lib/one//datastores/129/35/checkpoint --xml /var/lib/one//datastores/129/35/checkpoint.xml" failed: error: Failed to restore domain from /var/lib/one//datastores/129/35/checkpoint
Mon Mar 9 00:08:04 2020 [Z0][VMM][I]: error: operation failed: domain 'one-35' already exists with uuid b1c73d1b-db71-4d5f-a0f2-f12031332bbc
Mon Mar 9 00:08:04 2020 [Z0][VMM][E]: Could not restore from /var/lib/one//datastores/129/35/checkpoint
Mon Mar 9 00:08:04 2020 [Z0][VMM][E]: restore: Command "virsh --connect qemu:///system restore /var/lib/one//datastores/129/35/checkpoint --xml /var/lib/one//datastores/129/35/checkpoint.xml" failed: error: Failed to restore domain from /var/lib/one//datastores/129/35/checkpoint
Mon Mar 9 00:08:04 2020 [Z0][VMM][I]: error: operation failed: domain 'one-35' already exists with uuid b1c73d1b-db71-4d5f-a0f2-f12031332bbc
Mon Mar 9 00:08:04 2020 [Z0][VMM][E]: Could not restore from /var/lib/one//datastores/129/35/checkpoint
Mon Mar 9 00:08:04 2020 [Z0][VMM][I]: ExitCode: 1

Any help will be appreciated.

Cheers,

Fixed this. Run:

onedb update-body vm --id 35

And update the datastore the VM should be on.

This resulted due to accidentally removing a datastore in ON or just trying to reorganize them. You’ll need to do the above for all the VM’s on that datastore.

Thx,