SimGrid  3.13
Versatile Simulation of Distributed Systems
simgrid::surf::VirtualMachine Class Referenceabstract

SURF VM interface class. More...

#include <virtual_machine.hpp>

Inheritance diagram for simgrid::surf::VirtualMachine:
simgrid::surf::HostImpl simgrid::surf::Resource simgrid::surf::PropertyHolder simgrid::surf::VMHL13

Public Member Functions

 VirtualMachine (simgrid::surf::HostModel *model, const char *name, simgrid::s4u::Host *host)
 
 ~VirtualMachine ()
 
virtual void suspend ()=0
 Suspend the VM. More...
 
virtual void resume ()=0
 Resume the VM. More...
 
virtual void save ()=0
 Save the VM (Not yet implemented) More...
 
virtual void restore ()=0
 Restore the VM (Not yet implemented) More...
 
virtual void migrate (sg_host_t dest_PM)=0
 Migrate the VM to the destination host. More...
 
sg_host_t getPm ()
 Get the physical machine hosting the VM. More...
 
virtual void setBound (double bound)=0
 
virtual void setAffinity (Cpu *cpu, unsigned long mask)=0
 
void turnOn () override
 Turn on the current Resource. More...
 
void turnOff () override
 Turn off the current Resource. More...
 
e_surf_vm_state_t getState ()
 
void setState (e_surf_vm_state_t state)
 
- Public Member Functions inherited from simgrid::surf::HostImpl
 HostImpl (HostModel *model, const char *name, xbt_dynar_t storage, Cpu *cpu)
 Host constructor. More...
 
 HostImpl (HostModel *model, const char *name, lmm_constraint_t constraint, xbt_dynar_t storage, Cpu *cpu)
 Host constructor. More...
 
 ~HostImpl ()
 use destroy() instead of this destructor More...
 
HostModelgetModel ()
 
void attach (simgrid::s4u::Host *host)
 
bool isOn () const override
 Check if the current Resource is active. More...
 
bool isOff () const override
 Check if the current Resource is shut down. More...
 
virtual simgrid::surf::StoragefindStorageOnMountList (const char *storage)
 Return the storage of corresponding mount point. More...
 
virtual xbt_dict_t getMountedStorageList ()
 Get the xbt_dict_t of mount_point: Storage. More...
 
virtual xbt_dynar_t getAttachedStorageList ()
 Get the xbt_dynar_t of storages attached to the Host. More...
 
virtual Actionopen (const char *fullpath)
 Open a file. More...
 
virtual Actionclose (surf_file_t fd)
 Close a file. More...
 
virtual int unlink (surf_file_t fd)
 Unlink a file. More...
 
virtual sg_size_t getSize (surf_file_t fd)
 Get the size in bytes of the file. More...
 
virtual Actionread (surf_file_t fd, sg_size_t size)
 Read a file. More...
 
virtual Actionwrite (surf_file_t fd, sg_size_t size)
 Write a file. More...
 
virtual xbt_dynar_t getInfo (surf_file_t fd)
 Get the informations of a file descriptor. More...
 
virtual sg_size_t fileTell (surf_file_t fd)
 Get the current position of the file descriptor. More...
 
virtual int fileSeek (surf_file_t fd, sg_offset_t offset, int origin)
 Set the position indicator associated with the file descriptor to a new position. More...
 
virtual int fileMove (surf_file_t fd, const char *fullpath)
 Move a file to another location on the same mount point. More...
 
bool isUsed () override
 Check if the current Resource is used (if it currently serves an action) More...
 
void apply_event (tmgr_trace_iterator_t event, double value) override
 Apply an event of external load event to that resource. More...
 
xbt_dynar_t getVms ()
 Get the list of virtual machines on the current Host. More...
 
void getParams (vm_params_t params)
 Retrieve a copy of the parameters of that VM/PM. More...
 
void setParams (vm_params_t params)
 Sets the params of that VM/PM. More...
 
simgrid::s4u::Host * getHost ()
 
- Public Member Functions inherited from simgrid::surf::Resource
 Resource (Model *model, const char *name)
 Constructor of non-LMM Resources. More...
 
 Resource (Model *model, const char *name, lmm_constraint_t constraint)
 Constructor of LMM Resources. More...
 
virtual ~Resource ()
 
ModelgetModel () const
 Get the Model of the current Resource. More...
 
const char * getName () const
 Get the name of the current Resource. More...
 
bool operator== (const Resource &other) const
 
lmm_constraint_t getConstraint () const
 Get the lmm constraint associated to this Resource if it is part of a LMM component (or null if none) More...
 
- Public Member Functions inherited from simgrid::surf::PropertyHolder
 PropertyHolder (xbt_dict_t props)
 
 ~PropertyHolder ()
 
const char * getProperty (const char *id)
 Return the property associated to the provided key (or NULL if not existing) More...
 
void setProperty (const char *id, const char *value)
 Change the value of a given key in the property set. More...
 
xbt_dict_t getProperties ()
 Return the whole set of properties. More...
 

Public Attributes

CpuActionaction_
 
boost::intrusive::list_member_hook vm_hook
 
- Public Attributes inherited from simgrid::surf::HostImpl
xbt_dynar_t p_storage
 
Cpup_cpu
 
simgrid::s4u::Host * p_host = nullptr
 

Protected Attributes

simgrid::s4u::Host * hostPM_
 
e_surf_vm_state_t p_vm_state = SURF_VM_STATE_CREATED
 
- Protected Attributes inherited from simgrid::surf::Resource
lmm_constraint_t constraint_ = nullptr
 

Additional Inherited Members

- Static Public Member Functions inherited from simgrid::surf::HostImpl
static void classInit ()
 
- Static Public Attributes inherited from simgrid::surf::HostImpl
static simgrid::xbt::Extension< simgrid::s4u::Host, HostImplEXTENSION_ID
 

Detailed Description

SURF VM interface class.

A VM represent a virtual machine

Constructor & Destructor Documentation

simgrid::surf::VirtualMachine::VirtualMachine ( simgrid::surf::HostModel model,
const char *  name,
simgrid::s4u::Host *  host 
)
simgrid::surf::VirtualMachine::~VirtualMachine ( )

Member Function Documentation

virtual void simgrid::surf::VirtualMachine::suspend ( )
pure virtual

Suspend the VM.

Implemented in simgrid::surf::VMHL13.

virtual void simgrid::surf::VirtualMachine::resume ( )
pure virtual

Resume the VM.

Implemented in simgrid::surf::VMHL13.

virtual void simgrid::surf::VirtualMachine::save ( )
pure virtual

Save the VM (Not yet implemented)

Implemented in simgrid::surf::VMHL13.

virtual void simgrid::surf::VirtualMachine::restore ( )
pure virtual

Restore the VM (Not yet implemented)

Implemented in simgrid::surf::VMHL13.

virtual void simgrid::surf::VirtualMachine::migrate ( sg_host_t  dest_PM)
pure virtual

Migrate the VM to the destination host.

Implemented in simgrid::surf::VMHL13.

sg_host_t simgrid::surf::VirtualMachine::getPm ( )

Get the physical machine hosting the VM.

returns the physical machine on which the VM is running

virtual void simgrid::surf::VirtualMachine::setBound ( double  bound)
pure virtual

Implemented in simgrid::surf::VMHL13.

virtual void simgrid::surf::VirtualMachine::setAffinity ( Cpu cpu,
unsigned long  mask 
)
pure virtual

Implemented in simgrid::surf::VMHL13.

void simgrid::surf::VirtualMachine::turnOn ( )
overridevirtual

Turn on the current Resource.

Reimplemented from simgrid::surf::HostImpl.

void simgrid::surf::VirtualMachine::turnOff ( )
overridevirtual

Turn off the current Resource.

Reimplemented from simgrid::surf::HostImpl.

e_surf_vm_state_t simgrid::surf::VirtualMachine::getState ( )
void simgrid::surf::VirtualMachine::setState ( e_surf_vm_state_t  state)

Member Data Documentation

CpuAction* simgrid::surf::VirtualMachine::action_
simgrid::s4u::Host* simgrid::surf::VirtualMachine::hostPM_
protected
e_surf_vm_state_t simgrid::surf::VirtualMachine::p_vm_state = SURF_VM_STATE_CREATED
protected
boost::intrusive::list_member_hook simgrid::surf::VirtualMachine::vm_hook

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