SimGrid
3.13
Versatile Simulation of Distributed Systems
|
This section describes the interface created to mimic IaaS clouds. More...
Functions | |
int | MSG_vm_is_created (msg_vm_t) |
Opaque type describing a Virtual Machine. More... | |
int | MSG_vm_is_running (msg_vm_t vm) |
Returns whether the given VM is currently running. More... | |
int | MSG_vm_is_migrating (msg_vm_t vm) |
Returns whether the given VM is currently migrating. More... | |
int | MSG_vm_is_suspended (msg_vm_t vm) |
Returns whether the given VM is currently suspended, not running. More... | |
int | MSG_vm_is_saving (msg_vm_t vm) |
Returns whether the given VM is being saved (FIXME: live saving or not?). More... | |
int | MSG_vm_is_saved (msg_vm_t vm) |
Returns whether the given VM has been saved, not running. More... | |
int | MSG_vm_is_restoring (msg_vm_t vm) |
Returns whether the given VM is being restored, not running. More... | |
msg_vm_t | MSG_vm_create (msg_host_t pm, const char *name, int ncpus, int ramsize, int net_cap, char *disk_path, int disksize, int mig_netspeed, int dp_intensity) |
Create a new VM with specified parameters. More... | |
msg_vm_t | MSG_vm_create_core (msg_host_t ind_pm, const char *name) |
Create a new VM object. More... | |
void | MSG_vm_destroy (msg_vm_t vm) |
Destroy a VM. More... | |
void | MSG_vm_start (msg_vm_t vm) |
Start a vm (i.e., boot the guest operating system)If the VM cannot be started, an exception is generated. More... | |
void | MSG_vm_shutdown (msg_vm_t vm) |
Immediately kills all processes within the given VM. More... | |
void | MSG_vm_migrate (msg_vm_t vm, msg_host_t new_pm) |
Migrate the VM to the given host. More... | |
void | MSG_vm_suspend (msg_vm_t vm) |
Immediately suspend the execution of all processes within the given VM. More... | |
void | MSG_vm_resume (msg_vm_t vm) |
Resume the execution of the VM. More... | |
void | MSG_vm_save (msg_vm_t vm) |
Immediately save the execution of all processes within the given VM. More... | |
void | MSG_vm_restore (msg_vm_t vm) |
Restore the execution of the VM. More... | |
msg_host_t | MSG_vm_get_pm (msg_vm_t vm) |
Get the physical host of a given VM. More... | |
void | MSG_vm_set_bound (msg_vm_t vm, double bound) |
Set a CPU bound for a given VM. More... | |
void | MSG_vm_set_affinity (msg_vm_t vm, msg_host_t pm, unsigned long mask) |
Set the CPU affinity of a given VM. More... | |
This section describes the interface created to mimic IaaS clouds.
With it, you can create virtual machines to put your processes into, and interact directly with the VMs to manage groups of processes.
This interface is highly experimental at this point. Testing is welcomed, but do not expect too much of it right now. Even the interfaces may be changed in future releases of SimGrid (although things are expected to stabilize nicely before SimGrid v3.8). There is no guaranty on the rest of SimGrid, and there is less than that on this part.
int MSG_vm_is_created | ( | msg_vm_t | vm | ) |
Opaque type describing a Virtual Machine.
Returns whether the given VM has just created, not running.
All this is highly experimental and the interface will probably change in the future. Please don't depend on this yet (although testing is welcomed if you feel so). Usual lack of guaranty of any kind applies here, and is even increased.
int MSG_vm_is_running | ( | msg_vm_t | vm | ) |
Returns whether the given VM is currently running.
int MSG_vm_is_migrating | ( | msg_vm_t | vm | ) |
Returns whether the given VM is currently migrating.
int MSG_vm_is_suspended | ( | msg_vm_t | vm | ) |
Returns whether the given VM is currently suspended, not running.
int MSG_vm_is_saving | ( | msg_vm_t | vm | ) |
Returns whether the given VM is being saved (FIXME: live saving or not?).
int MSG_vm_is_saved | ( | msg_vm_t | vm | ) |
Returns whether the given VM has been saved, not running.
int MSG_vm_is_restoring | ( | msg_vm_t | vm | ) |
Returns whether the given VM is being restored, not running.
msg_vm_t MSG_vm_create | ( | msg_host_t | pm, |
const char * | name, | ||
int | ncpus, | ||
int | ramsize, | ||
int | net_cap, | ||
char * | disk_path, | ||
int | disksize, | ||
int | mig_netspeed, | ||
int | dp_intensity | ||
) |
Create a new VM with specified parameters.
pm | Physical machine that will host the VM |
name | [TODO] |
ncpus | [TODO] |
ramsize | [TODO] |
net_cap | Maximal bandwidth that the VM can consume (in MByte/s) |
disk_path | (unused) Path to the image that boots |
disksize | (unused) will represent the size of the VM (will be used during migrations) |
mig_netspeed | Amount of Mbyte/s allocated to the migration (cannot be larger than net_cap). Use 0 if unsure. |
dp_intensity | Dirty page percentage according to migNetSpeed, [0-100]. Use 0 if unsure. |
msg_vm_t MSG_vm_create_core | ( | msg_host_t | ind_pm, |
const char * | name | ||
) |
Create a new VM object.
The VM is not yet started. The resource of the VM is allocated upon MSG_vm_start().
Start a vm (i.e., boot the guest operating system)If the VM cannot be started, an exception is generated.
Immediately kills all processes within the given VM.
Any memory that they allocated will be leaked.
FIXME: No extra delay occurs. If you want to simulate this too, you want to use a MSG_process_sleep() or something. I'm not quite sure.
void MSG_vm_migrate | ( | msg_vm_t | vm, |
msg_host_t | new_pm | ||
) |
Migrate the VM to the given host.
FIXME: No migration cost occurs. If you want to simulate this too, you want to use a MSG_task_send() before or after, depending on whether you want to do cold or hot migration.
Immediately suspend the execution of all processes within the given VM.
This function stops the execution of the VM. All the processes on this VM will pause. The state of the VM is preserved. We can later resume it again.
No suspension cost occurs.
Resume the execution of the VM.
All processes on the VM run again.
No resume cost occurs.
Immediately save the execution of all processes within the given VM.
This function stops the execution of the VM. All the processes on this VM will pause. The state of the VM is preserved. We can later resume it again.
FIXME: No suspension cost occurs. If you want to simulate this too, you want to use a MSG_file_write() before or after, depending on the exact semantic of VM save to you.
Restore the execution of the VM.
All processes on the VM run again.
FIXME: No restore cost occurs. If you want to simulate this too, you want to use a MSG_file_read() before or after, depending on the exact semantic of VM restore to you.
msg_host_t MSG_vm_get_pm | ( | msg_vm_t | vm | ) |
Get the physical host of a given VM.
Set a CPU bound for a given VM.
For example, On PM0, there are Task1 and VM0. On VM0, there is Task2. Now we bound 75% to Task1@PM0 and bound 25% to Task2@VM0. Then, Task1@PM0 gets 50%. Task2@VM0 gets 25%. This is NOT 75% for Task1@PM0 and 25% for Task2@VM0, respectively.
This is because a VM has the dummy CPU action in the PM layer. Putting a task on the VM does not affect the bound of the dummy CPU action. The bound of the dummy CPU action is unlimited.
There are some solutions for this problem. One option is to update the bound of the dummy CPU action automatically. It should be the sum of all tasks on the VM. But, this solution might be costly, because we have to scan all tasks on the VM in share_resource() or we have to trap both the start and end of task execution.
The current solution is to use MSG_vm_set_bound(), which allows us to directly set the bound of the dummy CPU action.
void MSG_vm_set_affinity | ( | msg_vm_t | vm, |
msg_host_t | pm, | ||
unsigned long | mask | ||
) |
Set the CPU affinity of a given VM.
This function changes the CPU affinity of a given VM. Usage is the same as MSG_task_set_affinity(). See the MSG_task_set_affinity() for details.