示例#1
0
 def _setup_driver(self):
     self.driver = hbsd_iscsi.HBSDISCSIDriver(
         configuration=self.configuration)
     context = None
     db = None
     self.driver.common = hbsd_common.HBSDCommon(self.configuration,
                                                 self.driver, context, db)
     self.driver.common.command = hbsd_snm2.HBSDSNM2(self.configuration)
     self.driver.common.horcmgr_flock = \
         self.driver.common.command.set_horcmgr_flock()
示例#2
0
 def _setup_driver(self):
     self.driver = hbsd_fc.HBSDFCDriver(configuration=self.configuration)
     context = None
     db = None
     self.driver.common = hbsd_common.HBSDCommon(self.configuration,
                                                 self.driver, context, db)
     self.driver.common.command = hbsd_snm2.HBSDSNM2(self.configuration)
     self.driver.common.pair_flock = \
         self.driver.common.command.set_pair_flock()
     self.driver.do_setup_status.set()
示例#3
0
    def check_param(self):
        conf = self.configuration

        if conf.hitachi_unit_name and conf.hitachi_serial_number:
            msg = basic_lib.output_err(604)
            raise exception.HBSDError(message=msg)

        if not conf.hitachi_unit_name and not conf.hitachi_serial_number:
            msg = basic_lib.output_err(605)
            raise exception.HBSDError(message=msg)

        if conf.hitachi_pool_id is None:
            msg = basic_lib.output_err(601, param='hitachi_pool_id')
            raise exception.HBSDError(message=msg)

        for param in PARAM_RANGE.keys():
            _value = getattr(conf, param)
            if (_value and
                    (not PARAM_RANGE[param]['min'] <= _value <=
                     PARAM_RANGE[param]['max'])):
                msg = basic_lib.output_err(601, param=param)
                raise exception.HBSDError(message=msg)

        if conf.hitachi_default_copy_method not in COPY_METHOD:
            msg = basic_lib.output_err(601,
                                       param='hitachi_default_copy_method')
            raise exception.HBSDError(message=msg)

        if (conf.hitachi_default_copy_method == 'THIN'
                and conf.hitachi_thin_pool_id is None):
            msg = basic_lib.output_err(601, param='hitachi_thin_pool_id')
            raise exception.HBSDError(message=msg)

        for param in ('hitachi_ldev_range', 'hitachi_group_range'):
            if not getattr(conf, param):
                continue
            else:
                _value = self._range2list(conf, param)
                setattr(conf, param, _value)

        if conf.hitachi_target_ports:
            conf.hitachi_target_ports = conf.hitachi_target_ports.split(',')

        for opt in volume_opts:
            getattr(conf, opt.name)

        if conf.hitachi_unit_name:
            self.command = snm2.HBSDSNM2(conf)
        else:
            conf.append_config_values(horcm.volume_opts)
            self.command = horcm.HBSDHORCM(conf)
            self.command.check_param()
        self.pair_flock = self.command.set_pair_flock()
        self.horcmgr_flock = self.command.set_horcmgr_flock()