WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
Public Types | Public Member Functions | Static Public Attributes | List of all members
wrench::S4U_VirtualMachine Class Reference

A wrapper for the simgrid::s4u::VirtualMachine class. More...

#include <S4U_VirtualMachine.h>

Public Types

enum  State { DOWN, RUNNING, SUSPENDED }
 VM state enum.
 

Public Member Functions

 S4U_VirtualMachine (const std::string &vm_hostname, unsigned long num_cores, double ram_memory, WRENCH_PROPERTY_COLLECTION_TYPE property_list, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list)
 Constructor. More...
 
double getMemory ()
 Get the memory_manager_service consumption. More...
 
WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE getMessagePayloadList ()
 Get the message payload list for the bare-metal compute service that will run on the VM ({} means "use all defaults") More...
 
unsigned long getNumCores ()
 Get the number of cores. More...
 
std::string getPhysicalHostname ()
 Get the physical hostname. More...
 
WRENCH_PROPERTY_COLLECTION_TYPE getPropertyList ()
 Get the property list for the bare-metal compute service that is to run on the VM ({} means "use all defaults") More...
 
State getState ()
 Get the VM's state. More...
 
std::string getStateAsString ()
 Get the VM's state as a string. More...
 
void migrate (const std::string &dst_pm_name)
 Migrate the VM. More...
 
void resume ()
 Resume the VM.
 
void shutdown ()
 Shutdown the VM.
 
void start (std::string &pm_name)
 Start the VM. More...
 
void suspend ()
 Suspend the VM.
 

Static Public Attributes

static std::unordered_map< std::string, std::string > vm_to_pm_map
 A map to keep track of VM-to-PM mapping.
 

Detailed Description

A wrapper for the simgrid::s4u::VirtualMachine class.

Constructor & Destructor Documentation

◆ S4U_VirtualMachine()

wrench::S4U_VirtualMachine::S4U_VirtualMachine ( const std::string &  vm_name,
unsigned long  num_cores,
double  ram_memory,
WRENCH_PROPERTY_COLLECTION_TYPE  property_list,
WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE  messagepayload_list 
)

Constructor.

Parameters
vm_namethe name of the VM
num_coresthe number of cores the VM can use
ram_memorythe VM RAM memory_manager_service capacity
property_lista property list ({} means use all defaults)
messagepayload_lista message payload list ({} means use all defaults)

Member Function Documentation

◆ getMemory()

double wrench::S4U_VirtualMachine::getMemory ( )

Get the memory_manager_service consumption.

Returns
the memory_manager_service consumption

◆ getMessagePayloadList()

WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE wrench::S4U_VirtualMachine::getMessagePayloadList ( )

Get the message payload list for the bare-metal compute service that will run on the VM ({} means "use all defaults")

Returns
a message payload list

◆ getNumCores()

unsigned long wrench::S4U_VirtualMachine::getNumCores ( )

Get the number of cores.

Returns
the number of cores

◆ getPhysicalHostname()

std::string wrench::S4U_VirtualMachine::getPhysicalHostname ( )

Get the physical hostname.

Returns
the physical hostname

◆ getPropertyList()

WRENCH_PROPERTY_COLLECTION_TYPE wrench::S4U_VirtualMachine::getPropertyList ( )

Get the property list for the bare-metal compute service that is to run on the VM ({} means "use all defaults")

Returns
a property list

◆ getState()

S4U_VirtualMachine::State wrench::S4U_VirtualMachine::getState ( )

Get the VM's state.

Returns
a state

◆ getStateAsString()

std::string wrench::S4U_VirtualMachine::getStateAsString ( )

Get the VM's state as a string.

Returns
a state as a string

◆ migrate()

void wrench::S4U_VirtualMachine::migrate ( const std::string &  dest_pm_name)

Migrate the VM.

Parameters
dest_pm_namethe name of the host to which to migrate the VM

◆ start()

void wrench::S4U_VirtualMachine::start ( std::string &  pm_name)

Start the VM.

Parameters
pm_namethe physical host name

The documentation for this class was generated from the following files: