We’re going to discontinue one of our datastores and moving away all active images there. However, one of the images are used as template for our CentOS VMs and assigned as non-persistent for 28 VMs.
Then it us priblematic, because all VMs disks use this base image as backing-image. Best way is terminate all vms and create new from new image in new ds. If you need prereserve actual vms, then you can stop all, move image to new ds, delete old ds, and create symlink on filesystem to old location, and start vms
well, I’m a bit surprised since it really sounds tricky. OpenNebula doesn’t cover any situations like this? Actually, we have glusterfs configured as backend for this storage with the failed drive we’re not able to hot-swap.
with you plan about preserving VMs - I’m worrying about VM template section:
I can create symlink for /var/lib/one//datastores/103/a31d58b29e84f1742e10075f575338fe to the new image location on new datastore - no problem with this part.
But, it contains “DATASTORE = “backup_storage””. What happens if I remove this datastore? I guess it will bump me with error like “man, this datastore not found”.
Looks really dangerous for me… Huge downtime and big chance of losing data.
Hi, there is one more problem, your system ds. Base image is in image ds, clones pointing to base image are in system ds. So you have to symlink both.
Regarding vm template, you can update it using command ‘onevm update ’. In this case you can also update source image, and get rid of base image by rebasing qcow2. So you dont need symlinks
As @feldsam said, there’s no supported method for achieving your goal with current OpenNebula functionality. Probably the way to proceed is to manually update VM references by using onedb update-body command. I think the main functionality should works fine with that, but I suggest to test this with a testing VM before trying to apply any changes to production VMs.
Also, I think it makes sense to provide functionality to ease this kind of procedures. It would be nice if you can open a GitHub issue explaining your use case so we can evaluate it for future releases.
Just to double-check with you, how safe onedb fsck command is? As I understand, I need to completely shutdown Opennebula and run it. Does it perform just checks or any changes to database?
You shouldn’t have any problem by running fsck tool, it will try to fix the errors that can be automatically fixed and will warn you if there’s any error that need manual intervention. It will also perform a DB backup before modifying anything.