From 7ed9fb866bb8b06ef745f0b834e683a493410279 Mon Sep 17 00:00:00 2001 From: huangpeng <1298695987@qq.com> Date: Tue, 23 Jul 2024 20:57:31 +0800 Subject: [PATCH 1/2] 1.Driver do not report provision capacity. 2.Driver set qos to unlimited. --- .../.customization_for_suyan.py.swp | Bin 0 -> 16384 bytes .../driver_api/check_update_storage.py | 4 -- .../driver_api/customization_for_suyan.py | 55 +++++------------- 3 files changed, 15 insertions(+), 44 deletions(-) create mode 100644 Manila/file_driver_dir/huawei/oceanstorPacific/driver_api/.customization_for_suyan.py.swp diff --git a/Manila/file_driver_dir/huawei/oceanstorPacific/driver_api/.customization_for_suyan.py.swp b/Manila/file_driver_dir/huawei/oceanstorPacific/driver_api/.customization_for_suyan.py.swp new file mode 100644 index 0000000000000000000000000000000000000000..6d028184bede8d6584c1230fbd8cf4156eecaaab GIT binary patch literal 16384 zcmeHNZEPGz8Qz4JmWGxJB!mP)!-dLcdf9VQ5Rp-kT*qlGoU`%S4N(ZodUx(_l)atH ze&lkEA`(PfM

rRcJ%hCbUfvhy<#r`6`sJf35hB#4nV)Iw}5&CeUS?lp|Jo_($|^YPn^mve>@a2|=`wJz#} zo3`2`bgg>D8n4shjyPo8FGoDEtJIoqQ2e%?eb)AX9iTyRr|mP(E>@UFEmsy^X*b@r$oLBCbuffdFr+cz7nwG7MT83XTk2I8o) zY3tqd4{X^yB3#{=`waQmN9W(~UT6Mg3}g&s3}g&s3}g&s3}g&s3}g)SFc3BFFusNV z>vfrxP|4YkDy8L3F{9P^ohAv;PZ;;&QpIW|0%fHzt|A&^BwftJ2 z{2eX7N6YWg4kh|^arTulkTH-kkTH-kkTH-kkTH-kkTH-kkTH-k@PEmGjTd?Gs{9l2 zqKy6j&mT67tH5JG1)#t~zz$#n_$2W52E#Z9P+$iz4CH}zz@P3ij3wX%un#B!d0;)z z{*Yn(7B~rbz&>Cb@Co4ecN)g;fEKVFc;^no_zm!D;0M4#;LE_fdfMhg z>QxG)rz9L6HDqnkBA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@ z_5ee`oxmln@sSPu%h`DMjVrZ18l|Z=)t5)__)hUn> ob0lRyQ6|2%LM%qOH&-R4N=dq>utJLne7C*WG*Fhv;^BhvA9lQPGXMYp literal 0 HcmV?d00001 diff --git a/Manila/file_driver_dir/huawei/oceanstorPacific/driver_api/check_update_storage.py b/Manila/file_driver_dir/huawei/oceanstorPacific/driver_api/check_update_storage.py index 1432f95..45b8fc9 100644 --- a/Manila/file_driver_dir/huawei/oceanstorPacific/driver_api/check_update_storage.py +++ b/Manila/file_driver_dir/huawei/oceanstorPacific/driver_api/check_update_storage.py @@ -95,18 +95,14 @@ def update_storage_pool(self, data, free_pool): result = self.helper.query_pool_by_id(pool_id) if result: total = round(float(result['totalCapacity']) / 1024, 1) - allocated = round(float(result['allocatedCapacity']) / 1024, 1) used = round(float(result['usedCapacity']) / 1024, 1) free = round(float(total) - float(used), 2) - provisioned = used pool = dict( huawei_smartpartition=True, huawei_smartcache=True, pool_name=result['storagePoolName'], qos=True, compression=True, - provisioned_capacity_gb=provisioned, - allocated_capacity_gb=allocated, free_capacity_gb=free, total_capacity_gb=total, reserved_percentage=reserved_percentage, diff --git a/Manila/file_driver_dir/huawei/oceanstorPacific/driver_api/customization_for_suyan.py b/Manila/file_driver_dir/huawei/oceanstorPacific/driver_api/customization_for_suyan.py index 671cc80..66d7ffd 100644 --- a/Manila/file_driver_dir/huawei/oceanstorPacific/driver_api/customization_for_suyan.py +++ b/Manila/file_driver_dir/huawei/oceanstorPacific/driver_api/customization_for_suyan.py @@ -146,22 +146,10 @@ def _get_max_band_width_qos_config(self, extra_specs): 苏研单独的qos 参数设置与读取,其支持的参数如下: “total_bytes_sec”:总吞吐量,单位Byte/s “total_iops_sec”: 总IOPS,单位个/s - 此处解析 max_band_width,从total_bytes_sec获取 + 此处解析 max_band_width,从total_bytes_sec获取 """ - # the total_bytes_sec is Byte/s the pacific need MB/s - tmp_max_band_width = extra_specs.get('pacific:total_bytes_sec') - if tmp_max_band_width is None: - self.qos_config['max_band_width'] = constants.MAX_BAND_WIDTH - elif (tmp_max_band_width.strip().isdigit() - and 0 <= int(int(tmp_max_band_width.strip()) / constants.BYTE_TO_MB) - <= constants.BAND_WIDTH_UPPER_LIMIT): - self.qos_config['max_band_width'] = int(math.ceil(float( - tmp_max_band_width.strip()) / constants.BYTE_TO_MB)) - else: - err_msg = _("The total_bytes_sec in share type " - "must be int([0, %s]).") % constants.BAND_WIDTH_UPPER_LIMIT - raise exception.InvalidInput(reason=err_msg) - + self.qos_config['max_band_width'] = 0 + def _get_max_iops_qos_config(self, extra_specs): """ 苏研单独的qos 参数设置与读取,其支持的参数如下: @@ -169,16 +157,7 @@ def _get_max_iops_qos_config(self, extra_specs): “total_iops_sec”: 总IOPS,单位个/s 此处解析 max_iops,从total_iops_sec获取 """ - tmp_max_iops = extra_specs.get('pacific:total_iops_sec') - if tmp_max_iops is None: - self.qos_config['max_iops'] = constants.MAX_IOPS - elif tmp_max_iops.strip().isdigit() \ - and 0 <= int(tmp_max_iops.strip()) <= constants.MAX_IOPS_UPPER_LIMIT: - self.qos_config['max_iops'] = int(tmp_max_iops.strip()) - else: - err_msg = _("The max_iops in share type " - "must be int([0, %s]).") % constants.MAX_IOPS_UPPER_LIMIT - raise exception.InvalidInput(reason=err_msg) + self.qos_config['max_iops'] = 0 def _create_qos(self): qos_name = self.namespace_name @@ -219,21 +198,17 @@ def _get_update_qos_config(self, qos_specs): LOG.error(err_msg) raise exception.InvalidShare(reason=err_msg) - tmp_max_band_width = str(qos_specs.get('total_bytes_sec')) - if int(tmp_max_band_width) == 0: - self.qos_config['max_band_width'] = constants.MAX_BAND_WIDTH - elif (tmp_max_band_width.strip().isdigit() - and 0 <= int(int(tmp_max_band_width.strip()) / constants.BYTE_TO_MB) - <= constants.BAND_WIDTH_UPPER_LIMIT): - self.qos_config['max_band_width'] = int(math.ceil(float( - tmp_max_band_width.strip()) / constants.BYTE_TO_MB)) - - tmp_max_iops = str(qos_specs.get('total_iops_sec')) - if int(tmp_max_iops) == 0: - self.qos_config['max_iops'] = constants.MAX_IOPS - elif tmp_max_iops.strip().isdigit() \ - and 0 <= int(tmp_max_iops.strip()) <= constants.MAX_IOPS_UPPER_LIMIT: - self.qos_config['max_iops'] = int(tmp_max_iops.strip()) + # total_bytes_sec and total_iops_sec must be integer + tmp_max_band_width = str(qos_specs.get('total_bytes_sec')).strip() + tmp_max_iops = str(qos_specs.get('total_iops_sec')).strip() + if not (tmp_max_band_width.isdigit() and tmp_max_iops.isdigit()): + err_msg = "total_bytes_sec and total_iops_sec must be integer, " \ + "the qos_specs is {0}".format(qos_specs) + LOG.error(err_msg) + raise exception.InvalidShare(reason=err_msg) + + self.qos_config['max_band_width'] = int(math.ceil(float(tmp_max_band_width) / (1024 ** 2))) + self.qos_config['max_iops'] = int(tmp_max_iops) def _create_qos_when_update_qos(self, qos_name): try: From 0e25c23c44be0865fa0708aede06ea62e0d40bde Mon Sep 17 00:00:00 2001 From: huangpeng <1298695987@qq.com> Date: Tue, 23 Jul 2024 21:02:58 +0800 Subject: [PATCH 2/2] 1.Driver do not report provision capacity 2.Driver set qos to unlimited. --- .../driver_api/.customization_for_suyan.py.swp | Bin 16384 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Manila/file_driver_dir/huawei/oceanstorPacific/driver_api/.customization_for_suyan.py.swp diff --git a/Manila/file_driver_dir/huawei/oceanstorPacific/driver_api/.customization_for_suyan.py.swp b/Manila/file_driver_dir/huawei/oceanstorPacific/driver_api/.customization_for_suyan.py.swp deleted file mode 100644 index 6d028184bede8d6584c1230fbd8cf4156eecaaab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 zcmeHNZEPGz8Qz4JmWGxJB!mP)!-dLcdf9VQ5Rp-kT*qlGoU`%S4N(ZodUx(_l)atH ze&lkEA`(PfM

rRcJ%hCbUfvhy<#r`6`sJf35hB#4nV)Iw}5&CeUS?lp|Jo_($|^YPn^mve>@a2|=`wJz#} zo3`2`bgg>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