Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add hosts test before migrating a VM - adrien
authorAdrien Lebre <alebre@adsein-4.local>
Wed, 8 Apr 2015 09:24:38 +0000 (11:24 +0200)
committerAdrien Lebre <alebre@adsein-4.local>
Wed, 8 Apr 2015 09:24:38 +0000 (11:24 +0200)
src/bindings/java/org/simgrid/msg/VM.java
src/msg/msg_vm.c

index b858c49..ac8a512 100644 (file)
@@ -158,7 +158,7 @@ public class VM extends Host{
                try {
                        this.internalmig(destination);
                } catch (Exception e){
-                 Msg.info("an exception occurs during the migration of VM "+this.getName());
+                 Msg.info("Migration of VM "+this.getName()+" to "+destination.getName()+" is impossible ("+e.getMessage()+")");
                  throw new HostFailureException();
                }
                // If the migration correcly returned, then we should change the currentHost value. 
index 4d83a7d..9bc7ab0 100644 (file)
@@ -975,6 +975,12 @@ void MSG_vm_migrate(msg_vm_t vm, msg_host_t new_pm)
 
   msg_host_t old_pm = simcall_vm_get_pm(vm);
 
+  if(!MSG_host_is_off(old_pm))
+    THROWF(vm_error, 0, "SRC host(%s) seems off, cannot start a migration", sg_host_name(old_pm));
+  if(!MSG_host_is_off(new_pm))
+    THROWF(vm_error, 0, "DST host(%s) seems off, cannot start a migration", sg_host_name(new_pm));
+  
   if (!MSG_vm_is_running(vm))
     THROWF(vm_error, 0, "VM(%s) is not running", sg_host_name(vm));