在esxi上:获取vm列表,批量给vm关机,批量给vm强制关机
#!/bin/sh vim-cmd vmsvc/getallvms | grep Jump-Node for i in `vim-cmd vmsvc/getallvms | grep Jump-Node | awk '{print $1}'` ; do vim-cmd vmsvc/power.off $i ; done for i in `vim-cmd vmsvc/getallvms | grep Jump-Node | awk '{print $1}'` ; do vim-cmd vmsvc/destroy $i ; done vim-cmd vmsvc/getallvms | grep Jump-Node