WRENCH  1.10
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
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 
26  class S4U_VirtualMachine {
27 
28  public:
29 
33  static std::unordered_map<std::string, std::string> vm_to_pm_map;
34 
36  enum State {
37  DOWN,
38  RUNNING,
39  SUSPENDED
40  };
41 
42  S4U_VirtualMachine(const std::string &vm_hostname,
43  unsigned long num_cores,
44  double ram_memory,
45  std::map<std::string, std::string> property_list,
46  std::map<std::string, double> messagepayload_list);
47 
48  void start(std::string &pm_name);
49 
50  void suspend();
51 
52  void resume();
53 
54  void shutdown();
55 
56  void migrate(const std::string &dst_pm_name);
57 
58  std::string getPhysicalHostname();
59  unsigned long getNumCores();
60  double getMemory();
61  std::map<std::string, std::string> getPropertyList();
62  std::map<std::string, double> getMessagePayloadList();
63 
64  State getState();
65  std::string getStateAsString();
66 
67 
68  private:
69  State state;
70  std::string vm_name;
71  simgrid::s4u::VirtualMachine *vm;
72  unsigned long num_cores;
73  double ram_memory;
74  std::string pm_name;
75  std::map<std::string, std::string> property_list;
76  std::map<std::string, double> messagepayload_list;
77  };
78 
79  /***********************/
81  /***********************/
82 }
83 
84 #endif //WRENCH_S4U_VIRTUALMACHINE_H
wrench
Definition: Alarm.cpp:20