S4U_VirtualMachine.h
1 
11 #ifndef WRENCH_S4U_VIRTUALMACHINE_H
12 #define WRENCH_S4U_VIRTUALMACHINE_H
13 
14 #include <simgrid/s4u/VirtualMachine.hpp>
15 #include <set>
16 
17 namespace wrench {
18 
19  /***********************/
21  /***********************/
22 
27 
28  public:
29 
31  enum State {
32  DOWN,
33  RUNNING,
34  SUSPENDED
35  };
36 
37  S4U_VirtualMachine(const std::string &vm_hostname,
38  unsigned long num_cores,
39  double ram_memory,
40  std::map<std::string, std::string> property_list,
41  std::map<std::string, double> messagepayload_list);
42 
43  void start(std::string &pm_name);
44 
45  void suspend();
46 
47  void resume();
48 
49  void shutdown();
50 
51  void migrate(const std::string &dst_pm_name);
52 
53 
54  std::string getPhysicalHostname();
55  unsigned long getNumCores();
56  double getMemory();
57  std::map<std::string, std::string> getPropertyList();
58  std::map<std::string, double> getMessagePayloadList();
59 
60  State getState();
61  std::string getStateAsString();
62 
63 
64  private:
65  State state;
66  std::string vm_name;
67  simgrid::s4u::VirtualMachine *vm;
68  unsigned long num_cores;
69  double ram_memory;
70  std::string pm_name;
71  std::map<std::string, std::string> property_list;
72  std::map<std::string, double> messagepayload_list;
73  };
74 
75  /***********************/
77  /***********************/
78 }
79 
80 #endif //WRENCH_S4U_VIRTUALMACHINE_H
unsigned long getNumCores()
Get the number of cores.
Definition: S4U_VirtualMachine.cpp:59
std::map< std::string, double > getMessagePayloadList()
Get the message payload list for the BareMetalComputeService that will run on the VM ({} means "use a...
Definition: S4U_VirtualMachine.cpp:186
std::string getPhysicalHostname()
Get the physical hostname.
Definition: S4U_VirtualMachine.cpp:46
void suspend()
Suspend the VM.
Definition: S4U_VirtualMachine.cpp:98
double getMemory()
Get the memory consumption.
Definition: S4U_VirtualMachine.cpp:67
void start(std::string &pm_name)
Start the VM.
Definition: S4U_VirtualMachine.cpp:75
Definition: Alarm.cpp:20
std::string getStateAsString()
Get the VM's state as a string.
Definition: S4U_VirtualMachine.cpp:145
State
VM state enum.
Definition: S4U_VirtualMachine.h:31
void migrate(const std::string &dst_pm_name)
Migrate the VM.
Definition: S4U_VirtualMachine.cpp:162
State getState()
Get the VM's state.
Definition: S4U_VirtualMachine.cpp:137
A wrapper for the simgrid::s4u::VirtualMachine class.
Definition: S4U_VirtualMachine.h:26
S4U_VirtualMachine(const std::string &vm_hostname, unsigned long num_cores, double ram_memory, std::map< std::string, std::string > property_list, std::map< std::string, double > messagepayload_list)
Constructor.
Definition: S4U_VirtualMachine.cpp:32
void shutdown()
Shutdown the VM.
Definition: S4U_VirtualMachine.cpp:122
void resume()
Resume the VM.
Definition: S4U_VirtualMachine.cpp:110
std::map< std::string, std::string > getPropertyList()
Get the property list for the BareMetalComputeService that is to run on the VM ({} means "use all def...
Definition: S4U_VirtualMachine.cpp:178