Function: vCenter Cluster Compute Resource NTP Server Toggle

by Simon Sparks · 2 February 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: VcClusterComputeResourceNtpServerConfigure

public VcClusterComputeResourceNtpServerConfigure(objVcClusterComputeResource: VcClusterComputeResource, arrNtpServerIp: string[]): void {

    this.VcClusterComputeResourceNtpServerConfigure(objVcClusterComputeResource, arrNtpServerIp);
}

Public Function: VcClusterComputeResourceNtpServerUnconfigure

public VcClusterComputeResourceNtpServerUnconfigure(objVcClusterComputeResource: VcClusterComputeResource): void {

    this.VcClusterComputeResourceNtpServerConfigure(objVcClusterComputeResource, []);
}

Private Function: VcClusterComputeResourceNtpServerToggle

private VcClusterComputeResourceNtpServerConfigure(objVcClusterComputeResource: VcClusterComputeResource, arrNtpServerIp: string[]): void {

    let objVcHostNtpConfig: VcHostNtpConfig = new VcHostNtpConfig();
    objVcHostNtpConfig.server = arrNtpServerIp

    let objVcHostDateTimeConfig: VcHostDateTimeConfig = new VcHostDateTimeConfig();
    objVcHostDateTimeConfig.ntpConfig = objVcHostNtpConfig;

    let arrVcHostSystem: VcHostSystem[] = objVcClusterComputeResource.host;

    arrVcHostSystem.forEach((objVcHostSystem: VcHostSystem): void => {

        this.VcHostSystemNtpServerConfigure(objVcHostSystem, arrNtpServerIp);
    });
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like