Digressive / HyperV-Backup-Utility

Flexible Hyper-V Backup Utility
https://gal.vin/posts/vm-backup-for-hyper-v/
MIT License
125 stars 40 forks source link

Some improvements #16

Closed TripleNico closed 2 years ago

TripleNico commented 2 years ago

First of all, credits for all the work and effort you put in to this. The script build up and code style is clean and simple to follow. I wanted to make a similar script for our environment but i'm glad is searched Github first. Although many features and more are already in the script i bumped into some points while testing. I noted the points below in random order. They are all in one issue now but i can split them if you prefer.

  1. When a WorkingDirectory is set and Export-VM returns an error due to limited disk space the created VM folder in the WorkingDirectory is not cleaned up.
  2. Add option for email to embed/add a SPAM filter pass-through phrase. Many SPAM filters have the option to pass-through mail when a certain phrase is found in the body.
  3. Make email HTML instead of plain text. This would also fix the line-out issue. But i understand this is more work.
  4. Set Priority HIGH in email when an error is logged
  5. Add an example how one would run this script scheduled using TaskSchedular. For example run this script once per month at night
  6. Add option for Verbose logging
  7. Add separator line in log per VM. This makes to log even easier to read with multiple VM's
  8. Isn't it a better approach to use Transcript as logging engine? This also capture lot of default output (like Verbose)
  9. Log the duration per VM backup and for the total of the script. (Useful to see how long 2TB would take over a network)
  10. Check diskspace per VM before starting backup. This to prevent errors on Export-VM or Copy-Item
  11. Switch to delete backupped VM before starting new backup. This is helpfull when the destination hasn't got enough space to hold two copy's. For example now you need 4TB of diskpace when you have a 2TB VM you wan't to backup.
  12. Isn't the best and robust option to always stop a VM and then copy all the files? This because an OS is always changing so i guess the Export-VM option isn't robust enough on a live/running VM?
  13. The -NoPerm switch doesn't use date-time tag in root VM folder. Why is that?
  14. Would Optimize-VHD add something usefull for robust backups?

If any explanation or help is needed i'm happy to help. Even to adjust it in the script and make a pull request. Thanks again for publishing this script and all your effort!