WRENCH  1.10
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
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 
24  class CloudComputeService;
25 
30  private:
31  std::map<std::string, std::string> default_property_values = {
33  };
34 
35  std::map<std::string, double> default_messagepayload_values = {
52  };
53 
54  public:
55  VirtualizedClusterComputeService(const std::string &hostname,
56  std::vector<std::string> &execution_hosts,
57  std::string scratch_space_mount_point,
58  std::map<std::string, std::string> property_list = {},
59  std::map<std::string, double> messagepayload_list = {});
60 
61  /***********************/
63  /***********************/
64 
65  using CloudComputeService::startVM;
66 
67  virtual std::shared_ptr<BareMetalComputeService>
68  startVM(const std::string &vm_name, const std::string &pm_name);
69 
70  virtual void migrateVM(const std::string &vm_name, const std::string &dest_pm_hostname);
71 
72  /***********************/
74  /***********************/
75 
76  protected:
77 
78  /***********************/
80  /***********************/
81 
82  friend class Simulation;
83 
84  int main() override;
85 
86  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
wrench::ComputeServiceMessagePayload::IS_THERE_AT_LEAST_ONE_HOST_WITH_AVAILABLE_RESOURCES_ANSWER_MESSAGE_PAYLOAD
static const std::string IS_THERE_AT_LEAST_ONE_HOST_WITH_AVAILABLE_RESOURCES_ANSWER_MESSAGE_PAYLOAD
The number of bytes in the control message sent to the daemon to ask is one host has some resources a...
Definition: ComputeServiceMessagePayload.h:60
wrench::CloudComputeServiceMessagePayload::CREATE_VM_ANSWER_MESSAGE_PAYLOAD
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
wrench::ComputeServiceMessagePayload::SUBMIT_STANDARD_JOB_REQUEST_MESSAGE_PAYLOAD
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
wrench::ServiceMessagePayload::DAEMON_STOPPED_MESSAGE_PAYLOAD
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
wrench::VirtualizedClusterComputeService
A virtualized cluster-based compute service.
Definition: VirtualizedClusterComputeService.h:29
wrench::ComputeServiceMessagePayload::RESOURCE_DESCRIPTION_REQUEST_MESSAGE_PAYLOAD
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
wrench::ComputeServiceMessagePayload::IS_THERE_AT_LEAST_ONE_HOST_WITH_AVAILABLE_RESOURCES_REQUEST_MESSAGE_PAYLOAD
static const std::string IS_THERE_AT_LEAST_ONE_HOST_WITH_AVAILABLE_RESOURCES_REQUEST_MESSAGE_PAYLOAD
The number of bytes in the control message by the the daemon to state whether one host has some resou...
Definition: ComputeServiceMessagePayload.h:62
wrench::CloudComputeService::execution_hosts
std::vector< std::string > execution_hosts
List of execution host names.
Definition: CloudComputeService.h:198
wrench::CloudComputeService
A cloud-based compute service that manages a set of physical hosts and controls access to their resou...
Definition: CloudComputeService.h:36
wrench::CloudComputeServiceMessagePayload::GET_EXECUTION_HOSTS_REQUEST_MESSAGE_PAYLOAD
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
wrench
Definition: Alarm.cpp:20
wrench::CloudComputeServiceMessagePayload::GET_EXECUTION_HOSTS_ANSWER_MESSAGE_PAYLOAD
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
wrench::VirtualizedClusterComputeServiceMessagePayload::MIGRATE_VM_REQUEST_MESSAGE_PAYLOAD
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
wrench::ComputeServiceMessagePayload::SUBMIT_PILOT_JOB_ANSWER_MESSAGE_PAYLOAD
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
wrench::VirtualizedClusterComputeServiceMessagePayload::MIGRATE_VM_ANSWER_MESSAGE_PAYLOAD
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
wrench::CloudComputeServiceProperty::VM_BOOT_OVERHEAD_IN_SECONDS
static const std::string VM_BOOT_OVERHEAD_IN_SECONDS
The overhead, in seconds, to boot a VM.
Definition: CloudComputeServiceProperty.h:24
wrench::CloudComputeServiceMessagePayload::CREATE_VM_REQUEST_MESSAGE_PAYLOAD
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
wrench::ComputeServiceMessagePayload::RESOURCE_DESCRIPTION_ANSWER_MESSAGE_PAYLOAD
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
wrench::ServiceMessagePayload::STOP_DAEMON_MESSAGE_PAYLOAD
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
wrench::ComputeServiceMessagePayload::SUBMIT_STANDARD_JOB_ANSWER_MESSAGE_PAYLOAD
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
wrench::Simulation
A class that provides basic simulation methods. Once the simulation object has been explicitly or imp...
Definition: Simulation.h:46
wrench::ComputeServiceMessagePayload::SUBMIT_PILOT_JOB_REQUEST_MESSAGE_PAYLOAD
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
wrench::VirtualizedClusterComputeService::VirtualizedClusterComputeService
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