Vmware-Esxi

如何讓 ESXi 5.5 僅從 ssh/CLI 自動啟動虛擬機?

  • July 7, 2016

我對 ESXi 伺服器的唯一訪問是通過 SSH。我無法使用 vCenter 或 Web 界面

vmware提供了一篇文章:

kb.vmware.com – Determining virtual machines are configured to autostart (1000163)

但是這篇文章的內容似乎和我的ESXi伺服器一點關係都沒有。有問題的文件在那裡,但並非所有行都像文件所說的那樣出現。

VMware 說明:

Log in as root to your ESX host with SSH.
Open the /etc/vmware/hostd/vmAutoStart.xml file in text editor.
Search the file for the entry:
<enabled>true</enabled>

Note: If you find this entry, the autostart functionality is enabled. 
If you do not find this entry, the functionality is disabled.

To disable autostart for all virtual machines on the host, edit this entry to:
<enabled>false</enabled>

If you want to enable the functionality
add the entry immediately after the line ending with:
</dynamicProperty>

我的文件包含以下內容:

<ConfigRoot>
 <AutoStartOrder>
   <_length>0</_length>
   <_type>vim.host.AutoStartManager.AutoPowerInfo[]</_type>
 </AutoStartOrder>
 <SystemDefaults>
   <_type>vim.host.AutoStartManager.SystemDefaults</_type>
   <startDelay>120</startDelay>
   <stopAction>PowerOff</stopAction>
   <stopDelay>120</stopDelay>
   <waitForHeartbeat>false</waitForHeartbeat>
 </SystemDefaults>
</ConfigRoot>

“DynamicPropery”不是我文件中的一個部分。似乎需要一些語法才能將此 ESXi 伺服器中的虛擬機/來賓放置在自動啟動列表中,但我一直找不到它。有知道的請指點一下。

與其修改配置文件,不如使用 vim-cmd 命令(及其命名空間 hostsvc/autostartmanager)來配置 VM 自動啟動。跑

vim-cmd help hostsvc/autostartmanager

尋求幫助。這裡有一個很好的範例概述:http: //msmhec.pl/vmw/Documents/VIM-CMD.pdf(提到 ESXi 4.1,但仍然適用於最近的 ESXi 版本)

引用自:https://serverfault.com/questions/788350