QNAP: Add support for QES 2.0.0

This patch do the following change to the QNAP Cinder driver:
1. Add support for QNAP QES firmware 2.0.0.

Change-Id: Iae006115e46e20fb354d1db8a09ff4df9810aa44
Implements: blueprint qnap-support-qes-200
This commit is contained in:
Chris Yang 2017-12-11 13:58:46 +08:00
parent cf03b14b09
commit 5c32be5a6d
2 changed files with 14 additions and 8 deletions

View File

@ -73,13 +73,15 @@ class QnapISCSIDriver(san.SanISCSIDriver):
1.2.001: 1.2.001:
Add supports for Thin Provisioning, SSD Cache, Deduplication Add supports for Thin Provisioning, SSD Cache, Deduplication
, Compression and CHAP. , Compression and CHAP.
1.2.002:
Add support for QES fw 2.0.0.
""" """
# ThirdPartySystems wiki page # ThirdPartySystems wiki page
CI_WIKI_NAME = "QNAP_CI" CI_WIKI_NAME = "QNAP_CI"
VERSION = '1.2.001' VERSION = '1.2.002'
TIME_INTERVAL = 3 TIME_INTERVAL = 3
@ -178,7 +180,7 @@ class QnapISCSIDriver(san.SanISCSIDriver):
es_model_types = [ es_model_types = [
"ES" "ES"
] ]
LOG.debug('fw_version: %s', fw_version)
if model_type in ts_model_types: if model_type in ts_model_types:
if (fw_version >= "4.2") and (fw_version <= "4.4"): if (fw_version >= "4.2") and (fw_version <= "4.4"):
LOG.debug('Create TS API Executor') LOG.debug('Create TS API Executor')
@ -203,14 +205,14 @@ class QnapISCSIDriver(san.SanISCSIDriver):
username=self.configuration.san_login, username=self.configuration.san_login,
password=self.configuration.san_password, password=self.configuration.san_password,
management_url=self.configuration.qnap_management_url)) management_url=self.configuration.qnap_management_url))
elif (fw_version >= "1.1.2") or (fw_version <= "1.1.4"): elif "1.1.2" <= fw_version <= "2.0.9999":
LOG.debug('Create TES API Executor') LOG.debug('Create TES API Executor')
return (QnapAPIExecutorTES( return (QnapAPIExecutorTES(
username=self.configuration.san_login, username=self.configuration.san_login,
password=self.configuration.san_password, password=self.configuration.san_password,
management_url=self.configuration.qnap_management_url)) management_url=self.configuration.qnap_management_url))
elif model_type in es_model_types: elif model_type in es_model_types:
if (fw_version >= "1.1.2") or (fw_version <= "1.1.4"): if "1.1.2" <= fw_version <= "2.0.9999":
LOG.debug('Create ES API Executor') LOG.debug('Create ES API Executor')
return (QnapAPIExecutor( return (QnapAPIExecutor(
username=self.configuration.san_login, username=self.configuration.san_login,
@ -383,7 +385,7 @@ class QnapISCSIDriver(san.SanISCSIDriver):
LOG.debug('in ES FW before 1.1.2/1.1.3: get_lun_info') LOG.debug('in ES FW before 1.1.2/1.1.3: get_lun_info')
del_lun = self.api_executor.get_lun_info( del_lun = self.api_executor.get_lun_info(
LUNIndex=lun_index) LUNIndex=lun_index)
elif fw_version == "1.1.4": elif "1.1.4" <= fw_version <= "2.0.9999":
LOG.debug('in ES FW after 1.1.4: get_one_lun_info') LOG.debug('in ES FW after 1.1.4: get_one_lun_info')
ret = self.api_executor.get_one_lun_info(lun_index) ret = self.api_executor.get_one_lun_info(lun_index)
del_lun = (ET.fromstring(ret['data']).find('LUNInfo') del_lun = (ET.fromstring(ret['data']).find('LUNInfo')
@ -818,7 +820,7 @@ class QnapISCSIDriver(san.SanISCSIDriver):
LOG.debug('in ES FW before 1.1.2/1.1.3: get_lun_info') LOG.debug('in ES FW before 1.1.2/1.1.3: get_lun_info')
selected_lun = self.api_executor.get_lun_info( selected_lun = self.api_executor.get_lun_info(
LUNNAA=lun_naa) LUNNAA=lun_naa)
elif fw_version == "1.1.4": elif "1.1.4" <= fw_version <= "2.0.9999":
LOG.debug('in ES FW after 1.1.4: get_one_lun_info') LOG.debug('in ES FW after 1.1.4: get_one_lun_info')
ret = self.api_executor.get_one_lun_info(lun_index) ret = self.api_executor.get_one_lun_info(lun_index)
selected_lun = (ET.fromstring(ret['data']).find('LUNInfo') selected_lun = (ET.fromstring(ret['data']).find('LUNInfo')
@ -871,7 +873,7 @@ class QnapISCSIDriver(san.SanISCSIDriver):
eventlet.sleep(self.TIME_INTERVAL) eventlet.sleep(self.TIME_INTERVAL)
if(try_times > max_wait_sec or LUNNumber != ""): if(try_times > max_wait_sec or LUNNumber != ""):
break break
elif fw_version == "1.1.4": elif "1.1.4" <= fw_version <= "2.0.9999":
LOG.debug('in ES FW after 1.1.4: get_one_lun_info') LOG.debug('in ES FW after 1.1.4: get_one_lun_info')
ret = self.api_executor.get_one_lun_info(lun_index) ret = self.api_executor.get_one_lun_info(lun_index)
root = ET.fromstring(ret['data']) root = ET.fromstring(ret['data'])
@ -1017,7 +1019,7 @@ class QnapISCSIDriver(san.SanISCSIDriver):
LOG.debug('in ES FW before 1.1.2/1.1.3: get_lun_info') LOG.debug('in ES FW before 1.1.2/1.1.3: get_lun_info')
selected_lun = self.api_executor.get_lun_info( selected_lun = self.api_executor.get_lun_info(
LUNIndex=lun_index) LUNIndex=lun_index)
elif fw_version == "1.1.4": elif "1.1.4" <= fw_version <= "2.0.9999":
LOG.debug('in ES FW after 1.1.4: get_one_lun_info') LOG.debug('in ES FW after 1.1.4: get_one_lun_info')
ret = self.api_executor.get_one_lun_info(lun_index) ret = self.api_executor.get_one_lun_info(lun_index)
selected_lun = (ET.fromstring(ret['data']).find('LUNInfo') selected_lun = (ET.fromstring(ret['data']).find('LUNInfo')

View File

@ -0,0 +1,4 @@
---
features:
- |
QNAP Cinder driver added support for QES fw 2.0.0.