wrench::CloudComputeService
-
class CloudComputeService : public wrench::ComputeService
A cloud-based compute service that manages a set of physical hosts and controls access to their resources by (transparently) executing jobs in VM instances.
Subclassed by wrench::VirtualizedClusterComputeService
Public Functions
-
CloudComputeService(const std::string &hostname, const std::vector<std::string> &execution_hosts, const std::string &scratch_space_mount_point, WRENCH_PROPERTY_COLLECTION_TYPE property_list = {}, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list = {})
Constructor.
- Parameters:
hostname – the hostname on which to start the service
execution_hosts – the list of the names of the hosts available for running virtual machines
scratch_space_mount_point – the mount point for the cloud service’s scratch space (”” means none)
property_list – a property list ({} means “use all defaults”)
messagepayload_list – a message payload list ({} means “use all defaults”)
- Throws:
std::runtime_error –
-
~CloudComputeService()
Destructor.
-
virtual std::string createVM(unsigned long num_cores, double ram_memory, WRENCH_PROPERTY_COLLECTION_TYPE property_list = {}, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list = {})
Create a BareMetalComputeService VM (balances load on execution hosts)
- Parameters:
num_cores – the number of cores for the VM
ram_memory – the VM’s RAM memory_manager_service capacity
property_list – a property list for the BareMetalComputeService that will run on the VM ({} means “use all defaults”)
messagepayload_list – a message payload list for the BareMetalComputeService that will run on the VM ({} means “use all defaults”)
- Throws:
std::runtime_error –
- Returns:
A VM name
-
virtual void destroyVM(const std::string &vm_name)
Destroy a VM.
- Parameters:
vm_name – the name of the VM
- Throws:
std::invalid_argument –
-
std::vector<std::string> getExecutionHosts()
Get the list of execution hosts available to run VMs.
- Throws:
- Returns:
a list of hostnames
-
virtual std::shared_ptr<BareMetalComputeService> getVMComputeService(const std::string &vm_name)
Get the compute service running on a VM, if any.
- Parameters:
vm_name – the name of the VM
- Throws:
std::invalid_argument –
- Returns:
A BareMetalComputeService that runs on the VM, or nullptr if none
-
virtual std::string getVMPhysicalHostname(const std::string &vm_name)
Get the name of the physical host on which a VM is running.
- Parameters:
vm_name – the name of the VM
- Throws:
std::invalid_argument –
- Returns:
physical host name
-
virtual bool isVMDown(const std::string &vm_name)
Method to check whether a VM is currently down.
- Parameters:
vm_name – the name of the VM
- Throws:
std::invalid_argument –
- Returns:
true or false
-
virtual bool isVMRunning(const std::string &vm_name)
Method to check whether a VM is currently running.
- Parameters:
vm_name – the name of the VM
- Throws:
std::invalid_argument –
- Returns:
true or false
-
virtual bool isVMSuspended(const std::string &vm_name)
Method to check whether a VM is currently running.
- Parameters:
vm_name – the name of the VM
- Throws:
std::invalid_argument –
- Returns:
true or false
-
virtual void resumeVM(const std::string &vm_name)
Resume a suspended VM.
- Parameters:
vm_name – the name of the VM
- Throws:
std::invalid_argument –
-
virtual void shutdownVM(const std::string &vm_name)
Shutdown an active VM.
- Parameters:
vm_name – the name of the VM
- Throws:
std::invalid_argument –
-
virtual void shutdownVM(const std::string &vm_name, bool send_failure_notifications, ComputeService::TerminationCause termination_cause)
Shutdown an active VM.
- Parameters:
vm_name – the name of the VM
send_failure_notifications – whether to send the failure notifications
termination_cause – the termination cause (if failure notifications are sent)
- Throws:
std::invalid_argument –
-
virtual std::shared_ptr<BareMetalComputeService> startVM(const std::string &vm_name)
Start a VM.
- Parameters:
vm_name – the name of the VM
- Throws:
std::invalid_argument –
- Returns:
A BareMetalComputeService that runs on the VM
Method to submit a compound job to the service.
- Parameters:
job – The job being submitted
service_specific_arguments – the set of service-specific arguments
-
virtual bool supportsCompoundJobs() override
Returns true if the service supports compound jobs.
- Returns:
true or false
-
virtual bool supportsPilotJobs() override
Returns true if the service supports pilot jobs.
- Returns:
true or false
-
virtual bool supportsStandardJobs() override
Returns true if the service supports standard jobs.
- Returns:
true or false
-
virtual void suspendVM(const std::string &vm_name)
Suspend a running VM.
- Parameters:
vm_name – the name of the VM
- Throws:
std::invalid_argument –
Method to terminate a compound job.
- Parameters:
job – the standard job
-
void validateProperties()
Validate the service’s properties.
- Throws:
std::invalid_argument –
-
CloudComputeService(const std::string &hostname, const std::vector<std::string> &execution_hosts, const std::string &scratch_space_mount_point, WRENCH_PROPERTY_COLLECTION_TYPE property_list = {}, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list = {})