WRENCH  1.11
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 #include <wrench/services/Service.h>
17 
18 
19 namespace wrench {
20 
21  /***********************/
23  /***********************/
24 
28  class S4U_VirtualMachine {
29 
30  public:
31 
35  static std::unordered_map<std::string,std::string> vm_to_pm_map;
36 
38  enum State {
39  DOWN,
40  RUNNING,
41  SUSPENDED
42  };
43 
44  S4U_VirtualMachine(const std::string &vm_hostname,
45  unsigned long num_cores,
46  double ram_memory,
47  WRENCH_PROPERTY_COLLECTION_TYPE property_list,
48  WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list);
49 
50  void start(std::string &pm_name);
51 
52  void suspend();
53 
54  void resume();
55 
56  void shutdown();
57 
58  void migrate(const std::string &dst_pm_name);
59 
60  std::string getPhysicalHostname();
61  unsigned long getNumCores();
62  double getMemory();
63  WRENCH_PROPERTY_COLLECTION_TYPE getPropertyList();
64  WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE getMessagePayloadList();
65 
66  State getState();
67  std::string getStateAsString();
68 
69 
70  private:
71  State state;
72  std::string vm_name;
73  simgrid::s4u::VirtualMachine *vm;
74  unsigned long num_cores;
75  double ram_memory;
76  std::string pm_name;
77  WRENCH_PROPERTY_COLLECTION_TYPE property_list;
78  WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list;
79  };
80 
81  /***********************/
83  /***********************/
84 }
85 
86 #endif //WRENCH_S4U_VIRTUALMACHINE_H
wrench
Definition: Action.cpp:28