暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

ESXi系统命令行下启动虚拟机

原创 jieguo 2023-05-15
1897

ssh登录主机。
用命令列出虚拟机的ID:

vim-cmd vmsvc/getallvms |grep <vm name>

注意: 第一列输出是vmid.

用命令查看虚拟机启动状态:


vim-cmd vmsvc/power.getstate <vmid>

用命令启动虚拟机:

vim-cmd vmsvc/power.on <vmid>
关闭命令:
vim-cmd vmsvc/power.off <vmid>

操作参考:

[root@test2 volumes]# vim-cmd vmsvc/getallvms
Vmid                       Name                                                                    File                                                      Guest OS           Version   Annotation
400    CeshiIE-203.90                                  [datastore1 (6)] CeshiIE-203.90/CeshiIE-203.90.vmx                                             windows7_64Guest          vmx-07              
416    CeshiIE-203.89                                  [datastore1 (6)] CeshiIE-203.89/CeshiIE-203.89.vmx                                             windows7_64Guest          vmx-07              
528    idianwifi-203.79-300G              [datastore1 (6)] Beidianwifi-203.79/Beidianwifi-203.79.vmx                                     windows7Server64Guest     vmx-07              
[root@test2 volumes]# vim-cmd vmsvc/getallvms |grep 203.101
576   test-203.101-480G            [datastore1 (6)] +5YWx5Lqr6YOo5aSp5rSl56e75Yqo--2/+5YWx5Lqr6YOo5aSp5rSl56e75Yqo--2.vmx         windows7Server64Guest     vmx-07              
[root@test2 volumes]# vim-cmd vmsvc/power.getstate 576
Retrieved runtime info
Powered off
[root@test2 volumes]# vim-cmd vmsvc/power.getstate 336
Retrieved runtime info
Powered on
[root@test2 volumes]# vim-cmd vmsvc/power.on 576
Powering on VM:
[root@test2 volumes]# vim-cmd vmsvc/power.getstate 368
Retrieved runtime info
Powered off
[root@test2 volumes]# vim-cmd vmsvc/power.on 368
Powering on VM:
[root@test2 volumes]# 

最后修改时间:2023-05-15 12:56:58
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论