VirtualizedClusterService.h
1 
11 #ifndef WRENCH_VIRTUALIZEDCLUSTERSERVICE_H
12 #define WRENCH_VIRTUALIZEDCLUSTERSERVICE_H
13 
14 #include "wrench/services/compute/cloud/CloudService.h"
15 #include "wrench/services/compute/virtualized_cluster/VirtualizedClusterServiceProperty.h"
16 #include "wrench/services/compute/virtualized_cluster/VirtualizedClusterServiceMessagePayload.h"
17 
18 
19 namespace wrench {
20 
21  class Simulation;
22 
23  class ComputeService;
24 
29 
30  private:
31  std::map<std::string, std::string> default_property_values = {
33  };
34 
35  std::map<std::string, std::string> default_messagepayload_values = {
50  };
51 
52  public:
53  VirtualizedClusterService(const std::string &hostname,
54  std::vector<std::string> &execution_hosts,
55  double scratch_space_size,
56  std::map<std::string, std::string> property_list = {},
57  std::map<std::string, std::string> messagepayload_list = {});
58 
59  /***********************/
61  /***********************/
62 
63  using CloudService::createVM;
64 
65  virtual std::string createVM(const std::string &pm_hostname,
66  unsigned long num_cores = ComputeService::ALL_CORES,
67  double ram_memory = ComputeService::ALL_RAM,
68  std::map<std::string, std::string> property_list = {},
69  std::map<std::string, std::string> messagepayload_list = {});
70 
71  virtual bool migrateVM(const std::string &vm_hostname, const std::string &dest_pm_hostname);
72 
73  /***********************/
75  /***********************/
76 
77  protected:
78 
79  /***********************/
81  /***********************/
82 
83  friend class Simulation;
84 
85  int main() override;
86 
87  virtual bool processNextMessage() override;
88 
89  virtual void processMigrateVM(const std::string &answer_mailbox,
90  const std::string &vm_hostname,
91  const std::string &dest_pm_hostname);
92 
93  /***********************/
95  /***********************/
96  };
97 
98 }
99 
100 #endif //WRENCH_VIRTUALIZEDCLUSTERSERVICE_H
static const std::string MIGRATE_VM_ANSWER_MESSAGE_PAYLOAD
The number of bytes in the control message sent by the service in answer to a VM migration request...
Definition: VirtualizedClusterServiceMessagePayload.h:27
static const std::string STOP_DAEMON_MESSAGE_PAYLOAD
The number of bytes in the control message sent to the daemon to terminate it.
Definition: ServiceMessagePayload.h:31
static const std::string SUBMIT_PILOT_JOB_ANSWER_MESSAGE_PAYLOAD
The number of bytes in the control message sent from the daemon to acknowledge a pilot job submission...
Definition: ComputeServiceMessagePayload.h:40
static const std::string CREATE_VM_REQUEST_MESSAGE_PAYLOAD
The number of bytes in the control message sent to the service to request a VM creation.
Definition: CloudServiceMessagePayload.h:28
static const std::string SUBMIT_STANDARD_JOB_ANSWER_MESSAGE_PAYLOAD
The number of bytes in the control message sent by the daemon to acknowledge a standard job submissio...
Definition: ComputeServiceMessagePayload.h:28
static constexpr double ALL_RAM
A convenient constant to mean "use all ram of a physical host" whenever a ram capacity is needed when...
Definition: ComputeService.h:59
VirtualizedClusterService(const std::string &hostname, std::vector< std::string > &execution_hosts, double scratch_space_size, std::map< std::string, std::string > property_list={}, std::map< std::string, std::string > messagepayload_list={})
Constructor.
Definition: VirtualizedClusterService.cpp:38
static const std::string GET_EXECUTION_HOSTS_REQUEST_MESSAGE_PAYLOAD
The number of bytes in the control message sent to the service to request a get execution hosts...
Definition: CloudServiceMessagePayload.h:24
static constexpr unsigned long ALL_CORES
A convenient constant to mean "use all cores of a physical host" whenever a number of cores is needed...
Definition: ComputeService.h:54
A class that provides basic simulation methods.
Definition: Simulation.h:34
static const std::string CREATE_VM_ANSWER_MESSAGE_PAYLOAD
The number of bytes in the control message sent by the service in answer to a VM creation request...
Definition: CloudServiceMessagePayload.h:30
static const std::string SUBMIT_PILOT_JOB_REQUEST_MESSAGE_PAYLOAD
The number of bytes in the control message sent to the daemon to submit a pilot job.
Definition: ComputeServiceMessagePayload.h:38
static const std::string MIGRATE_VM_REQUEST_MESSAGE_PAYLOAD
The number of bytes in the control message sent to the service to request a VM migration.
Definition: VirtualizedClusterServiceMessagePayload.h:25
A cloud-based compute service that manages a set of physical hosts and controls access to their resou...
Definition: CloudService.h:37
A virtualized cluster-based compute service.
Definition: VirtualizedClusterService.h:28
static const std::string RESOURCE_DESCRIPTION_REQUEST_MESSAGE_PAYLOAD
The number of bytes in the control message sent to the daemon to ask it for information on its resour...
Definition: ComputeServiceMessagePayload.h:56
static const std::string VM_BOOT_OVERHEAD_IN_SECONDS
The overhead, in seconds, to boot a VM.
Definition: CloudServiceProperty.h:24
static const std::string SUBMIT_STANDARD_JOB_REQUEST_MESSAGE_PAYLOAD
The number of bytes in the control message sent to the daemon to submit a standard job...
Definition: ComputeServiceMessagePayload.h:26
std::vector< std::string > execution_hosts
List of execution host names.
Definition: CloudService.h:163
static const std::string GET_EXECUTION_HOSTS_ANSWER_MESSAGE_PAYLOAD
The number of bytes in the control message sent by the service in answer to a get execution hosts req...
Definition: CloudServiceMessagePayload.h:26
static const std::string DAEMON_STOPPED_MESSAGE_PAYLOAD
The number of bytes in the control message sent by the daemon to confirm it has terminated.
Definition: ServiceMessagePayload.h:33
static const std::string RESOURCE_DESCRIPTION_ANSWER_MESSAGE_PAYLOAD
The number of bytes in the control message sent by the daemon to state information on its resources...
Definition: ComputeServiceMessagePayload.h:58
Definition: TerminalOutput.cpp:15