From: Arnaud Giersch Date: Sat, 8 Feb 2014 22:07:52 +0000 (+0100) Subject: java-cloud-migration: destroy VMs at the end of the simulation. X-Git-Tag: v3_11_beta~67 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d7095601326e9f975036cc71a61f433229f1e296 java-cloud-migration: destroy VMs at the end of the simulation. --- diff --git a/examples/java/cloud/migration/Test.java b/examples/java/cloud/migration/Test.java index ef7836ab1b..d06e78ec7e 100644 --- a/examples/java/cloud/migration/Test.java +++ b/examples/java/cloud/migration/Test.java @@ -8,6 +8,8 @@ package cloud.migration; import org.simgrid.msg.*; import org.simgrid.msg.Process; +import java.util.ArrayList; +import java.util.List; public class Test extends Process{ @@ -31,6 +33,8 @@ public class Test extends Process{ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } + List vms = new ArrayList(); + /* Create VM1 */ int dpRate = 70; int load1 = 90; @@ -48,8 +52,7 @@ public class Test extends Process{ 125, // Net bandwidth, dpRate // Memory intensity ); - - + vms.add(vm1); vm1.start(); /* Collocated VMs */ @@ -76,6 +79,7 @@ public class Test extends Process{ 125, // Net bandwidth, dpRate // Memory intensity ); + vms.add(tmp); tmp.start(); tmp.setLoad(vmSrcLoad[i-1]); } @@ -102,14 +106,11 @@ public class Test extends Process{ 125, // Net bandwidth, dpRate // Memory intensity ); + vms.add(tmp); tmp.start(); tmp.setLoad(vmDstLoad[i-1]); } - - - - Msg.info("Round trip of VM1 (load "+load1+"%)"); vm1.setLoad(load1); Msg.info(" - Launch migration from host 0 to host 1"); @@ -138,5 +139,8 @@ public class Test extends Process{ waitFor(100000); Main.setEndOfTest(); + Msg.info("Destroy VMs"); + for (VM vm: vms) + vm.destroy(); } }