To use this function add it to the class library file named vCenterServerService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: vCenterServerService.ts
publicVcResourcePoolCreate(objVcResourcePool:VcResourcePool,strResourcePoolName:string,intSharesInfoMemory:number,intSharesInfoCPU:number):VcResourcePool{
letobjVcSharesInfoMemory:VcSharesInfo=newVcSharesInfo();
objVcSharesInfoMemory.shares=intSharesInfoMemory;
objVcSharesInfoMemory.level=VcSharesLevel.normal;
letobjVcResourceAllocationInfoMemory:VcResourceAllocationInfo=newVcResourceAllocationInfo();
objVcResourceAllocationInfoMemory.shares=objVcSharesInfoMemory;
objVcResourceAllocationInfoMemory.limit=-1;
objVcResourceAllocationInfoMemory.reservation=0;
objVcResourceAllocationInfoMemory.expandableReservation=true;
letobjVcSharesInfoCPU:VcSharesInfo=newVcSharesInfo();
objVcSharesInfoCPU.shares=intSharesInfoCPU;
objVcSharesInfoCPU.level=VcSharesLevel.normal;
letobjVcResourceAllocationInfoCPU:VcResourceAllocationInfo=newVcResourceAllocationInfo();
objVcResourceAllocationInfoCPU.shares=objVcSharesInfoCPU;
objVcResourceAllocationInfoCPU.limit=-1;
objVcResourceAllocationInfoCPU.reservation=0;
objVcResourceAllocationInfoCPU.expandableReservation=true;
letobjVcResourceConfigSpec:VcResourceConfigSpec=newVcResourceConfigSpec();
objVcResourceConfigSpec.memoryAllocation=objVcResourceAllocationInfoMemory;
objVcResourceConfigSpec.cpuAllocation=objVcResourceAllocationInfoCPU;
// @ts-ignore
objVcResourceConfigSpec.scaleDescendantsShares='disabled';
letobjVcResourcePoolReturn:VcResourcePool=objVcResourcePool.createResourcePool(strResourcePoolName,objVcResourceConfigSpec);
returnobjVcResourcePoolReturn;
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
