Пример #1
0
    def __init__(self, site):
        ResourcePoolInfo.__init__(self)
        self.logger = logging.getLogger("ENACT.SIMUL.INFO")
                
        if not ("CPU" in site.resource_types and "Memory" in site.resource_types):
            # CPU and Memory must be specified
            # TODO: raise something more meaningful
            raise
        
        # Disk and network should be specified but, if not, we can
        # just add arbitrarily large values.
        if not "Disk" in site.resource_types:
            site.add_resource("Disk", [1000000])

        if not "Net-in" in site.resource_types:
            site.add_resource("Net-in", [1000000])

        if not "Net-out" in site.resource_types:
            site.add_resource("Net-out", [1000000])
        
        self.resource_types = site.get_resource_types()        
        
        nodes = site.nodes.get_all_nodes()
        
        self.nodes = dict([(id, ResourcePoolNode(id, "simul-%i" % id, capacity)) for (id, capacity) in nodes.items()])
        for node in self.nodes.values():
            node.enactment_info = node.id      
Пример #2
0
    def __init__(self, site):
        ResourcePoolInfo.__init__(self)
        self.logger = logging.getLogger("ENACT.SIMUL.INFO")

        if not ("CPU" in site.resource_types
                and "Memory" in site.resource_types):
            # CPU and Memory must be specified
            # TODO: raise something more meaningful
            raise

        # Disk and network should be specified but, if not, we can
        # just add arbitrarily large values.
        if not "Disk" in site.resource_types:
            site.add_resource("Disk", [1000000])

        if not "Net-in" in site.resource_types:
            site.add_resource("Net-in", [1000000])

        if not "Net-out" in site.resource_types:
            site.add_resource("Net-out", [1000000])

        self.resource_types = site.get_resource_types()

        nodes = site.nodes.get_all_nodes()

        self.nodes = dict([(id, ResourcePoolNode(id, "simul-%i" % id,
                                                 capacity))
                           for (id, capacity) in nodes.items()])
        for node in self.nodes.values():
            node.enactment_info = node.id
Пример #3
0
    def __init__(self):
        ResourcePoolInfo.__init__(self)
        self.logger = logging.getLogger("ENACT.ONE.INFO")

        self.rpc = OpenNebulaXMLRPCClientSingleton().client

        # Get information about nodes from OpenNebula
        self.max_nod_id = 0
        self.nodes = {}

        self.resource_types = []
        self.resource_types.append((constants.RES_CPU,1))
        self.resource_types.append((constants.RES_MEM,1))
        self.resource_types.append((constants.RES_DISK,1))
                    
        self.logger.info("Fetching nodes from OpenNebula")            
        self.__fetch_nodes()
        self.logger.info("Fetched %i nodes from OpenNebula" % len(self.nodes))            
Пример #4
0
    def __init__(self):
        ResourcePoolInfo.__init__(self)
        self.logger = logging.getLogger("ENACT.ONE.INFO")

        self.rpc = OpenNebulaXMLRPCClientSingleton().client

        # Get information about nodes from OpenNebula
        self.max_nod_id = 0
        self.nodes = {}

        self.resource_types = []
        self.resource_types.append((constants.RES_CPU, 1))
        self.resource_types.append((constants.RES_MEM, 1))
        self.resource_types.append((constants.RES_DISK, 1))

        self.logger.info("Fetching nodes from OpenNebula")
        self.__fetch_nodes()
        self.logger.info("Fetched %i nodes from OpenNebula" % len(self.nodes))