mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
Fixed CPU and Memory setting in VMWare VMs
git-svn-id: http://svn.opennebula.org/one/trunk@673 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
parent
85acc2e00e
commit
8bdb933ec8
@ -192,30 +192,11 @@ public class DeployVM
|
||||
vmConfigSpec = new VirtualMachineConfigSpec();
|
||||
|
||||
|
||||
ResourceAllocationInfo raInfo = new ResourceAllocationInfo();
|
||||
SharesInfo sharesInfo = new SharesInfo();
|
||||
|
||||
// Memory
|
||||
|
||||
sharesInfo.setLevel(SharesLevel.custom);
|
||||
sharesInfo.setShares(Integer.parseInt(pXML.getMemory())*1024);
|
||||
|
||||
raInfo.setShares(sharesInfo);
|
||||
|
||||
vmConfigSpec.setMemoryAllocation(raInfo);
|
||||
|
||||
// CPU
|
||||
|
||||
sharesInfo = new SharesInfo();
|
||||
raInfo = new ResourceAllocationInfo();
|
||||
|
||||
sharesInfo.setLevel(SharesLevel.custom);
|
||||
sharesInfo.setShares(Integer.parseInt(pXML.getCPU()));
|
||||
|
||||
raInfo.setShares(sharesInfo);
|
||||
|
||||
vmConfigSpec.setCpuAllocation(raInfo);
|
||||
|
||||
vmConfigSpec.setMemoryMB((long)Integer.parseInt(pXML.getMemory()));
|
||||
|
||||
vmConfigSpec.setNumCPUs(Integer.parseInt(pXML.getCPU()));
|
||||
|
||||
// DISKs
|
||||
// TODO finish disk support
|
||||
// addDisks();
|
||||
|
Loading…
x
Reference in New Issue
Block a user