All fixed and tested:
   multiple hosts; multiple vms; wrong vm names; running vms.
Added debug option.
TODO:
   test with versions < 3.4
   test with hosted engine