WRENCH  1.11
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  WRENCH_PROPERTY_COLLECTION_TYPE default_property_values = {
33  };
34 
35 WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE 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  WRENCH_PROPERTY_COLLECTION_TYPE property_list = {},
59  WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list = {});
60 
61  /***********************/
63  /***********************/
64 
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(simgrid::s4u::Mailbox *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:78
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:27
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:37
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 request information on its resources...
Definition: ComputeServiceMessagePayload.h:74
wrench::VirtualizedClusterComputeService::VirtualizedClusterComputeService
VirtualizedClusterComputeService(const std::string &hostname, std::vector< std::string > &execution_hosts, std::string scratch_space_mount_point, WRENCH_PROPERTY_COLLECTION_TYPE property_list={}, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list={})
Constructor.
Definition: VirtualizedClusterComputeService.cpp:38
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:80
wrench::CloudComputeService::execution_hosts
std::vector< std::string > execution_hosts
List of execution host names.
Definition: CloudComputeService.h:202
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: Action.cpp:28
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:56
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::VirtualizedClusterComputeService::migrateVM
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:106
wrench::VirtualizedClusterComputeService::startVM
virtual std::shared_ptr< BareMetalComputeService > startVM(const std::string &vm_name, const std::string &pm_name)
Start a VM.
Definition: VirtualizedClusterComputeService.cpp:65
wrench::CloudComputeService::startVM
virtual std::shared_ptr< BareMetalComputeService > startVM(const std::string &vm_name)
Start a VM.
Definition: CloudComputeService.cpp:242
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:76
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:35
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:29
wrench::Simulation
A class that provides basic simulation methods. Once the simulation object has been explicitly or imp...
Definition: Simulation.h:48
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:54