如何使用Python SDK API启用或禁用vSphere HA



在vSphere UI中,有一个按钮用于打开或关闭vSphere HA,群集>配置>vSphere可用性>vSphere HA已打开>编辑>vSphere HA。

什么是正确的API引用对象,可以实现相同的目标?

我想明白了。。。

def disableVcenterHighAvailabilityMode(vsan_client, clusterName):
print("Disabling vSphere HA Mode.")
cluster = getClusterInstance(clusterName, vsan_client)
clusterConfigSpec = vim.cluster.ConfigSpec()
clusterConfigSpec.dasConfig = cluster.configuration.dasConfig
clusterConfigSpec.dasConfig.enabled = False
cluster.ReconfigureCluster_Task(clusterConfigSpec, True)

最新更新