mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-19 03:12:55 +09: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:
1 parent
85acc2e00e
commit
8bdb933ec8
1 file changed
+4
-23
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user