1 class org.simgrid.msg.VM
2 ========================
4 .. java:package:: org.simgrid.msg
7 .. java:type:: public class VM extends Host
14 .. java:constructor:: public VM(Host host, String name)
17 Create a `basic` VM : 1 core and 1GB of RAM.
19 :param host: Host node
20 :param name: name of the machine
25 .. java:constructor:: public VM(Host host, String name, int coreAmount)
28 Create a VM without useless values (for humans)
30 :param host: Host node
31 :param name: name of the machine
32 :param coreAmount: the amount of cores of the VM
37 .. java:constructor:: public VM(Host host, String name, int ramSize, int migNetSpeed, int dpIntensity)
40 Create a VM with 1 core
42 :param host: Host node
43 :param name: name of the machine
44 :param ramSize: size of the RAM that should be allocated (in MBytes)
45 :param migNetSpeed: (network bandwidth allocated for migrations in MB/s, if you don't know put zero ;))
46 :param dpIntensity: (dirty page percentage according to migNetSpeed, [0-100], if you don't know put zero ;))
51 .. java:constructor:: public VM(Host host, String name, int coreAmount, int ramSize, int migNetSpeed, int dpIntensity)
56 :param host: Host node
57 :param name: name of the machine
58 :param coreAmount: the amount of cores of the VM
59 :param ramSize: size of the RAM that should be allocated (in MBytes)
60 :param migNetSpeed: (network bandwidth allocated for migrations in MB/s, if you don't know put zero ;))
61 :param dpIntensity: (dirty page percentage according to migNetSpeed, [0-100], if you don't know put zero ;))
68 .. java:method:: public static native VM[] all()
71 Retrieve the list of all existing VMs
76 .. java:method:: public native void destroy()
79 Shutdown and unref the VM.
84 .. java:method:: @Deprecated @Override protected void finalize() throws Throwable
87 Make sure that the GC also destroys the C object
92 .. java:method:: public int getCoreAmount()
95 Returns the amount of virtual CPUs provided
100 .. java:method:: public static native VM getVMByName(String name)
103 Retrieve a VM from its name
108 .. java:method:: public native int isCreated()
111 Returns whether the given VM is currently suspended
116 .. java:method:: public native int isMigrating()
119 Returns whether the given VM is currently running
124 .. java:method:: public native int isRunning()
127 Returns whether the given VM is currently running
132 .. java:method:: public native int isSuspended()
135 Returns whether the given VM is currently suspended
140 .. java:method:: public void migrate(Host destination) throws HostFailureException
143 Change the host on which all processes are running (pre-copy is implemented)
148 .. java:method:: public native void resume()
151 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.
156 .. java:method:: public native void setBound(double bound)
159 Set a CPU bound for a given VM.
161 :param bound: in flops/s
166 .. java:method:: public native void shutdown()
169 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()
174 .. java:method:: public native void start()
182 .. java:method:: public native void suspend()
185 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.