Exemplo n.º 1
0
    def create(self, params):
        if utils.is_lun_scan_enabled():
            wok_log.error(
                "Lun scan is enabled. Cannot add/remove LUNs manually.")
            raise InvalidOperation("GS390XSTG00009")

        if 'hbaId' not in params:
            wok_log.error("hbaId is required for adding a LUN")
            raise MissingParameter("GS390XSTG00010")

        hbaId = params['hbaId']
        utils.validate_hba_id(hbaId)

        if 'remoteWwpn' not in params:
            wok_log.error("remoteWwpn is required for adding a LUN")
            raise MissingParameter("GS390XSTG00011")

        wwpn = params['remoteWwpn']
        utils.validate_wwpn_or_lun(wwpn)

        if 'lunId' not in params:
            wok_log.error("lunId is required for adding a LUN")
            raise MissingParameter("GS390XSTG00012")

        lunId = params['lunId']
        utils.validate_wwpn_or_lun(lunId)

        utils.add_lun(hbaId, wwpn, lunId)

        lun_path = hbaId + ":" + wwpn + ":" + lunId
        return lun_path
Exemplo n.º 2
0
    def create(self, params):
        if utils.is_lun_scan_enabled():
            wok_log.error(
                "Lun scan is enabled. Cannot add/remove LUNs manually.")
            raise InvalidOperation("GS390XSTG00009")

        if 'hbaId' not in params:
            wok_log.error("hbaId is required for adding a LUN")
            raise MissingParameter("GS390XSTG00010")

        hbaId = params['hbaId']
        utils.validate_hba_id(hbaId)

        if 'remoteWwpn' not in params:
            wok_log.error("remoteWwpn is required for adding a LUN")
            raise MissingParameter("GS390XSTG00011")

        wwpn = params['remoteWwpn']
        utils.validate_wwpn_or_lun(wwpn)

        if 'lunId' not in params:
            wok_log.error("lunId is required for adding a LUN")
            raise MissingParameter("GS390XSTG00012")

        lunId = params['lunId']
        utils.validate_wwpn_or_lun(lunId)

        utils.add_lun(hbaId, wwpn, lunId)

        lun_path = hbaId + ":" + wwpn + ":" + lunId
        return lun_path
Exemplo n.º 3
0
 def setUpClass(self):
     super(TestPartitions, self).setUpClass()
     self.logging.info('--> TestPartitions.setUpClass()')
     self.logging.debug('enable the fcp adapter and lun'
                        'specified in config file')
     self.hba_id = utils.readconfig(self, 'config', 'PARTITIONS', 'hba_id')
     self.remote_wwpn = utils.readconfig(self, 'config', 'PARTITIONS', 'remote_wwpn')
     self.lun_id = utils.readconfig(self, 'config', 'PARTITIONS', 'lun_id')
     self.lun_id_2 = utils.readconfig(self, 'config', 'PARTITIONS', 'lun_id_2')
     try:
         utils.enable_eckd(self.hba_id)
         utils.add_lun(self.hba_id, self.remote_wwpn, self.lun_id)
         utils.add_lun(self.hba_id, self.remote_wwpn, self.lun_id_2)
     except Exception, err:
         self.logging.error(str(err))
         raise Exception(str(err))
Exemplo n.º 4
0
    def create(self, params):
        if utils.is_lun_scan_enabled()['current']:
            wok_log.error(
                "Lun scan is enabled. Cannot add/remove LUNs manually.")
            raise InvalidOperation("GS390XSTG00009")

        if 'hbaId' not in params:
            wok_log.error("hbaId is required for adding a LUN")
            raise MissingParameter("GS390XSTG00010")

        hbaId = params['hbaId']
        utils.validate_hba_id(hbaId)

        if 'remoteWwpn' not in params:
            wok_log.error("remoteWwpn is required for adding a LUN")
            raise MissingParameter("GS390XSTG00011")

        wwpn = params['remoteWwpn']
        utils.validate_wwpn_or_lun(wwpn)

        if 'lunId' not in params:
            wok_log.error("lunId is required for adding a LUN")
            raise MissingParameter("GS390XSTG00012")

        lunId = params['lunId']
        utils.validate_wwpn_or_lun(lunId)

        try:
            fc_lock.acquire()
            utils.add_lun(hbaId, wwpn, lunId)
        except OperationFailed as e:
            wok_log.error("Adding LUN failed")
            raise OperationFailed("GS390XSTG00003", {'err': e})
        finally:
            fc_lock.release()

        lun_path = hbaId + ":" + wwpn + ":" + lunId
        return lun_path
Exemplo n.º 5
0
    def create(self, params):
        if utils.is_lun_scan_enabled()['current']:
            wok_log.error(
                "Lun scan is enabled. Cannot add/remove LUNs manually.")
            raise InvalidOperation("GS390XSTG00009")

        if 'hbaId' not in params:
            wok_log.error("hbaId is required for adding a LUN")
            raise MissingParameter("GS390XSTG00010")

        hbaId = params['hbaId']
        utils.validate_hba_id(hbaId)

        if 'remoteWwpn' not in params:
            wok_log.error("remoteWwpn is required for adding a LUN")
            raise MissingParameter("GS390XSTG00011")

        wwpn = params['remoteWwpn']
        utils.validate_wwpn_or_lun(wwpn)

        if 'lunId' not in params:
            wok_log.error("lunId is required for adding a LUN")
            raise MissingParameter("GS390XSTG00012")

        lunId = params['lunId']
        utils.validate_wwpn_or_lun(lunId)

        try:
            fc_lock.acquire()
            utils.add_lun(hbaId, wwpn, lunId)
        except OperationFailed as e:
            wok_log.error("Adding LUN failed")
            raise OperationFailed("GS390XSTG00003", {'err': e})
        finally:
            fc_lock.release()

        lun_path = hbaId + ":" + wwpn + ":" + lunId
        return lun_path