1 import org.simgrid.msg.Host;
2 import org.simgrid.msg.HostNotFoundException;
3 import org.simgrid.msg.Msg;
4 import org.simgrid.msg.VM;
7 * A stupid VM extension to associate a daemon to the VM
9 public class XVM extends VM {
12 private int dpIntensity;
15 private int currentLoad;
17 private Daemon daemon;
19 public XVM(Host host, String name,
20 int nbCores, int ramsize, int netBW, String diskPath, int diskSize, int migNetBW, int dpIntensity){
21 super(host, name, nbCores, ramsize, netBW, diskPath, diskSize, (int)(migNetBW*0.9), dpIntensity);
24 this. dpIntensity = dpIntensity ;
25 this.ramsize= ramsize;
26 this.daemon = new Daemon(this, 100);
30 public void setLoad(int load){
33 // this.getDaemon().setLoad(load);
46 } catch (HostNotFoundException e) {
52 public Daemon getDaemon(){
56 System.out.println("Remaining comp:" + this.daemon.getRemaining());
57 return this.currentLoad;
60 public void migrate(Host host){
61 Msg.info("Start migration of VM " + this.getName() + " to " + host.getName());
62 Msg.info(" currentLoad:" + this.currentLoad + "/ramSize:" + this.ramsize + "/dpIntensity:" + this.dpIntensity + "/remaining:" + this.daemon.getRemaining());
64 this.setLoad(this.currentLoad); //Fixed the fact that setBound is not propagated to the new node.
65 Msg.info("End of migration of VM " + this.getName() + " to node " + host.getName());