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 VcVirtualMachineConfigureHardwareUpgrade(objVcVirtualMachine: VcVirtualMachine): void {
let strMaxHardwareVersion: string = this.VcVirtualMachineGetMaxHardwareVersion(objVcVirtualMachine);
let objVcVirtualMachineConfigInfo: VcVirtualMachineConfigInfo = objVcVirtualMachine.config;
let strCurrenHardwareVersion: string = objVcVirtualMachineConfigInfo.version;
let objVcVirtualMachineRuntimeInfo: VcVirtualMachineRuntimeInfo = objVcVirtualMachine.runtime;
let objVcHostSystem: VcHostSystem = objVcVirtualMachineRuntimeInfo.host;
this.objLogger.info("Maximum supported hardware version on host " + objVcHostSystem.name + " is: " + strMaxHardwareVersion);
this.objLogger.info("Current hardware version is: " + objVcVirtualMachineConfigInfo.version);
if (strMaxHardwareVersion > strCurrenHardwareVersion) {
this.objLogger.info("Configuring VM hardware upgrade on next reboot...");
this.VcVirtualMachineScheduleHardwareUpgrade(objVcVirtualMachine, strMaxHardwareVersion);
}
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
