To use this function add it to the class library file named vCenterServerService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: vCenterServerService.ts
Public Function: VcClusterComputeResourceConfigurePowerPolicy
public VcClusterComputeResourceConfigurePowerPolicy(objVcClusterComputeResource: VcClusterComputeResource): void {
let arrVcHostSystem: VcHostSystem[] = objVcClusterComputeResource.host;
arrVcHostSystem.forEach((objVcHostSystem: VcHostSystem): void => {
this.objLogger.info(`Setting Power Policy to High Performance on ${objVcHostSystem.name}`);
let objVcHostConfigManager: VcHostConfigManager = objVcHostSystem.configManager;
let objVcHostPowerSystem: VcHostPowerSystem = objVcHostConfigManager.powerSystem;
objVcHostPowerSystem.configurePowerPolicy(1);
this.objLogger.info("Power Policy Changed Successfully");
});
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
