【问题标题】:Pyvmomi configure ESXi 'NTP Client Enabled' check boxPyvmomi 配置 ESXi 'NTP Client Enabled' 复选框
【发布时间】:2020-10-20 11:16:11
【问题描述】:

使用以下代码可以更新 ESXi 服务器中 ntpd 服务的启动策略,

con = connect.SmartConnect(host=host, user=user, pwd=pwd)
content = con.RetrieveContent()
cv = content.viewManager.CreateContainerView(
        container=content.rootFolder, type=[vim.HostSystem], recursive=True)

for child in cv.view:
    child.configManager.serviceSystem.UpdatePolicy(id='ntpd', policy='on')

服务中没有线索

(vim.host.Service) {
dynamicType = <unset>,
dynamicProperty = (vmodl.DynamicProperty) [],
key = 'ntpd',
label = 'NTP Daemon',
required = false,
uninstallable = false,
running = false,
ruleset = (str) [
  'ntpClient'
],
policy = 'off',
sourcePackage = (vim.host.Service.SourcePackage) {
  dynamicType = <unset>,
  dynamicProperty = (vmodl.DynamicProperty) [],
  sourcePackageName = 'esx-base',
  description = 'This VIB contains all of the base functionality of 
  vSphere ESXi.'
  }
}

但是如何使用 Pyvmomi 为 ESXi 标记 NTP Client Enabled 复选框?

VMware 版本 - 6.0.0

【问题讨论】:

    标签: vmware esxi pyvmomi


    【解决方案1】:

    host.configManager.firewallSystem.EnableRuleset(id='ntpClient')

    【讨论】:

      猜你喜欢
      • 2019-03-27
      • 2020-03-07
      • 2013-09-17
      • 2019-08-27
      • 2016-05-27
      • 2014-10-21
      • 2023-04-07
      • 2013-11-30
      • 2014-06-26
      相关资源
      最近更新 更多