public class VmAllocationPolicySimple extends VmAllocationPolicy
| Constructor and Description |
|---|
VmAllocationPolicySimple(List<? extends Host> list)
Creates the new VmAllocationPolicySimple object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
allocateHostForVm(Vm vm)
Allocates a host for a given VM.
|
boolean |
allocateHostForVm(Vm vm,
Host host)
Allocates a specified host for a given VM.
|
void |
deallocateHostForVm(Vm vm)
Releases the host used by a VM.
|
protected List<Integer> |
getFreePes()
Gets the free pes.
|
Host |
getHost(int vmId,
int userId)
Gets the host that is executing the given VM belonging to the given user.
|
Host |
getHost(Vm vm)
Gets the host that is executing the given VM belonging to the given user.
|
protected Map<String,Integer> |
getUsedPes()
Gets the used pes.
|
Map<String,Host> |
getVmTable()
Gets the vm table.
|
List<Map<String,Object>> |
optimizeAllocation(List<? extends Vm> vmList)
Optimize allocation of the VMs according to current utilization.
|
protected void |
setFreePes(List<Integer> freePes)
Sets the free pes.
|
protected void |
setUsedPes(Map<String,Integer> usedPes)
Sets the used pes.
|
protected void |
setVmTable(Map<String,Host> vmTable)
Sets the vm table.
|
getHostList, setHostListpublic boolean allocateHostForVm(Vm vm)
allocateHostForVm in class VmAllocationPolicyvm - VM specificationpublic void deallocateHostForVm(Vm vm)
deallocateHostForVm in class VmAllocationPolicyvm - the vmpublic Host getHost(Vm vm)
getHost in class VmAllocationPolicyvm - the vmpublic Host getHost(int vmId, int userId)
getHost in class VmAllocationPolicyvmId - the vm iduserId - the user idprotected void setVmTable(Map<String,Host> vmTable)
vmTable - the vm tableprotected void setUsedPes(Map<String,Integer> usedPes)
usedPes - the used pesprotected void setFreePes(List<Integer> freePes)
freePes - the new free pespublic List<Map<String,Object>> optimizeAllocation(List<? extends Vm> vmList)
VmAllocationPolicyoptimizeAllocation in class VmAllocationPolicyvmList - the vm listpublic boolean allocateHostForVm(Vm vm, Host host)
VmAllocationPolicyallocateHostForVm in class VmAllocationPolicyvm - virtual machine which the host is reserved toCopyright © 2012 The Cloud Computing and Distributed Systems (CLOUDS) Laboratory, The University of Melbourne. All Rights Reserved.