Interface PeProvisioner
- All Superinterfaces:
ResourceProvisioner
- All Known Implementing Classes:
PeProvisionerSimple
public interface PeProvisioner extends ResourceProvisioner
An interface that represents the provisioning policy
used by a host to provide virtual PEs to its virtual machines.
It gets a physical PE and manage it in order to provide this PE as virtual PEs for VMs.
In that way, a given PE might be shared among different VMs.
- Since:
- CloudSim Plus 1.1
- Author:
- Manoel Campos da Silva Filho
-
Field Summary
Fields Modifier and Type Field Description static PeProvisioner
NULL
An attribute that implements the Null Object Design Pattern for PeProvisioner objects. -
Method Summary
Modifier and Type Method Description boolean
allocateResourceForVm(Vm vm, long mipsCapacity)
Allocates an amount of MIPS from the physical Pe to a new virtual PE for a given VM.void
deallocateResourceForAllVms()
Releases all virtual PEs allocated to all VMs.boolean
deallocateResourceForVm(Vm vm)
Releases the virtual Pe allocated to a given VM.long
getAllocatedResourceForVm(Vm vm)
Gets the amount of allocated MIPS from the physical Pe to a virtual PE of a VM.long
getTotalAllocatedResource()
Gets the total allocated MIPS from the physical Pe.double
getUtilization()
Gets the utilization percentage of the Pe in scale from 0 to 1.void
setPe(Pe pe)
Sets thePe
that this provisioner will manage.Methods inherited from interface org.cloudbus.cloudsim.provisioners.ResourceProvisioner
allocateResourceForVm, getAvailableResource, getCapacity, getResource, isResourceAllocatedToVm, isSuitableForVm, setResource
-
Field Details
-
NULL
An attribute that implements the Null Object Design Pattern for PeProvisioner objects.
-
-
Method Details
-
setPe
Sets thePe
that this provisioner will manage.- Parameters:
pe
- the Pe to set
-
allocateResourceForVm
Allocates an amount of MIPS from the physical Pe to a new virtual PE for a given VM. The virtual PE to be added will use the total or partial MIPS capacity of the physical PE.- Specified by:
allocateResourceForVm
in interfaceResourceProvisioner
- Parameters:
vm
- the virtual machine for which the new virtual PE is being allocatedmipsCapacity
- the MIPS to be allocated to the virtual PE of the given VM- Returns:
- $true if the virtual PE could be allocated; $false otherwise
-
getAllocatedResourceForVm
Gets the amount of allocated MIPS from the physical Pe to a virtual PE of a VM.- Specified by:
getAllocatedResourceForVm
in interfaceResourceProvisioner
- Parameters:
vm
- the virtual machine to get the allocated virtual Pe MIPS- Returns:
- the allocated virtual Pe MIPS
-
deallocateResourceForVm
Releases the virtual Pe allocated to a given VM.- Specified by:
deallocateResourceForVm
in interfaceResourceProvisioner
- Parameters:
vm
- the vm to release the virtual Pe- Returns:
- true if the resource was deallocated; false if the related resource has never been allocated to the given VM.
-
deallocateResourceForAllVms
void deallocateResourceForAllVms()Releases all virtual PEs allocated to all VMs.- Specified by:
deallocateResourceForAllVms
in interfaceResourceProvisioner
-
getTotalAllocatedResource
long getTotalAllocatedResource()Gets the total allocated MIPS from the physical Pe.- Specified by:
getTotalAllocatedResource
in interfaceResourceProvisioner
- Returns:
- the total allocated MIPS
-
getUtilization
double getUtilization()Gets the utilization percentage of the Pe in scale from 0 to 1.- Returns:
- the utilization percentage from 0 to 1
-