Function: vCenter Cluster Compute Resource Configure Power Policy

by Simon Sparks · 5 January 2026

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.

You may also like