From 6306d26331925ffb1c20ee32ed482bdae10deaf7 Mon Sep 17 00:00:00 2001 From: guankc <80501304+guankc@users.noreply.github.com> Date: Fri, 8 Apr 2022 09:21:38 +0800 Subject: [PATCH 01/10] Fix the netApp model obtaining error Fix the netApp model obtaining error --- delfin/drivers/netapp/dataontap/netapp_handler.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/delfin/drivers/netapp/dataontap/netapp_handler.py b/delfin/drivers/netapp/dataontap/netapp_handler.py index ad4075c8c..47787e380 100644 --- a/delfin/drivers/netapp/dataontap/netapp_handler.py +++ b/delfin/drivers/netapp/dataontap/netapp_handler.py @@ -173,7 +173,10 @@ def get_storage(self): system_info, storage_map_list, split=':') if len(storage_map_list) > 0: storage_map = storage_map_list[-1] - controller_map = controller_map_list[1] + controller = {} + for controller_map in controller_map_list[1:]: + if controller_map['Model'] != '--': + controller = controller_map for disk in disk_list: raw_capacity += disk['capacity'] for pool in pool_list: @@ -183,11 +186,11 @@ def get_storage(self): storage_model = { "name": storage_map['ClusterName'], "vendor": constant.STORAGE_VENDOR, - "model": controller_map['Model'], + "model": controller['Model'], "status": status, "serial_number": storage_map['ClusterSerialNumber'], "firmware_version": storage_version[0], - "location": controller_map['Location'], + "location": controller['Location'], "total_capacity": total_capacity, "raw_capacity": raw_capacity, "used_capacity": used_capacity, From 08b821bf69dc0f98cd7edb8f074df4f3145c2136 Mon Sep 17 00:00:00 2001 From: guankc <80501304+guankc@users.noreply.github.com> Date: Fri, 8 Apr 2022 09:30:28 +0800 Subject: [PATCH 02/10] Update netapp_handler.py --- delfin/drivers/netapp/dataontap/netapp_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/delfin/drivers/netapp/dataontap/netapp_handler.py b/delfin/drivers/netapp/dataontap/netapp_handler.py index 47787e380..2f1b35467 100644 --- a/delfin/drivers/netapp/dataontap/netapp_handler.py +++ b/delfin/drivers/netapp/dataontap/netapp_handler.py @@ -175,7 +175,7 @@ def get_storage(self): storage_map = storage_map_list[-1] controller = {} for controller_map in controller_map_list[1:]: - if controller_map['Model'] != '--': + if controller_map['Model'] != '-': controller = controller_map for disk in disk_list: raw_capacity += disk['capacity'] From 4d1e06ef82ec5774c70d5c45d8518e498e04fc04 Mon Sep 17 00:00:00 2001 From: guankc <80501304+guankc@users.noreply.github.com> Date: Fri, 8 Apr 2022 09:32:54 +0800 Subject: [PATCH 03/10] Update netapp_handler.py --- delfin/drivers/netapp/dataontap/netapp_handler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/delfin/drivers/netapp/dataontap/netapp_handler.py b/delfin/drivers/netapp/dataontap/netapp_handler.py index 2f1b35467..58439afd1 100644 --- a/delfin/drivers/netapp/dataontap/netapp_handler.py +++ b/delfin/drivers/netapp/dataontap/netapp_handler.py @@ -173,10 +173,12 @@ def get_storage(self): system_info, storage_map_list, split=':') if len(storage_map_list) > 0: storage_map = storage_map_list[-1] - controller = {} + controller = None for controller_map in controller_map_list[1:]: if controller_map['Model'] != '-': controller = controller_map + continue + controller = controller_map_list[1] for disk in disk_list: raw_capacity += disk['capacity'] for pool in pool_list: From cfc69f2e8d734b7569c24fa3caac993f437c9b13 Mon Sep 17 00:00:00 2001 From: guankc <80501304+guankc@users.noreply.github.com> Date: Fri, 8 Apr 2022 10:45:52 +0800 Subject: [PATCH 04/10] Update netapp_handler.py Performance data not obtained Data capture exception return null --- delfin/drivers/netapp/dataontap/netapp_handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/delfin/drivers/netapp/dataontap/netapp_handler.py b/delfin/drivers/netapp/dataontap/netapp_handler.py index 58439afd1..ea01a849e 100644 --- a/delfin/drivers/netapp/dataontap/netapp_handler.py +++ b/delfin/drivers/netapp/dataontap/netapp_handler.py @@ -1019,7 +1019,8 @@ def do_rest_call(self, url, data): elif res.status_code == constant.FORBIDDEN_RETURN_CODE: raise exception.InvalidUsernameOrPassword() elif res.status_code == constant.NOT_FOUND_RETURN_CODE: - raise exception.NotFound() + LOG.error('Url did not get results url:%s' % url) + return [] elif res.status_code == constant.METHOD_NOT_ALLOWED_CODE: raise exception.Invalid() elif res.status_code == constant.CONFLICT_RETURN_CODE: From 4d068f958904f82fb88a52f723c6f1d07adb37f2 Mon Sep 17 00:00:00 2001 From: guankc <80501304+guankc@users.noreply.github.com> Date: Fri, 22 Apr 2022 10:30:31 +0800 Subject: [PATCH 05/10] Modify obtaining the cluster serial number Modify obtaining the cluster serial number --- delfin/drivers/netapp/dataontap/netapp_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/delfin/drivers/netapp/dataontap/netapp_handler.py b/delfin/drivers/netapp/dataontap/netapp_handler.py index ea01a849e..cfe05c5a0 100644 --- a/delfin/drivers/netapp/dataontap/netapp_handler.py +++ b/delfin/drivers/netapp/dataontap/netapp_handler.py @@ -190,7 +190,7 @@ def get_storage(self): "vendor": constant.STORAGE_VENDOR, "model": controller['Model'], "status": status, - "serial_number": storage_map['ClusterSerialNumber'], + "serial_number": storage_map['ClusterUUID'], "firmware_version": storage_version[0], "location": controller['Location'], "total_capacity": total_capacity, From a5affb9c0264c36e0d761275c0a47931c324af93 Mon Sep 17 00:00:00 2001 From: guankc <80501304+guankc@users.noreply.github.com> Date: Fri, 22 Apr 2022 17:05:51 +0800 Subject: [PATCH 06/10] Update netapp_handler.py --- delfin/drivers/netapp/dataontap/netapp_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/delfin/drivers/netapp/dataontap/netapp_handler.py b/delfin/drivers/netapp/dataontap/netapp_handler.py index cfe05c5a0..e8ee94fb5 100644 --- a/delfin/drivers/netapp/dataontap/netapp_handler.py +++ b/delfin/drivers/netapp/dataontap/netapp_handler.py @@ -1099,7 +1099,7 @@ def get_storage_perf(self, metrics, storage_id, start_time, end_time): get_perf_value(metrics, storage_id, start_time, end_time, json_info, - storage['ClusterSerialNumber'], + storage['ClusterUUID'], storage['ClusterName'], constants.ResourceType.STORAGE) return storage_metrics From 04dec4e8e7ee29e16aaaaee187c8b64ee4527622 Mon Sep 17 00:00:00 2001 From: guankc <80501304+guankc@users.noreply.github.com> Date: Sun, 24 Apr 2022 19:31:38 +0800 Subject: [PATCH 07/10] Update netapp_handler.py --- delfin/drivers/netapp/dataontap/netapp_handler.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/delfin/drivers/netapp/dataontap/netapp_handler.py b/delfin/drivers/netapp/dataontap/netapp_handler.py index e8ee94fb5..482aa8119 100644 --- a/delfin/drivers/netapp/dataontap/netapp_handler.py +++ b/delfin/drivers/netapp/dataontap/netapp_handler.py @@ -190,7 +190,9 @@ def get_storage(self): "vendor": constant.STORAGE_VENDOR, "model": controller['Model'], "status": status, - "serial_number": storage_map['ClusterUUID'], + "serial_number": + storage_map['ClusterUUID'] + + '_' + storage_map['ClusterSerialNumber'], "firmware_version": storage_version[0], "location": controller['Location'], "total_capacity": total_capacity, @@ -1099,7 +1101,8 @@ def get_storage_perf(self, metrics, storage_id, start_time, end_time): get_perf_value(metrics, storage_id, start_time, end_time, json_info, - storage['ClusterUUID'], + storage['ClusterUUID'] + '_' + + storage['ClusterSerialNumber'], storage['ClusterName'], constants.ResourceType.STORAGE) return storage_metrics From 877f30ed3ddf785442d0517767e49405930664ec Mon Sep 17 00:00:00 2001 From: guankc <80501304+guankc@users.noreply.github.com> Date: Sun, 24 Apr 2022 19:41:00 +0800 Subject: [PATCH 08/10] Update netapp_handler.py --- delfin/drivers/netapp/dataontap/netapp_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/delfin/drivers/netapp/dataontap/netapp_handler.py b/delfin/drivers/netapp/dataontap/netapp_handler.py index 482aa8119..4a7bcdf55 100644 --- a/delfin/drivers/netapp/dataontap/netapp_handler.py +++ b/delfin/drivers/netapp/dataontap/netapp_handler.py @@ -1101,7 +1101,7 @@ def get_storage_perf(self, metrics, storage_id, start_time, end_time): get_perf_value(metrics, storage_id, start_time, end_time, json_info, - storage['ClusterUUID'] + '_' + storage['ClusterUUID'] + '_' + storage['ClusterSerialNumber'], storage['ClusterName'], constants.ResourceType.STORAGE) From 73a4bb8d8d775cae50a5bdee6f7f3bc8e12a70c6 Mon Sep 17 00:00:00 2001 From: guankc <80501304+guankc@users.noreply.github.com> Date: Mon, 25 Apr 2022 10:14:12 +0800 Subject: [PATCH 09/10] Update netapp_handler.py --- delfin/drivers/netapp/dataontap/netapp_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/delfin/drivers/netapp/dataontap/netapp_handler.py b/delfin/drivers/netapp/dataontap/netapp_handler.py index 4a7bcdf55..08898b050 100644 --- a/delfin/drivers/netapp/dataontap/netapp_handler.py +++ b/delfin/drivers/netapp/dataontap/netapp_handler.py @@ -192,7 +192,7 @@ def get_storage(self): "status": status, "serial_number": storage_map['ClusterUUID'] + - '_' + storage_map['ClusterSerialNumber'], + ':' + storage_map['ClusterSerialNumber'], "firmware_version": storage_version[0], "location": controller['Location'], "total_capacity": total_capacity, @@ -1101,7 +1101,7 @@ def get_storage_perf(self, metrics, storage_id, start_time, end_time): get_perf_value(metrics, storage_id, start_time, end_time, json_info, - storage['ClusterUUID'] + '_' + storage['ClusterUUID'] + :' + storage['ClusterSerialNumber'], storage['ClusterName'], constants.ResourceType.STORAGE) From d01190d693b965dca42ce4fb8ec288e59ace15e8 Mon Sep 17 00:00:00 2001 From: guankc <80501304+guankc@users.noreply.github.com> Date: Mon, 9 May 2022 16:13:28 +0800 Subject: [PATCH 10/10] Update netapp_handler.py --- delfin/drivers/netapp/dataontap/netapp_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/delfin/drivers/netapp/dataontap/netapp_handler.py b/delfin/drivers/netapp/dataontap/netapp_handler.py index 08898b050..a791671f8 100644 --- a/delfin/drivers/netapp/dataontap/netapp_handler.py +++ b/delfin/drivers/netapp/dataontap/netapp_handler.py @@ -1101,7 +1101,7 @@ def get_storage_perf(self, metrics, storage_id, start_time, end_time): get_perf_value(metrics, storage_id, start_time, end_time, json_info, - storage['ClusterUUID'] + :' + storage['ClusterUUID'] + ':' + storage['ClusterSerialNumber'], storage['ClusterName'], constants.ResourceType.STORAGE)