Exemple #1
0
    def __init__(self, configHolder=ConfigHolder()):
        self.persistentDiskDbHost = 'localhost'

        self.configHolder = configHolder
        self.configHolder.assign(self)

        self.profile = None # Can be frontend or node
        self.system = SystemFactory.getSystem(self.persistentDiskSystem,
                                              self.configHolder)

        # Package to be installed
        self.packages = {'frontend': {
            'pdisk': ['stratuslab-pdisk-server', ],
            'iscsi': ['scsi-target-utils', 'iscsi-initiator-utils'],
            'nfs': ['nfs-utils', 'nfs-utils-lib'],
            'lvm': ['lvm2', ],
            'file': ['qemu-img'],
        },
                         'node': {
                             'pdisk': ['stratuslab-pdisk-host', ],
                             'iscsi': ['iscsi-initiator-utils', ],
                             'nfs': ['nfs-utils', 'nfs-utils-lib'],
                             'lvm': [],
                             'file': [],
                         },
        }

        self.pdiskConfigBackendTpl = Util.get_template_file([self.PDISK_BACKEND_CONF_NAME + '.tpl'])
        self.authnConfigFile = Defaults.AUTHN_CONFIG_FILE
        self.pdiskConfigFile = os.path.join(Defaults.ETC_DIR, 'pdisk.cfg')
        self.pdiskHostConfigFile2 = os.path.join(Defaults.ETC_DIR, 'pdisk-host.conf')
        self.pdiskHomeDir = '/opt/stratuslab/storage/pdisk'
        self.cloudNodeKey = os.path.join(self.pdiskHomeDir, 'cloud_node.key')
        self.pdiskUsername = '******'
        self.pdiskPassword = self._extractPdiskPassword()
 def _getTemplateFile(self, tpl, name):
     try:
         return Util.get_template_file([tpl])
     except:
         printError("%s template does not exist" % name)
         return tpl
Exemple #3
0
 def _setupFrontend(self):
     printStep('Creating monitoring configuration file')
     monitoringTpl = Util.get_template_file(['monitoring.cfg.tpl'])
     monitoringConfFile = os.path.join(Defaults.ETC_DIR, 'monitoring.cfg')
     self._writeConfigFromTemplate(monitoringConfFile, monitoringTpl)
Exemple #4
0
 def _setupFrontend(self):
     self._validateParameters()
     printStep('Creating registration configuration file')
     registrationTpl = Util.get_template_file(['registration.cfg.tpl'])
     registrationConfFile = os.path.join(Defaults.ETC_DIR, 'registration.cfg')
     self._writeConfigFromTemplate(registrationConfFile, registrationTpl)