To use this function add it to the class library file named vCenterServerService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: vCenterServerService.ts
publicVcVirtualMachineSuspend(objVcVirtualMachine:VcVirtualMachine):void{
letobjVcTask:VcTask=objVcVirtualMachine.suspendVM_Task()
this.WaitForVcTaskEnd(objVcTask,2);
}
publicVcVirtualMachineReset(objVcVirtualMachine:VcVirtualMachine):void{
letobjVcTask:VcTask=objVcVirtualMachine.resetVM_Task()
this.WaitForVcTaskEnd(objVcTask,2);
}
publicVcVirtualMachinePowerOff(objVcVirtualMachine:VcVirtualMachine):void{
letobjVcTask:VcTask=objVcVirtualMachine.powerOffVM_Task()
this.WaitForVcTaskEnd(objVcTask,2);
}
publicVcVirtualMachinePowerOn(objVcVirtualMachine:VcVirtualMachine):void{
letobjVcVirtualMachineRuntimeInfo:VcVirtualMachineRuntimeInfo=objVcVirtualMachine.runtime;
letobjVcHostSystem:VcHostSystem=objVcVirtualMachineRuntimeInfo.host;
letobjVcTask:VcTask=objVcVirtualMachine.powerOnVM_Task(objVcHostSystem);
this.WaitForVcTaskEnd(objVcTask,2);
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
