Home | Trees | Indices | Help |
---|
|
Represents a site containing machines ("nodes").
This class is used to load site descriptions in XML format or using a "resources string". Site descriptions can appear in two places: in a LWF file (where the site required for the lease workload is embedded in the LWF file) or in the Haizea configuration file. In both cases, the site description is only used in simulation (in OpenNebula mode, the available nodes and resources are obtained by querying OpenNebula).
Note that this class is distinct from the ResourcePool class, even though both are used to represent "collections of nodes". The Site class is used purely as a convenient way to load site information from an XML file and to manipulate that information elsewhere in Haizea, while the ResourcePool class is responsible for sending enactment commands to nodes, monitoring nodes, etc.
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
|
|||
|
|||
|
|||
|
|
|||
Inherited from |
|
Constructor. Arguments: nodes -- A Nodes object resource_types -- A list of valid resource types in this site. attr_types -- A list of valid attribute types in this site
|
Constructs a site from an XML file. See the Haizea documentation for details on the site XML format. Argument: xml_file -- XML file containing the site in XML format. |
Constructs a site from an LWF file. LWF files can have site information embedded in them. This method loads this site information from an LWF file. See the Haizea documentation for details on the LWF format. Argument: lwf_file -- LWF file. |
Constructs a site from an ElementTree element. See the Haizea documentation for details on the site XML format. Argument: element -- Element object containing a "<site>" element. |
Constructs a site from a "resources string" A "resources string" is a shorthand way of specifying a site with homogeneous resources and no attributes. The format is: <numnodes> <resource_type>:<resource_quantity>[,<resource_type>:<resource_quantity>]* For example: 4 CPU:100,Memory:1024 Argument: resource_str -- resources string |
Adds a new resource to all nodes in the site. Argument: name -- Name of the resource type amounts -- A list with the amounts of the resource to add to each node. If the resource is single-instance, then this will just be a list with a single element. If multi-instance, each element of the list represent the amount of an instance of the resource. |
Returns the resource types in this site. This method returns a list, each item being a pair with 1. the name of the resource type and 2. the maximum number of instances for that resource type across all nodes. |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Dec 17 10:59:20 2009 | http://epydoc.sourceforge.net |