ResourceProvisionerSimple

public class ResourceProvisionerSimple extends ResourceProvisionerAbstract

A best-effort ResourceProvisioner policy used by a Host to provide a resource to VMs:

  • if there is available amount of the resource on the host, it provides;
  • otherwise, it fails.
Author:Rodrigo N. Calheiros, Anton Beloglazov, Manoel Campos da Silva Filho

Constructors

ResourceProvisionerSimple

public ResourceProvisionerSimple()

Creates a new ResourceProvisionerSimple which the ResourceManageable it will manage have to be set further.

See also: .setResource(ResourceManageable)

ResourceProvisionerSimple

protected ResourceProvisionerSimple(ResourceManageable resource)

Creates a new ResourceProvisionerSimple.

Parameters:
  • resource – the resource to be managed by the provisioner

Methods

allocateResourceForVm

public boolean allocateResourceForVm(Vm vm, long newTotalVmResourceCapacity)

allocateResourceForVm

public boolean allocateResourceForVm(Vm vm, double newTotalVmResource)

deallocateResourceForVm

public boolean deallocateResourceForVm(Vm vm)

deallocateResourceForVmAndSetAllocationMapEntryToZero

protected long deallocateResourceForVmAndSetAllocationMapEntryToZero(Vm vm)

isSuitableForVm

public boolean isSuitableForVm(Vm vm, long newVmTotalAllocatedResource)