VirtualizedClusterComputeService.h
1 
11 #ifndef WRENCH_VIRTUALIZEDCLUSTERSERVICE_H
12 #define WRENCH_VIRTUALIZEDCLUSTERSERVICE_H
13 
14 #include "wrench/services/compute/virtualized_cluster/VirtualizedClusterComputeServiceProperty.h"
15 #include "wrench/services/compute/virtualized_cluster/VirtualizedClusterComputeServiceMessagePayload.h"
16 #include <wrench/services/compute/cloud/CloudComputeService.h>
17 
18 namespace wrench {
19 
20  class Simulation;
21 
22  class ComputeService;
23  class CloudComputeService;
24 
29 
30  private:
31  std::map<std::string, std::string> default_property_values = {
33  };
34 
35  std::map<std::string, double> default_messagepayload_values = {
50  };
51 
52  public:
53  VirtualizedClusterComputeService(const std::string &hostname,
54  std::vector<std::string> &execution_hosts,
55  std::string scratch_space_mount_point,
56  std::map<std::string, std::string> property_list = {},
57  std::map<std::string, double> messagepayload_list = {});
58 
59  /***********************/
61  /***********************/
62 
64 
65  virtual std::shared_ptr<BareMetalComputeService> startVM(const std::string &vm_name, const std::string &pm_name);
66 
67  virtual void migrateVM(const std::string &vm_name, const std::string &dest_pm_hostname);
68 
69  std::string getVMPhysicalHostname(const std::string &vm_name);
70 
71 
72  /***********************/
74  /***********************/
75 
76  protected:
77 
78  /***********************/
80  /***********************/
81 
82  friend class Simulation;
83 
84  int main() override;
85 
86  virtual bool processNextMessage() override;
87 
88  virtual void processMigrateVM(const std::string &answer_mailbox,
89  const std::string &vm_name,
90  const std::string &dest_pm_hostname);
91 
92  /***********************/
94  /***********************/
95  };
96 
97 }
98 
99 #endif //WRENCH_VIRTUALIZEDCLUSTERSERVICE_H
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: CloudComputeServiceMessagePayload.h:30
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
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
A virtualized cluster-based compute service.
Definition: VirtualizedClusterComputeService.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
std::vector< std::string > execution_hosts
List of execution host names.
Definition: CloudComputeService.h:187
A cloud-based compute service that manages a set of physical hosts and controls access to their resou...
Definition: CloudComputeService.h:37
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: CloudComputeServiceMessagePayload.h:24
Definition: Alarm.cpp:20
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: CloudComputeServiceMessagePayload.h:26
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: VirtualizedClusterComputeServiceMessagePayload.h:25
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 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: VirtualizedClusterComputeServiceMessagePayload.h:27
virtual void processMigrateVM(const std::string &answer_mailbox, const std::string &vm_name, const std::string &dest_pm_hostname)
Process a VM migration request.
Definition: VirtualizedClusterComputeService.cpp:274
static const std::string VM_BOOT_OVERHEAD_IN_SECONDS
The overhead, in seconds, to boot a VM.
Definition: CloudComputeServiceProperty.h:24
virtual void migrateVM(const std::string &vm_name, const std::string &dest_pm_hostname)
Synchronously migrate a VM to another physical host.
Definition: VirtualizedClusterComputeService.cpp:119
virtual bool processNextMessage() override
Wait for and react to any incoming message.
Definition: VirtualizedClusterComputeService.cpp:177
std::string getVMPhysicalHostname(const std::string &vm_name)
Get the name of the physical host on which a VM is running.
Definition: VirtualizedClusterComputeService.cpp:103
virtual std::shared_ptr< BareMetalComputeService > startVM(const std::string &vm_name, const std::string &pm_name)
Start a VM.
Definition: VirtualizedClusterComputeService.cpp:65
virtual std::shared_ptr< BareMetalComputeService > startVM(const std::string &vm_name)
Start a VM.
Definition: CloudComputeService.cpp:233
std::map< std::string, double > messagepayload_list
The service's messagepayload list.
Definition: Service.h:112
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: CloudComputeServiceMessagePayload.h:28
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
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
std::string hostname
The name of the host on which the daemon is running.
Definition: S4U_Daemon.h:51
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
A class that provides basic simulation methods. Once the simulation object has been explicitly or imp...
Definition: Simulation.h:46
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
VirtualizedClusterComputeService(const std::string &hostname, std::vector< std::string > &execution_hosts, std::string scratch_space_mount_point, std::map< std::string, std::string > property_list={}, std::map< std::string, double > messagepayload_list={})
Constructor.
Definition: VirtualizedClusterComputeService.cpp:38
std::map< std::string, std::string > property_list
The service's property list.
Definition: Service.h:109
int main() override
Main method of the daemon.
Definition: VirtualizedClusterComputeService.cpp:153