class org.simgrid.msg.VM

public class VM extends Host

Constructors

VM

public VM(Host host, 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, 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, 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, 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 ;))

Methods

all

public static native VM[] all()

Retrieve the list of all existing VMs

destroy

public native void destroy()

Shutdown and unref the VM.

finalize

protected void finalize()

getCoreAmount

public int getCoreAmount()

Returns the amount of virtual CPUs provided

getVMByName

public static native VM getVMByName(String name)

Retrieve a VM from its name

isCreated

public native int isCreated()

Returns whether the given VM is currently suspended

isMigrating

public native int isMigrating()

Returns whether the given VM is currently running

isRunning

public native int isRunning()

Returns whether the given VM is currently running

isSuspended

public native int isSuspended()

Returns whether the given VM is currently suspended

migrate

public void migrate(Host destination)

Change the host on which all processes are running (pre-copy is implemented)

resume

public native 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.

setBound

public native void setBound(double bound)

Set a CPU bound for a given VM.

Parameters:
  • bound – in flops/s

shutdown

public native 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()

start

public native void start()

start the VM

suspend

public native 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.