Class VmSchedulerTimeShared
- All Implemented Interfaces:
VmScheduler
- Direct Known Subclasses:
VmSchedulerTimeSharedOverSubscription
public class VmSchedulerTimeShared extends VmSchedulerAbstract
Each host has to use is own instance of a VmScheduler that will so schedule the allocation of host's PEs for VMs running on it.
It does not perform a preemption process in order to move running VMs to the waiting list in order to make room for other already waiting VMs to run. It just imposes there is not waiting VMs, oversimplifying the scheduling, considering that for a given simulation second t, the total processing capacity of the processor cores (in MIPS) is equally divided by the VMs that are using them.
In processors enabled with Hyper-threading technology (HT), it is possible to run up to 2 processes at the same physical CPU core. However, this scheduler implementation oversimplifies a possible HT feature by allowing several VMs to use a fraction of the MIPS capacity from physical PEs, until that the total capacity of the virtual PE is allocated. Consider that a virtual PE is requiring 1000 MIPS but there is no physical PE with such a capacity. The scheduler will allocate these 1000 MIPS across several physical PEs, for instance, by allocating 500 MIPS from PE 0, 300 from PE 1 and 200 from PE 2, totaling the 1000 MIPS required by the virtual PE.
In a real hypervisor in a Host that has Hyper-threading CPU cores, two virtual PEs can be allocated to the same physical PE, but a single virtual PE must be allocated to just one physical PE.
- Since:
- CloudSim Toolkit 1.0
- Author:
- Rodrigo N. Calheiros, Anton Beloglazov, Manoel Campos da Silva Filho
-
Field Summary
Fields inherited from class org.cloudbus.cloudsim.schedulers.vm.VmSchedulerAbstract
DEFAULT_VM_MIGRATION_CPU_OVERHEAD
Fields inherited from interface org.cloudbus.cloudsim.schedulers.vm.VmScheduler
NULL
-
Constructor Summary
Constructors Constructor Description VmSchedulerTimeShared()
Creates a time-shared VM scheduler.VmSchedulerTimeShared(double vmMigrationCpuOverhead)
Creates a time-shared VM scheduler, defining a CPU overhead for VM migration. -
Method Summary
Modifier and Type Method Description protected void
allocateMipsShareForVm(Vm vm, MipsShare requestedMipsReduced)
Performs the allocation of a MIPS List to a given VM.boolean
allocatePesForVmInternal(Vm vm, MipsShare requestedMips)
void
deallocatePesForAllVms()
Releases PEs allocated to all the VMs.protected void
deallocatePesFromVmInternal(Vm vm, int pesToRemove)
protected MipsShare
getMipsShareToAllocate(MipsShare requestedMips, double scalingFactor)
Gets the actual MIPS share that will be allocated to VM's PEs, considering the VM migration status.protected MipsShare
getMipsShareToAllocate(Vm vm, MipsShare requestedMips)
Gets the actual MIPS share that will be allocated to VM's PEs, considering the VM migration status.protected boolean
isSuitableForVmInternal(Vm vm, MipsShare requestedMips)
The non-emptiness of the list is ensured by theVmScheduler.isSuitableForVm(Vm, MipsShare)
method.Methods inherited from class org.cloudbus.cloudsim.schedulers.vm.VmSchedulerAbstract
allocatePesForVm, allocatePesForVm, deallocatePesFromVm, deallocatePesFromVm, getAllocatedMips, getAllocatedMipsMap, getHost, getMaxCpuUsagePercentDuringOutMigration, getMipsShareRequestedReduced, getPeCapacity, getRequestedMips, getRequestedMipsMap, getTotalAllocatedMipsForVm, getTotalAvailableMips, getVmMigrationCpuOverhead, getWorkingPeList, isSuitableForVm, isSuitableForVm, percentOfMipsToRequest, putAllocatedMipsMap, removePesFromMap, setHost
-
Constructor Details
-
VmSchedulerTimeShared
public VmSchedulerTimeShared()Creates a time-shared VM scheduler. -
VmSchedulerTimeShared
public VmSchedulerTimeShared(double vmMigrationCpuOverhead)Creates a time-shared VM scheduler, defining a CPU overhead for VM migration.- Parameters:
vmMigrationCpuOverhead
- the percentage of Host's CPU usage increase when a VM is migrating in or out of the Host. The value is in scale from 0 to 1 (where 1 is 100%).
-
-
Method Details
-
deallocatePesFromVmInternal
- Specified by:
deallocatePesFromVmInternal
in classVmSchedulerAbstract
-
deallocatePesForAllVms
public void deallocatePesForAllVms()Releases PEs allocated to all the VMs.- Specified by:
deallocatePesForAllVms
in interfaceVmScheduler
- Overrides:
deallocatePesForAllVms
in classVmSchedulerAbstract