Class VM


  • public class VM
    extends Host
    • Constructor Detail

      • VM

        public VM​(Host host,
                  java.lang.String name)
        Create a `basic' VM : 1 core and 1GB of RAM.
        Parameters:
        host - Host node
        name - name of the machine
      • VM

        public VM​(Host host,
                  java.lang.String name,
                  int coreAmount)
        Create a VM without useless values (for humans)
        Parameters:
        host - Host node
        name - name of the machine
        coreAmount - the amount of cores of the VM
      • VM

        public VM​(Host host,
                  java.lang.String name,
                  int ramSize,
                  int migNetSpeed,
                  int dpIntensity)
        Create a VM with 1 core
        Parameters:
        host - Host node
        name - name of the machine
        ramSize - size of the RAM that should be allocated (in MBytes)
        migNetSpeed - (network bandwith allocated for migrations in MB/s, if you don't know put zero ;))
        dpIntensity - (dirty page percentage according to migNetSpeed, [0-100], if you don't know put zero ;))
      • VM

        public VM​(Host host,
                  java.lang.String name,
                  int coreAmount,
                  int ramSize,
                  int migNetSpeed,
                  int dpIntensity)
        Create a VM
        Parameters:
        host - Host node
        name - name of the machine
        coreAmount - the amount of cores of the VM
        ramSize - size of the RAM that should be allocated (in MBytes)
        migNetSpeed - (network bandwith allocated for migrations in MB/s, if you don't know put zero ;))
        dpIntensity - (dirty page percentage according to migNetSpeed, [0-100], if you don't know put zero ;))
    • Method Detail

      • all

        public static VM[] all()
        Retrieve the list of all existing VMs
      • getVMByName

        public static VM getVMByName​(java.lang.String name)
        Retrieve a VM from its name
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • isCreated

        public int isCreated()
        Returns whether the given VM is currently suspended
      • isRunning

        public int isRunning()
        Returns whether the given VM is currently running
      • isMigrating

        public int isMigrating()
        Returns whether the given VM is currently running
      • isSuspended

        public int isSuspended()
        Returns whether the given VM is currently suspended
      • getCoreAmount

        public int getCoreAmount()
        Returns the amount of virtual CPUs provided
      • setBound

        public void setBound​(double bound)
        Set a CPU bound for a given VM.
        Parameters:
        bound - in flops/s
      • start

        public void start()
        start the VM
      • shutdown

        public void shutdown()
        Immediately kills all processes within the given VM. No extra delay occurs. If you want to simulate this too, you want to use a MSG_process_sleep()
      • destroy

        public void destroy()
        Shutdown and unref the VM.
      • suspend

        public void suspend()
        Immediately suspend the execution of all processes within the given VM No suspension cost occurs. If you want to simulate this too, you want to use a @ref File.write() before or after, depending on the exact semantic of VM suspend to you.
      • resume

        public void resume()
        Immediately resumes the execution of all processes within the given VM No resume cost occurs. If you want to simulate this too, you want to use a @ref File.read() before or after, depending on the exact semantic of VM resume to you.