SimGrid  3.13
Versatile Simulation of Distributed Systems
msg_vm.cpp File Reference
#include "msg_private.h"
#include "xbt/sysdep.h"
#include "xbt/log.h"
#include "simgrid/host.h"

Classes

struct  migration_session
 

Macros

#define MIGRATION_TIMEOUT_DO_NOT_HARDCODE_ME   10000000.0
 

Functions

 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (msg_vm, msg,"Cloud-oriented parts of the MSG API")
 
const char * MSG_vm_get_property_value (msg_vm_t vm, const char *name)
 Returns the value of a given vm property. More...
 
xbt_dict_t MSG_vm_get_properties (msg_vm_t vm)
 Returns a xbt_dict_t consisting of the list of properties assigned to this host. More...
 
void MSG_vm_set_property_value (msg_vm_t vm, const char *name, void *value, void_f_pvoid_t free_ctn)
 Change the value of a given host property. More...
 
msg_vm_t MSG_vm_get_by_name (const char *name)
 Finds a msg_vm_t using its name. More...
 
const char * MSG_vm_get_name (msg_vm_t vm)
 Return the name of the msg_host_t. More...
 
static int __MSG_vm_is_state (msg_vm_t vm, e_surf_vm_state_t state)
 
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...
 
static char * get_mig_mbox_src_dst (msg_vm_t vm, msg_host_t src_pm, msg_host_t dst_pm)
 
static char * get_mig_mbox_ctl (msg_vm_t vm, msg_host_t src_pm, msg_host_t dst_pm)
 
static char * get_mig_process_tx_name (msg_vm_t vm, msg_host_t src_pm, msg_host_t dst_pm)
 
static char * get_mig_process_rx_name (msg_vm_t vm, msg_host_t src_pm, msg_host_t dst_pm)
 
static char * get_mig_task_name (msg_vm_t vm, msg_host_t src_pm, msg_host_t dst_pm, int stage)
 
static int migration_rx_fun (int argc, char *argv[])
 
static void reset_dirty_pages (msg_vm_t vm)
 
static void start_dirty_page_tracking (msg_vm_t vm)
 
static void stop_dirty_page_tracking (msg_vm_t vm)
 
static double get_computed (char *key, msg_vm_t vm, dirty_page_t dp, double remaining, double clock)
 
static double lookup_computed_flop_counts (msg_vm_t vm, int stage_for_fancy_debug, int stage2_round_for_fancy_debug)
 
void MSG_host_add_task (msg_host_t host, msg_task_t task)
 
void MSG_host_del_task (msg_host_t host, msg_task_t task)
 
static sg_size_t send_migration_data (msg_vm_t vm, msg_host_t src_pm, msg_host_t dst_pm, sg_size_t size, char *mbox, int stage, int stage2_round, double mig_speed, double timeout)
 
static sg_size_t get_updated_size (double computed, double dp_rate, double dp_cap)
 
static double send_stage1 (struct migration_session *ms, sg_size_t ramsize, double mig_speed, double dp_rate, double dp_cap)
 
static double get_threshold_value (double bandwidth, double max_downtime)
 
static int migration_tx_fun (int argc, char *argv[])
 
static int do_migration (msg_vm_t vm, msg_host_t src_pm, msg_host_t dst_pm)
 
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...
 

Macro Definition Documentation

#define MIGRATION_TIMEOUT_DO_NOT_HARDCODE_ME   10000000.0

Function Documentation

XBT_LOG_NEW_DEFAULT_SUBCATEGORY ( msg_vm  ,
msg  ,
"Cloud-oriented parts of the MSG API"   
)
const char* MSG_vm_get_property_value ( msg_vm_t  vm,
const char *  name 
)

Returns the value of a given vm property.

Parameters
vma vm
namea property name
Returns
value of a property (or NULL if property not set)
xbt_dict_t MSG_vm_get_properties ( msg_vm_t  vm)

Returns a xbt_dict_t consisting of the list of properties assigned to this host.

Parameters
vma vm
Returns
a dict containing the properties
msg_vm_t MSG_vm_get_by_name ( const char *  name)

Finds a msg_vm_t using its name.

This is a name directory service

Parameters
namethe name of a vm.
Returns
the corresponding vm

Please note that a VM is a specific host. Hence, you should give a different name for each VM/PM.

const char* MSG_vm_get_name ( msg_vm_t  vm)

Return the name of the msg_host_t.

This functions checks whether host is a valid pointer or not and return its name.

static int __MSG_vm_is_state ( msg_vm_t  vm,
e_surf_vm_state_t  state 
)
inlinestatic
static char* get_mig_mbox_src_dst ( msg_vm_t  vm,
msg_host_t  src_pm,
msg_host_t  dst_pm 
)
inlinestatic
static char* get_mig_mbox_ctl ( msg_vm_t  vm,
msg_host_t  src_pm,
msg_host_t  dst_pm 
)
inlinestatic
static char* get_mig_process_tx_name ( msg_vm_t  vm,
msg_host_t  src_pm,
msg_host_t  dst_pm 
)
inlinestatic
static char* get_mig_process_rx_name ( msg_vm_t  vm,
msg_host_t  src_pm,
msg_host_t  dst_pm 
)
inlinestatic
static char* get_mig_task_name ( msg_vm_t  vm,
msg_host_t  src_pm,
msg_host_t  dst_pm,
int  stage 
)
inlinestatic
static int migration_rx_fun ( int  argc,
char *  argv[] 
)
static
static void reset_dirty_pages ( msg_vm_t  vm)
static
static void start_dirty_page_tracking ( msg_vm_t  vm)
static
static void stop_dirty_page_tracking ( msg_vm_t  vm)
static
static double get_computed ( char *  key,
msg_vm_t  vm,
dirty_page_t  dp,
double  remaining,
double  clock 
)
static
static double lookup_computed_flop_counts ( msg_vm_t  vm,
int  stage_for_fancy_debug,
int  stage2_round_for_fancy_debug 
)
static
void MSG_host_add_task ( msg_host_t  host,
msg_task_t  task 
)
void MSG_host_del_task ( msg_host_t  host,
msg_task_t  task 
)
static sg_size_t send_migration_data ( msg_vm_t  vm,
msg_host_t  src_pm,
msg_host_t  dst_pm,
sg_size_t  size,
char *  mbox,
int  stage,
int  stage2_round,
double  mig_speed,
double  timeout 
)
static
static sg_size_t get_updated_size ( double  computed,
double  dp_rate,
double  dp_cap 
)
static
static double send_stage1 ( struct migration_session ms,
sg_size_t  ramsize,
double  mig_speed,
double  dp_rate,
double  dp_cap 
)
static
static double get_threshold_value ( double  bandwidth,
double  max_downtime 
)
static
static int migration_tx_fun ( int  argc,
char *  argv[] 
)
static
static int do_migration ( msg_vm_t  vm,
msg_host_t  src_pm,
msg_host_t  dst_pm 
)
static