RamProvisioner (cloudsim 3.1-SNAPSHOT API)

org.cloudbus.cloudsim.provisioners

## Class RamProvisioner

- java.lang.Object
- - org.cloudbus.cloudsim.provisioners.RamProvisioner

- Direct Known Subclasses:
    RamProvisionerSimple

      public abstract class RamProvisioner
      extends Object

  RamProvisioner is an abstract class that represents the provisioning policy of memory to virtual machines inside a Host. When extending this class, care must be taken to guarantee that the field availableMemory will always contain the amount of free memory available for future allocations.
  Since:
    CloudSim Toolkit 1.0
  Author:
    Rodrigo N. Calheiros, Anton Beloglazov

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RamProvisioner(int ram)` Creates the new RamProvisioner.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract boolean` | `allocateRamForVm(Vm vm, int ram)` Allocates RAM for a given VM.
    `void` | `deallocateRamForAllVms()` Releases BW used by a all VMs.
    `abstract void` | `deallocateRamForVm(Vm vm)` Releases BW used by a VM.
    `abstract int` | `getAllocatedRamForVm(Vm vm)` Gets the allocated RAM for VM.
    `int` | `getAvailableRam()` Gets the available RAM in the host.
    `int` | `getRam()` Gets the ram.
    `int` | `getUsedRam()` Gets the amount of used RAM in the host.
    `abstract boolean` | `isSuitableForVm(Vm vm, int ram)` Checks if is suitable for vm.
    `protected void` | `setAvailableRam(int availableRam)` Sets the available ram.
    `protected void` | `setRam(int ram)` Sets the ram.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RamProvisioner

          public RamProvisioner(int ram)

      Creates the new RamProvisioner.
      Parameters:
        `ram` - the ram

  - ### Method Detail

    - #### allocateRamForVm

          public abstract boolean allocateRamForVm(Vm vm,
                                 int ram)

      Allocates RAM for a given VM.
      Parameters:
        `vm` - virtual machine for which the RAM are being allocated
        `ram` - the RAM
      Returns:
        $true if the RAM could be allocated; $false otherwise

    - #### getAllocatedRamForVm

          public abstract int getAllocatedRamForVm(Vm vm)

      Gets the allocated RAM for VM.
      Parameters:
        `vm` - the VM
      Returns:
        the allocated RAM for vm

    - #### deallocateRamForVm

          public abstract void deallocateRamForVm(Vm vm)

      Releases BW used by a VM.
      Parameters:
        `vm` - the vm

    - #### deallocateRamForAllVms

          public void deallocateRamForAllVms()

      Releases BW used by a all VMs.

    - #### isSuitableForVm

          public abstract boolean isSuitableForVm(Vm vm,
                                int ram)

      Checks if is suitable for vm.
      Parameters:
        `vm` - the vm
        `ram` - the ram
      Returns:
        true, if is suitable for vm

    - #### getRam

          public int getRam()

      Gets the ram.
      Returns:
        the ram

    - #### setRam

          protected void setRam(int ram)

      Sets the ram.
      Parameters:
        `ram` - the ram to set

    - #### getUsedRam

          public int getUsedRam()

      Gets the amount of used RAM in the host.
      Returns:
        used ram

    - #### getAvailableRam

          public int getAvailableRam()

      Gets the available RAM in the host.
      Returns:
        available ram

    - #### setAvailableRam

          protected void setAvailableRam(int availableRam)

      Sets the available ram.
      Parameters:
        `availableRam` - the availableRam to set

Copyright © 2013 The Cloud Computing and Distributed Systems (CLOUDS) Laboratory, The University of Melbourne. All Rights Reserved.