utkuozdemir / pv-migrate

CLI tool to easily migrate Kubernetes persistent volumes
Apache License 2.0
1.57k stars 76 forks source link

Migrating from a larger to a smaller pvc fails with a generic error message. #244

Open danielr1996 opened 12 months ago

danielr1996 commented 12 months ago

Is your feature request related to a problem? Please describe. When trying to copy from a larger pvc to a smaller pvc the migration fails with the following very generic error message

Migration failed with this strategy, will try with the remaining strategies
Error: migration failed: all strategies failed for this migration
❌  Error: migration failed: all strategies failed for this migration

Describe the solution you'd like I would like pv-migrate to check the target and source size and don't even start the migration when there is less space in the target then the source. While I understand that comparing actual sizes could be difficult, it should at least be possible to compare the requested sizes and provide a flag --ignore-sizes if you know your data will fit because the pvcs are 100G and 50G each, but you know the actual size is just 10G.

Describe alternatives you've considered It would be fine to display a more descriptive error after failing, maybe the one the underlying command (rsync) produced, instead of the generic one. This might be easier the implement, especially if you migrate e.g. 100G into a 99G pvc and find out that you dont't have enough space after copying for hours.

utkuozdemir commented 11 months ago

I like the idea of checking sizes and failing explicitly unless having --ignore-sizes set. I also like the idea of showing the actual rsync error message on a failed migration.

I'll try to look into it some time.