To use this function add it to the class library file named vCenterServerService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: vCenterServerService.ts
publicVcVirtualMachineReserveCPU(objVcVirtualMachine:VcVirtualMachine,intVcSharesInfoCPU:number,intVcResourceAllocationInfoCPUReservation:number):boolean{
letobjVcSharesInfoCPU:VcSharesInfo=newVcSharesInfo();
objVcSharesInfoCPU.shares=intVcSharesInfoCPU;
objVcSharesInfoCPU.level=VcSharesLevel.normal;
letobjVcResourceAllocationInfoCPU:VcResourceAllocationInfo=newVcResourceAllocationInfo();
objVcResourceAllocationInfoCPU.reservation=intVcResourceAllocationInfoCPUReservation;
objVcResourceAllocationInfoCPU.shares=objVcSharesInfoCPU;
letobjVcVirtualMachineConfigSpec:VcVirtualMachineConfigSpec=newVcVirtualMachineConfigSpec();
objVcVirtualMachineConfigSpec.cpuAllocation=objVcResourceAllocationInfoCPU;
letblnReturn:boolean=this.VcVirtualMachineReconfigure(objVcVirtualMachine,objVcVirtualMachineConfigSpec);
returnblnReturn;
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
