Package org.simgrid.msg
Class VM
- java.lang.Object
-
- org.simgrid.msg.Host
-
- org.simgrid.msg.VM
-
public class VM extends Host
-
-
Constructor Summary
Constructors Constructor Description VM(Host host, java.lang.String name)Create a `basic' VM : 1 core and 1GB of RAM.VM(Host host, java.lang.String name, int coreAmount)Create a VM without useless values (for humans)VM(Host host, java.lang.String name, int ramSize, int migNetSpeed, int dpIntensity)Create a VM with 1 coreVM(Host host, java.lang.String name, int coreAmount, int ramSize, int migNetSpeed, int dpIntensity)Create a VM
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VM[]all()Retrieve the list of all existing VMsvoiddestroy()Shutdown and unref the VM.protected voidfinalize()intgetCoreAmount()Returns the amount of virtual CPUs providedstatic VMgetVMByName(java.lang.String name)Retrieve a VM from its nameintisCreated()Returns whether the given VM is currently suspendedintisMigrating()Returns whether the given VM is currently runningintisRunning()Returns whether the given VM is currently runningintisSuspended()Returns whether the given VM is currently suspendedvoidmigrate(Host destination)Change the host on which all processes are running (pre-copy is implemented)voidresume()Immediately resumes the execution of all processes within the given VM No resume cost occurs.voidsetBound(double bound)Set a CPU bound for a given VM.voidshutdown()Immediately kills all processes within the given VM.voidstart()start the VMvoidsuspend()Immediately suspend the execution of all processes within the given VM No suspension cost occurs.-
Methods inherited from class org.simgrid.msg.Host
currentHost, getAttachedStorage, getByName, getConsumedEnergy, getCoreNumber, getCount, getCurrentPowerPeak, getData, getMountedStorage, getName, getPowerPeakAt, getProperty, getPstate, getPstatesCount, getSpeed, hasData, isOn, off, on, setAsyncMailbox, setData, setProperty, setPstate, toString, updateAllEnergyConsumptions
-
-
-
-
Constructor Detail
-
VM
public VM(Host host, java.lang.String name)
Create a `basic' VM : 1 core and 1GB of RAM.- Parameters:
host- Host nodename- 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 nodename- name of the machinecoreAmount- 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 nodename- name of the machineramSize- 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 nodename- name of the machinecoreAmount- the amount of cores of the VMramSize- 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:
finalizein classjava.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.
-
migrate
public void migrate(Host destination) throws HostFailureException
Change the host on which all processes are running (pre-copy is implemented)- Throws:
HostFailureException
-
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.
-
-