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, const WRENCH_PROPERTY_COLLECTION_TYPE &property_list = {}, const WRENCH_MESSAGE_PAYLOAD_COLLECTION_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”)

virtual std::string createVM(unsigned long num_cores, sg_size_t ram_memory, WRENCH_PROPERTY_COLLECTION_TYPE property_list = {}, WRENCH_MESSAGE_PAYLOAD_COLLECTION_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”)

Returns:

A VM name

virtual void destroyVM(const std::string &vm_name)

Destroy a VM.

Parameters:

vm_name – the name of the VM

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

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

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

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

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

Returns:

true or false

virtual void resumeVM(const std::string &vm_name)

Resume a suspended VM.

Parameters:

vm_name – the name of the VM

virtual void shutdownVM(const std::string &vm_name)

Shutdown an active VM.

Parameters:

vm_name – the name of the VM

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)

virtual std::shared_ptr<BareMetalComputeService> startVM(const std::string &vm_name)

Start a VM.

Parameters:

vm_name – the name of the VM

Returns:

A BareMetalComputeService that runs on the VM

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