delete old VMs script

Based on #893
- renamed/reworked script
- deduplicated functions
Merge pull request #1108 from seandst/pr893

delete old VMs script