Gets the total MIPS rating, which is the sum of MIPS rating of all Hosts in the Datacenter.
...
...
@@ -179,7 +179,7 @@ getMips
getMipsOfOnePe
^^^^^^^^^^^^^^
.. java:method:: int getMipsOfOnePe(int hostId, int peId)
.. java:method:: long getMipsOfOnePe(int hostId, int peId)
:outertype: DatacenterCharacteristics
Gets Millions Instructions Per Second (MIPS) Rating of a Processing Element (Pe). It is essential to use this method when a Datacenter is made up of heterogenous PEs per PMs.
.. java:type:: public abstract class PeProvisioner
.. java:type:: public interface PeProvisioner extends ResourceProvisioner
/** PeProvisioner is an abstract class that represents the provisioning policy used by a host to allocate its PEs to virtual machines inside it. 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. Each host's PE has to have its own instance of a PeProvisioner. When extending this class, care must be taken to guarantee that the field availableMips will always contain the amount of free mipsCapacity available for future allocations.
A class that represents the provisioning policy used by a host to allocate its PEs to virtual machines inside it. 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.
:author: Anton Beloglazov
:author: Manoel Campos da Silva Filho
Constructors
------------
PeProvisioner
^^^^^^^^^^^^^
Fields
------
NULL
^^^^
.. java:constructor:: public PeProvisioner(double mipsCapacity)
.. java:field:: PeProvisioner NULL
:outertype: PeProvisioner
Creates a new PeProvisioner.
:param mipsCapacity: The total mipsCapacity capacity of the PE that the provisioner can allocate to VMs
A property that implements the Null Object Design Pattern for PeProvisioner objects.
Methods
-------
allocateMipsForVm
^^^^^^^^^^^^^^^^^
allocateResourceForVm
^^^^^^^^^^^^^^^^^^^^^
.. java:method:: public abstract boolean allocateMipsForVm(Vm vm, double mips)
.. java:method:: @Override boolean allocateResourceForVm(Vm vm, long mips)
:outertype: PeProvisioner
Allocates a new virtual PE with a specific capacity for a given VM. The virtual PE to be added will use the total or partial mipsCapacity capacity of the physical PE.
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.
:param vm: the virtual machine for which the new virtual PE is being allocated
:param mips: the mipsCapacity to be allocated to the virtual PE of the given VM
:param mips: the MIPS to be allocated to the virtual PE of the given VM
:return: $true if the virtual PE could be allocated; $false otherwise
allocateMipsForVm
^^^^^^^^^^^^^^^^^
.. java:method:: public abstract boolean allocateMipsForVm(Vm vm, List<Double> mips)
:outertype: PeProvisioner
Allocates a new set of virtual PEs with a specific capacity for a given VM. The virtual PE to be added will use the total or partial mipsCapacity capacity of the physical PE.
:param vm: the virtual machine for which the new virtual PE is being allocated
:param mips: the list of mipsCapacity capacity of each virtual PE to be allocated to the VM
:return: $true if the set of virtual PEs could be allocated; $false otherwise
deallocateMipsForAllVms
^^^^^^^^^^^^^^^^^^^^^^^
deallocateResourceForAllVms
^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. java:method:: public void deallocateMipsForAllVms()
.. java:type:: public class PeProvisionerSimple extends PeProvisioner
.. java:type:: public class PeProvisionerSimple extends ResourceProvisionerSimple implements PeProvisioner
A \ :java:ref:`PeProvisioner`\ that uses a best-effort policy to allocate virtual PEs to VMs from a physical PE: if there is available MIPS on the physical PE, it allocates to a virtual PE; otherwise, it fails. Each host's PE has to have its own instance of a PeProvisioner.
PeProvisionerSimple is an extension of \ :java:ref:`PeProvisioner`\ which uses a best-effort policy to allocate virtual PEs to VMs: if there is available MIPS on the physical PE, it allocates to a virtual PE; otherwise, it fails. Each host's PE has to have its own instance of a PeProvisioner.
Each host's PE must have its own instance of a PeProvisioner. When extending this class, care must be taken to guarantee that the field availableMips will always contain the amount of free MIPS available for future allocations.
:author: Anton Beloglazov
:author: Anton Beloglazov, Manoel Campos da Silva Filho
Constructors
------------
PeProvisionerSimple
^^^^^^^^^^^^^^^^^^^
.. java:constructor:: public PeProvisionerSimple(double availableMips)
:outertype: PeProvisionerSimple
Instantiates a new pe provisioner simple.
:param availableMips: The total mips capacity of the PE that the provisioner can allocate to VMs.
Methods
-------
allocateMipsForVm
^^^^^^^^^^^^^^^^^
.. java:method:: @Override public boolean allocateMipsForVm(Vm vm, double mips)
:outertype: PeProvisionerSimple
allocateMipsForVm
^^^^^^^^^^^^^^^^^
.. java:method:: @Override public boolean allocateMipsForVm(Vm vm, List<Double> mipsShare)
.. java:constructor:: public PeProvisionerSimple()
:outertype: PeProvisionerSimple
deallocateMipsForAllVms
^^^^^^^^^^^^^^^^^^^^^^^
.. java:method:: @Override public void deallocateMipsForAllVms()
:outertype: PeProvisionerSimple
Instantiates a new PeProvisionerSimple that the \ :java:ref:`Pe`\ it will manage will be set just at Pe instantiation.
deallocateMipsForVm
PeProvisionerSimple
^^^^^^^^^^^^^^^^^^^
.. java:method:: @Override public void deallocateMipsForVm(Vm vm)
:outertype: PeProvisionerSimple
getAllocatedMipsForVm
^^^^^^^^^^^^^^^^^^^^^
.. java:method:: @Override public List<Double> getAllocatedMipsForVm(Vm vm)
.. java:constructor:: public PeProvisionerSimple(Pe pe)
:outertype: PeProvisionerSimple
getAllocatedMipsForVmByVirtualPeId
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Instantiates a new PeProvisionerSimple for a given \ :java:ref:`Pe`\ .
.. java:method:: @Override public double getAllocatedMipsForVmByVirtualPeId(Vm vm, int peId)
.. java:type:: public interface Pe extends Identificable, ResourceManageable
A interface to be implemented by each class that provides the basic features of a virtual or physical Processing Element (PE) of a PM or VM. Each Pe represents a virtual or physical processor core.
...
...
@@ -24,29 +26,19 @@ NULL
.. java:field:: Pe NULL
:outertype: Pe
A property that implements the Null Object Design Pattern for \ :java:ref:`Pe`\ objects.
An attribute that implements the Null Object Design Pattern for \ :java:ref:`Pe`\ objects.
Methods
-------
getId
^^^^^
.. java:method:: int getId()
:outertype: Pe
Gets the PE id.
:return: the PE id
getMips
^^^^^^^
getCapacity
^^^^^^^^^^^
.. java:method:: int getMips()
.. java:method:: @Override long getCapacity()
:outertype: Pe
Gets the MIPS Rating of this Pe.
Gets the capacity of this Pe in MIPS (Million Instructions Per Second).
Sets the capacity of this Pe in MIPS (Million Instructions Per Second).
It receives the amount of MIPS as a double value but converts it internally to a long. The method is just provided as a handy-way to define the PE capacity using a double value that usually is generated from some computations.
:param mipsCapacity: the MIPS capacity to set
:return: true if mipsCapacity > 0, false otherwise
setId
^^^^^
.. java:method:: void setId(int id)
:outertype: Pe
Sets the \ :java:ref:`getId()`\ .
:param id: the new PE id
setPeProvisioner
^^^^^^^^^^^^^^^^
.. java:method:: boolean setMips(double d)
.. java:method:: Pe setPeProvisioner(PeProvisioner peProvisioner)