示例#1
0
    def __init__(self, host, port):
        self.FILENAME_MY_CONFIG = 'Coordinator_cfg.py'

        CommonHandler.__init__(self, host, port)
        self.dispatch_handlers.update({
            'RackAlgorithmResourceInformationReq':
            self.RackAlgorithmResourceInformation,
            'ClusterDatabaseSubsystemCreateVMres':
            self.ClusterDatabaseSubsystemCreateVM,
            'NodeDatabaseSubsystemAddPortReq':
            self.NodeDatabaseSubsystemAddPort,
        })
        self.startup_functions.extend((
            #self.databaseSubsystem,
            self.CreateVmByCheckingDatabase,
            self.CheckPortmappingRequest,
            self.sayHello,  # hello function
        ))
        # database imformation, use config to replace this part
        # TODO replace all db connection with self.db
        try:
            self.db = mdb.connect(self.config['host'], self.config['db_user'],
                                  self.config['db_password'],
                                  self.config['db_name'])
        except:
            logger.error('connect to db failed')
            self.db = None
        self.host = self.config['host']
        self.db_account = self.config['db_account']
        self.db_password = self.config['db_password']
        self.db_name = self.config['db_name']

        self.cmd_iptables = self.config['cmd_iptables']
示例#2
0
    def __init__(self, host, port):
        self.FILENAME_MY_CONFIG = 'Coordinator_cfg.py'

        CommonHandler.__init__(self, host, port)
        self.dispatch_handlers.update({
            'RackAlgorithmResourceInformationReq': self.RackAlgorithmResourceInformation,
            'ClusterDatabaseSubsystemCreateVMres': self.ClusterDatabaseSubsystemCreateVM,
            'NodeDatabaseSubsystemAddPortReq': self.NodeDatabaseSubsystemAddPort,
        })
        self.startup_functions.extend((
            #self.databaseSubsystem,      
            self.CreateVmByCheckingDatabase,
            self.CheckPortmappingRequest,
            self.sayHello,          # hello function
        ))
        # database imformation, use config to replace this part
        # TODO replace all db connection with self.db
        try:
            self.db = mdb.connect(self.config['host'], self.config['db_user'], self.config['db_password'], self.config['db_name'])
        except:
            logger.error('connect to db failed')
            self.db = None
        self.host = self.config['host']
        self.db_account = self.config['db_account']
        self.db_password = self.config['db_password']
        self.db_name = self.config['db_name']

        self.cmd_iptables = self.config['cmd_iptables']
示例#3
0
 def __init__(self, host, port):
     CommonHandler.__init__(self, host, port)
     self.dispatch_handlers.update({
         'RackVirtualMachineManagerCreateVMreq': self.RackVirtualMachineManagerCreateVM,
         'CreateVmByNodeReq': self.CreateVmByNode,
     })
     self.startup_functions.extend((
         self.sayHello,
     ))
示例#4
0
 def __init__(self, host, port):
     CommonHandler.__init__(self, host, port)
     self.dispatch_handlers.update({
         'RackVirtualMachineManagerCreateVMreq':
         self.RackVirtualMachineManagerCreateVM,
         'CreateVmByNodeReq':
         self.CreateVmByNode,
     })
     self.startup_functions.extend((self.sayHello, ))
示例#5
0
    def __init__(self, host, port):
        CommonHandler.__init__(self, host, port)
        self.dispatch_handlers.update({
            'ClusterVirtualMachineManagerCreateVMreq': self.ClusterVirtualMachineManagerCreateVM,
            'NodeVirtualMachineManagerCreateVMres': self.NodeVirtualMachineManagerCreateVM,
            'CreateVmByRackReq': self.CreateVmByRack,
            
		})
        self.startup_functions.extend((
            self.sayHello, # hello function
        ))
示例#6
0
 def __init__(self, host, port):
     CommonHandler.__init__(self, host, port)
     self.dispatch_handlers.update({
         'ClusterVirtualMachineManagerCreateVMreq':
         self.ClusterVirtualMachineManagerCreateVM,
         'NodeVirtualMachineManagerCreateVMres':
         self.NodeVirtualMachineManagerCreateVM,
         'CreateVmByRackReq':
         self.CreateVmByRack,
     })
     self.startup_functions.extend((
         self.sayHello,  # hello function
     ))
示例#7
0
    def __init__(self, host, port):
        self.FILENAME_MY_CONFIG = 'subsystem_manager_cfg.py'
        CommonHandler.__init__(self, host, port)
        self.dispatch_handlers.update({
            'SubsystemPortMappingReq': self.SubsystemPortMapping,
        })
        self.startup_functions.extend((
            self.MonitorResource,
            self.StorageSubsystem, # reclaiming space from files that are no longer used
            self.sayHello, # hello function              
            self.SubsystemPortmappingTest,
        ))

        hierachyPath = os.path.join( ROYSTONEA_ROOT, "etc/Hierachy.xml")
        self.hierachy = Hierachy(hierachyPath)
示例#8
0
    def __init__(self, host, port):
        self.FILENAME_MY_CONFIG = 'subsystem_manager_cfg.py'
        CommonHandler.__init__(self, host, port)
        self.dispatch_handlers.update({
            'SubsystemPortMappingReq':
            self.SubsystemPortMapping,
        })
        self.startup_functions.extend((
            self.MonitorResource,
            self.
            StorageSubsystem,  # reclaiming space from files that are no longer used
            self.sayHello,  # hello function              
            self.SubsystemPortmappingTest,
        ))

        hierachyPath = os.path.join(ROYSTONEA_ROOT, "etc/Hierachy.xml")
        self.hierachy = Hierachy(hierachyPath)