SUSE / suse-migration-services

GNU General Public License v3.0
7 stars 10 forks source link

Workaround for LVM support #277

Open doccaz opened 11 months ago

doccaz commented 11 months ago

Recently while testing DMS to help a customer migrate its VMs, I noticed that most of their VMs use a complex layout with LVM, and thus DMS would fail (as described in the documentation).

The issue is that GRUB cannot find the ISO after rebooting, as their /usr lives on a separate LV, and the logic in 99_migration would evaluate the final path as "/share/migration-image/", as it assumes /usr is under the root partition.

I managed to get it working with a workaround. Right before rebooting, run these commands:

# mkdir /share
# cp -av /usr/share/migration-image /share/

# sed -i '/insmod %s/a printf \"    insmod lvm\\n\"' /etc/grub.d/99_migration 
# grub2-mkconfig -o /boot/grub2/grub.cfg

So, with these I'm:

This will, of course, occupy an extra 400MB or so (the migration ISO image size) on the root partition, but this space can be reclaimed after the migration.

I could have written the proper GRUB logic to find the /usr partition, but I think this could vary quite a lot. Maybe we could leave the ISO on a different directory at the root partition, like I did with the workaround? Something like "/migration-image" is very unlikely to exist as a separate LV on any setup.