public class NetworkVmAllocationPolicy extends VmAllocationPolicy
| Constructor and Description |
|---|
NetworkVmAllocationPolicy(java.util.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 java.util.List<java.lang.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 double |
getMaxUtilizationAfterAllocation(NetworkHost host,
Vm vm) |
protected java.util.Map<java.lang.String,java.lang.Integer> |
getUsedPes()
Gets the used pes.
|
java.util.Map<java.lang.String,Host> |
getVmTable()
Gets the vm table.
|
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
optimizeAllocation(java.util.List<? extends Vm> vmList)
Optimize allocation of the VMs according to current utilization.
|
protected void |
setFreePes(java.util.List<java.lang.Integer> freePes)
Sets the free pes.
|
protected void |
setUsedPes(java.util.Map<java.lang.String,java.lang.Integer> usedPes)
Sets the used pes.
|
protected void |
setVmTable(java.util.Map<java.lang.String,Host> vmTable)
Sets the vm table.
|
getHostList, setHostListpublic NetworkVmAllocationPolicy(java.util.List<? extends Host> list)
list - the listpublic boolean allocateHostForVm(Vm vm)
allocateHostForVm in class VmAllocationPolicyvm - VM specificationprotected double getMaxUtilizationAfterAllocation(NetworkHost host, Vm vm)
public 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 idpublic java.util.Map<java.lang.String,Host> getVmTable()
protected void setVmTable(java.util.Map<java.lang.String,Host> vmTable)
vmTable - the vm tableprotected java.util.Map<java.lang.String,java.lang.Integer> getUsedPes()
protected void setUsedPes(java.util.Map<java.lang.String,java.lang.Integer> usedPes)
usedPes - the used pesprotected java.util.List<java.lang.Integer> getFreePes()
protected void setFreePes(java.util.List<java.lang.Integer> freePes)
freePes - the new free pespublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> optimizeAllocation(java.util.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 to