From 33beb7464d03ea576c2075d8a058113136efd862 Mon Sep 17 00:00:00 2001 From: "yaohua.wu" Date: Fri, 3 Jul 2026 11:14:58 +0800 Subject: [PATCH] [zwatch]: migrate VRouter CPU alarm metric Backport the VPC router CPU alarm metric migration to 5.4.10. 1. Why? The one-click VPC router CPU alarm should use external monitoring data. Existing templates and alarms still point to the average VRouter metric. 2. How? Add an idempotent 5.4.10 schema update to move the active template and related alarms to CPUUsedUtilization. 3. Side effects? None. The UPDATE statements only match rows with the old metric name. # Summary of changes (by module): - db upgrade: migrate VPC router active alarm metric names. Related: ZSTAC-86505 Change-Id: I6d085c36d6a46f408c8905302cf36f83aea4c2cc --- conf/db/upgrade/V5.4.10__schema.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/conf/db/upgrade/V5.4.10__schema.sql b/conf/db/upgrade/V5.4.10__schema.sql index e69de29bb2d..94a47bb0966 100644 --- a/conf/db/upgrade/V5.4.10__schema.sql +++ b/conf/db/upgrade/V5.4.10__schema.sql @@ -0,0 +1,12 @@ +UPDATE `zstack`.`ActiveAlarmTemplateVO` +SET `metricName` = 'CPUUsedUtilization' +WHERE `uuid` = 'c9e6cdca107140bea62b4ca919ff9e88' + AND `metricName` = 'VRouterCPUAverageUsedUtilization'; + +UPDATE `zstack`.`AlarmVO` +SET `metricName` = 'CPUUsedUtilization' +WHERE `uuid` IN ( + SELECT `alarmUuid` FROM `zstack`.`ActiveAlarmVO` + WHERE `templateUuid` = 'c9e6cdca107140bea62b4ca919ff9e88' +) + AND `metricName` = 'VRouterCPUAverageUsedUtilization';