public class XHost
extends java.lang.Object
Constructor and Description |
---|
XHost(org.simgrid.msg.Host h,
int memSize,
int ncores,
int totalCPUCapa,
int netBW,
java.lang.String ip)
Constructor
Please note that by default a XHOST is off (you should invoke turnOn)
|
Modifier and Type | Method and Description |
---|---|
double |
computeCPUDemand() |
int |
getCPUCapacity() |
double |
getCPUDemand() |
java.lang.String |
getIP() |
int |
getMemDemand() |
int |
getMemSize() |
java.lang.String |
getName() |
int |
getNbCores() |
int |
getNbOfViolations() |
int |
getNbVMs() |
int |
getNetBW() |
java.util.Collection<XVM> |
getRunnings() |
org.simgrid.msg.Host |
getSGHost() |
int |
getTurnOffNb() |
java.util.Collection<XVM> |
getVMs() |
void |
incViolation()
Increment the number of violations
|
boolean |
isOff() |
boolean |
isOn() |
boolean |
isOnGoingMigration()
Ugly patch to prevent migration crash when a node is switched off
TODO this code should be removed and the migration should be robust
|
boolean |
isViable()
check whether a pm is viable or not (currently only for the CPU dimension)
|
int |
migrate(java.lang.String vmName,
XHost dest)
Migrate the vm vmName from this host to the dest one.
|
int |
resumeVM(XVM vm) |
void |
setCPUDemand(double newDemand) |
void |
setOnGoingMigration(boolean onGoingMigration)
Ugly patch to prevent migration crash when a node is switched off
TODO this code should be removed and the migration should be robust
|
void |
start(XVM sgVM)
Link the VM to the host and start it
|
int |
suspendVM(XVM vm) |
void |
turnOff()
turnOff a host (the host should be off, otherwise nothing happens)
|
void |
turnOn()
Turn on a host (the host should have been turn off previously), otherwise nothing happens
|
public XHost(org.simgrid.msg.Host h, int memSize, int ncores, int totalCPUCapa, int netBW, java.lang.String ip)
h
- MSG host to extendmemSize
- the size of the memory of the host (rigid value, once it has been assigned it does not change)ncores
- the number of cores available on the hosttotalCPUCapa
- the total cpu capacity of the hostnetBW
- the network bandwidth of the hostip
- the ip of the hostpublic org.simgrid.msg.Host getSGHost()
public java.util.Collection<XVM> getVMs()
public int getMemSize()
public int getCPUCapacity()
public int getNbCores()
public int getNetBW()
public java.lang.String getIP()
public boolean isViable()
public double computeCPUDemand()
public double getCPUDemand()
public void setCPUDemand(double newDemand)
public int getMemDemand()
public void start(XVM sgVM)
sgVM
- public int migrate(java.lang.String vmName, XHost dest)
vmName
- dest
- public int suspendVM(XVM vm)
vm
- public int resumeVM(XVM vm)
vm
- public java.lang.String getName()
public java.util.Collection<XVM> getRunnings()
public int getNbVMs()
public void turnOff()
public void turnOn()
public boolean isOff()
public boolean isOn()
public int getTurnOffNb()
public int getNbOfViolations()
public void incViolation()
public boolean isOnGoingMigration()
public void setOnGoingMigration(boolean onGoingMigration)