ssh登录到esxi机器中后开关虚拟机

 

vim-cmd  vmsvc/getallvms /查看ESXi上所有虚拟机信息,主要查看虚拟机对应的ID

ssh登录到esxi机器中后开关虚拟机_第1张图片

Vmid      Name                         File                           Guest OS          Version   Annotation

30     win2003-ERP   [500G] win2003-test-1/win2003-test-1.vmx   winNetEnterpriseGuest   vmx-08

32     centos-1      [500G] centos-1/centos-1.vmx               centosGuest             vmx-08

34     centos-SMB    [500G] centos/centos.vmx                   centosGuest             vmx-08

38     nas           [500G] nas/nas.vmx                         other26xLinuxGuest      vmx-08

46     win2008-DC    [500G] win2008/win2008.vmx                 winLonghornGuest        vmx-08

49     CactiEZ10     [250G] CactiEZ10/CactiEZ10.vmx             centosGuest             vmx-08

59     freenas1      [250G] freenas1/freenas1.vmx               freebsdGuest            vmx-08

62     panabit       [250G] panabit/panabit.vmx                 other26xLinuxGuest      vmx-08

 

 

vim-cmd vmsvc/power.on   /对应ID的虚拟机即启动

 

vim-cmd vmsvc/power.shutdown 38 关闭nas

vim-cmd vmsvc/power.off   38  强行关机nas

 

 vim-cmd vmsvc/power.getstate 38   查看nas开关机状态