Everyone has simple scripts they use to get through their day, I’m sure. The following scenario deals with having a large list (as provided in a .csv) of VMs needing to be migrated to a different datastore cluster. When dealing with multiple migrations, Storage DRS doesn’t update as quickly as one would like. Therefore, the current LUN with the most space can quite quickly be pushed to capacity. Thus, in this script we sort all of the LUNS by the amount of free space, grab the top 10 with the most free space, and randomly pick a lun to migrate the next VM.

For our own purposes, we prefer to make sure all the .vmdks are eager zeroed. So just in case, we transform any potential non-thick provisioned eager zeroed disk.