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
publicVcClusterComputeResourceConfigurePowerPolicy(objVcClusterComputeResource:VcClusterComputeResource):void{
letarrVcHostSystem:VcHostSystem[]=objVcClusterComputeResource.host;
arrVcHostSystem.forEach((objVcHostSystem:VcHostSystem):void=>{
this.objLogger.info(`Setting Power Policy to High Performance on${objVcHostSystem.name}`);
letobjVcHostConfigManager:VcHostConfigManager=objVcHostSystem.configManager;
letobjVcHostPowerSystem: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.
