/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
package cloud.masterworker;
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
package cloud.masterworker;
import org.simgrid.msg.Host;
import org.simgrid.msg.Msg;
import org.simgrid.msg.MsgException;
import org.simgrid.msg.Host;
import org.simgrid.msg.Msg;
import org.simgrid.msg.MsgException;
// Create one VM per host and bind a process inside each one.
for (int i = 0; i < workersCount; i++) {
Msg.verb("create VM0-s"+step+"-"+i);
VM vm = new VM(hosts[i+1],"VM0-s"+step+"-"+i);
vm.start();
// Create one VM per host and bind a process inside each one.
for (int i = 0; i < workersCount; i++) {
Msg.verb("create VM0-s"+step+"-"+i);
VM vm = new VM(hosts[i+1],"VM0-s"+step+"-"+i);
vm.start();
Worker worker= new Worker(vm,"WK:"+step+":"+ i);
Msg.verb("Put Worker "+worker.getName()+ " on "+vm.getName());
worker.start();
}
Worker worker= new Worker(vm,"WK:"+step+":"+ i);
Msg.verb("Put Worker "+worker.getName()+ " on "+vm.getName());
worker.start();
}
workBatch(workersCount,"WK:"+step+":");
Msg.info("Suspend all VMs, wait a while, resume them, migrate them and shut them down.");
workBatch(workersCount,"WK:"+step+":");
Msg.info("Suspend all VMs, wait a while, resume them, migrate them and shut them down.");
- for (int i = 0; i < vms.size(); i++) {
- Msg.verb("Migrate "+vms.get(i).getName()+" from "+hosts[i+1].getName()+"to "+hosts[3].getName());
- vms.get(i).migrate(hosts[3]);
+ for (VM vm : vms) {
+ Msg.verb("Migrate "+vm.getName()+" to "+hosts[3].getName());
+ vm.migrate(hosts[3]);