14.4. 电源管理元素
power_management 元素允许用户设置电源管理配置,这是主机隔离所需要的。配置 power_management 时,需要特定的子元素。
| 元素 | 类型 | Description | Properties |
|---|---|---|---|
type= | 隔离设备代码 | 在 capabilities 集合中提供了有效的隔离设备代码列表。 |
|
enabled | 布尔值: true 或 false | 指明是否启用或禁用电源管理配置。 |
|
address | 字符串 | 主机的主机名或 IP 地址。 |
|
用户名 | 字符串 | 电源管理的有效用户名。 | |
密码 | 字符串 | 用于电源管理的有效、强大的密码。 | |
选项 | complex | 所选 type= 的隔离选项使用选项 name="" 和 value="" 字符串指定。 | |
agents | complex | 当使用多个隔离时指定隔离代理选项。使用 order 子元素来对隔离代理进行优先排序。代理会根据顺序运行,直到隔离操作成功为止。当两个或多个隔离代理具有相同的 顺序 时,它们会同时运行。其他子元素包括 类型、ip、user、password 和 options。 | |
automatic_pm_enabled | 布尔值: true 或 false | 切换主机的自动电源控制,以节省能源。当设置为 true 时,如果集群的负载较低,则主机将自动关闭,并在需要时再次开机。当创建主机时,这设置为 true,除非由用户禁用。 | |
kdump_detection | 布尔值: true 或 false | 在关闭前,切换决定是否在主机上运行 kdump。当设置为 true 时,主机不会在 kdump 过程中关闭。当主机启用了电源管理时,这设置为 true,除非由用户禁用。 |
options 元素需要 选项 子元素列表。每个 选项 都需要一个 名称和类型 属性。某些选项仅适用于功能集合中定义的特定隔离类型。
新主机在
POST到主机资源时包括可选的 power_management 配置。power_management 配置使用 PUT 请求。
例 14.3. 主机的电源管理配置的 XML 表示
<host id="2ab5e1da-b726-4274-bbf7-0a42b16a0fc3"
href="/ovirt-engine/api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3">
<name>host1</name>
...
<power_management type="ilo">
<enabled>true</enabled>
<address>192.168.1.107</address>
<username>admin</username>
<password>p@55w0Rd!</password>
<options>
<option name="secure" value="true"/>
<option name="port" value="54345"/>
<option name="slot" value="3"/>
</options>
<agents>
<agent id="07f0b9ce-923a-4a96-a532-3c898fa8b6da">
<type>apc</type>
<order>1</order>
<ip>192.168.1.111</ip>
<user>example</user>
<password>p@55w0rd!</password>
<port>9</port>
<options>
<option name="power_wait" value="5"/>
<option name="secure" value="false"/>
</options>
</agent>
<agent id="50c71ba2-8495-11e0-b931-e20e458819ed">
<type>rsa</type>
<order>2</order>
<ip>192.168.1.112</ip>
<user>example</user>
<password>p@55w0rd!</password>
<port>9</port>
<options>
<option name="power_wait" value="5"/>
<option name="secure" value="false"/>
</options>
</agent>
</agents>
<automatic_pm_enabled>true</automatic_pm_enabled>
<kdump_detection>true</kdump_detection>
</power_management>
...
</host>

