public class SimulatorManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
iResume |
static int |
iSuspend |
static java.util.HashMap<java.lang.String,XVM> |
sgVMsToSuspend
The list of XVMs that should be suspend (right now, it is impossible to suspend VMs that are currently migrated)
This collection is used to suspend VMs after the completion of the migration process.
|
Constructor and Description |
---|
SimulatorManager() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanLog()
Remove all logs from the previous run
|
static double |
computeCPUDemand() |
static void |
configureHostsAndVMs(int nbOfHostingHosts,
int nbOfServiceHosts,
int nbOfVMs,
boolean balance)
Create and assign the VMs on the different hosts.
|
static void |
finalizeSimulation() |
static double |
getCPUDemand() |
static java.lang.String |
getInjectorNodeName() |
static int |
getNbOfUsedHosts() |
static java.util.Collection<XHost> |
getSGHostingHosts() |
static java.util.Collection<XHost> |
getSGHosts() |
static XHost[] |
getSGHostsToArray() |
static java.util.Collection<XHost> |
getSGServiceHosts() |
static java.util.Collection<XHost> |
getSGTurnOffHostingHosts() |
static java.util.Collection<XHost> |
getSGTurnOnHostingHosts() |
static java.util.Collection<XVM> |
getSGVMs() |
static java.util.Collection<XVM> |
getSGVMsOff() |
static java.util.Collection<XVM> |
getSGVMsOn() |
static XVM[] |
getSGVMsToArray() |
static double |
getSimulationDuration()
Stupid variable to monitor the duration of the simulation
|
static XHost |
getXHostByName(java.lang.String name)
Return the XHost entitled ''name'', if not return null (please note that the search is performed by considering
all hosts (i.e.
|
static XVM |
getXVMByName(java.lang.String name)
Return the XVM entitled ''name'', if not return null please note that the search is performed by considering
all VMs (i.e.
|
static void |
initHosts(int nbOfHostingHosts,
int nbOfServiceHosts)
For each MSG host (but the service node), the function creates an associated XHost.
|
static boolean |
isEndOfInjection() |
static boolean |
isSchedulerActive() |
static boolean |
isViable() |
static boolean |
migrateVM(java.lang.String vmName,
java.lang.String sourceName,
java.lang.String destName)
Migrate a VM
|
static boolean |
resumeVM(java.lang.String vmName,
java.lang.String hostName) |
static void |
setBeginTimeOfSimulation(double beginTimeOfSimulation)
Stupid variable to monitor the duration of the simulation
|
static void |
setEndOfInjection()
When the injection is complete, we turn the endOfInjection boolean to true and kill the running daemon inside each VM
|
static void |
setEndTimeOfSimulation(double endTimeOfSimulation)
Stupid variable to monitor the duration of the simulation
|
static void |
setSchedulerActive(boolean val) |
static boolean |
suspendVM(java.lang.String vmName,
java.lang.String hostName) |
static void |
turnOff(XHost host)
Turn off the XHost host
|
static void |
turnOn(XHost host)
Turn on the XHost host
|
static void |
updateVM(XVM sgVM,
double load)
Change the load of a VM.
|
static boolean |
willItBeViableWith(XVM sgVM,
int load) |
static void |
writeCurrentConfiguration()
write the current configuration in the ''logs/simulatorManager/'' directory
|
static void |
writeEnergy(java.lang.String logPath) |
public static boolean isSchedulerActive()
public static void setSchedulerActive(boolean val)
public static void setEndOfInjection()
public static void finalizeSimulation()
public static boolean isEndOfInjection()
public static java.util.Collection<XVM> getSGVMs()
public static java.util.Collection<XVM> getSGVMsOn()
public static java.util.Collection<XVM> getSGVMsOff()
public static java.util.Collection<XHost> getSGHosts()
public static XHost[] getSGHostsToArray()
public static XVM[] getSGVMsToArray()
public static java.util.Collection<XHost> getSGHostingHosts()
public static java.util.Collection<XHost> getSGTurnOnHostingHosts()
public static java.util.Collection<XHost> getSGTurnOffHostingHosts()
public static java.util.Collection<XHost> getSGServiceHosts()
public static java.lang.String getInjectorNodeName()
public static void initHosts(int nbOfHostingHosts, int nbOfServiceHosts)
nbOfHostingHosts
- the number of hosts that will be used to host VMsnbOfServiceHosts
- the number of hosts that will be used to host servicespublic static void configureHostsAndVMs(int nbOfHostingHosts, int nbOfServiceHosts, int nbOfVMs, boolean balance)
nbOfHostingHosts
- the number of the hosts composing the infrastructurenbOfServiceHosts
- the number of the hosts composing the infrastructurenbOfVMs
- the number of the VMs to instanciatepublic static void writeCurrentConfiguration()
public static void cleanLog()
public static boolean isViable()
public static double computeCPUDemand()
public static double getCPUDemand()
public static int getNbOfUsedHosts()
public static XHost getXHostByName(java.lang.String name)
name
- the name of the host requestedpublic static XVM getXVMByName(java.lang.String name)
name
- the name of the vm requestedpublic static void updateVM(XVM sgVM, double load)
sgVM
- the VM that should be updatedload
- the new expected loadpublic static boolean willItBeViableWith(XVM sgVM, int load)
public static void turnOn(XHost host)
host
- the host to turn onpublic static void turnOff(XHost host)
host
- the host to turn offpublic static void setBeginTimeOfSimulation(double beginTimeOfSimulation)
public static void setEndTimeOfSimulation(double endTimeOfSimulation)
public static double getSimulationDuration()
public static void writeEnergy(java.lang.String logPath)
public static boolean suspendVM(java.lang.String vmName, java.lang.String hostName)
public static boolean resumeVM(java.lang.String vmName, java.lang.String hostName)
public static boolean migrateVM(java.lang.String vmName, java.lang.String sourceName, java.lang.String destName)
vmName
- sourceName
- destName
-