Beispiel #1
0
 def lookup(self, name):
     """
     Get the status of LUN scanning
     :return: returns dictionary with key as 'lunscan'
             and value as boolean
     """
     return utils.is_lun_scan_enabled()
Beispiel #2
0
 def lookup(self, name):
     """
     Get the status of LUN scanning
     :return: returns dictionary with key as 'lunscan'
             and value as boolean
     """
     return utils.is_lun_scan_enabled()
Beispiel #3
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
Beispiel #4
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
Beispiel #5
0
    def delete(self, path):
        if utils.is_lun_scan_enabled():
            wok_log.error("Lun scan is enabled. Cannot add/remote LUNs manually.")
            raise InvalidOperation("GS390XSTG00009")

        path_components = utils.validate_lun_path(path)
        utils.remove_lun(*path_components)
Beispiel #6
0
    def delete(self, path):
        if utils.is_lun_scan_enabled():
            wok_log.error(
                "Lun scan is enabled. Cannot add/remote LUNs manually.")
            raise InvalidOperation("GS390XSTG00009")

        path_components = utils.validate_lun_path(path)
        utils.remove_lun(*path_components)
Beispiel #7
0
    def delete(self, path):
        if utils.is_lun_scan_enabled()['current']:
            wok_log.error(
                "Lun scan is enabled. Cannot add/remote LUNs manually.")
            raise InvalidOperation("GS390XSTG00009")

        path_components = utils.validate_lun_path(path)
        try:
            fc_lock.acquire()
            utils.remove_lun(*path_components)
        except OperationFailed as e:
            wok_log.error("Removing LUN failed")
            raise OperationFailed("GS390XSTG00002", {'err': e})
        finally:
            fc_lock.release()
Beispiel #8
0
    def delete(self, path):
        if utils.is_lun_scan_enabled()['current']:
            wok_log.error(
                "Lun scan is enabled. Cannot add/remote LUNs manually.")
            raise InvalidOperation("GS390XSTG00009")

        path_components = utils.validate_lun_path(path)
        try:
            fc_lock.acquire()
            utils.remove_lun(*path_components)
        except OperationFailed as e:
            wok_log.error("Removing LUN failed")
            raise OperationFailed("GS390XSTG00002", {'err': e})
        finally:
            fc_lock.release()
Beispiel #9
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
Beispiel #10
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
Beispiel #11
0
 def disable(self, name):
     """
     Disable LUN scanning
     """
     utils.enable_lun_scan("0")
     return utils.is_lun_scan_enabled()
Beispiel #12
0
 def enable(self, name):
     """
     Enable LUN scanning
     """
     utils.enable_lun_scan("1")
     return utils.is_lun_scan_enabled()
Beispiel #13
0
 def disable(self, name):
     """
     Disable LUN scanning
     """
     utils.enable_lun_scan("0")
     return utils.is_lun_scan_enabled()
Beispiel #14
0
 def enable(self, name):
     """
     Enable LUN scanning
     """
     utils.enable_lun_scan("1")
     return utils.is_lun_scan_enabled()