Fix performance bug 

Only loop through the list of virtual machines to get uuids once instead of once per vm.

In a medium size environment (326 vms) this results in a 90% decrease in the time taken to complete this check.