This is an automated email from the ASF dual-hosted git repository.
abhisar pushed a commit to branch 4.20
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.20 by this push:
new e2497cfc4df backport: default system vm template update implementation
(#12935)
e2497cfc4df is described below
commit e2497cfc4df7daa13167ad2cf12e2eed782b0558
Author: Abhishek Kumar <[email protected]>
AuthorDate: Wed Apr 1 15:34:04 2026 +0530
backport: default system vm template update implementation (#12935)
Fixes #12934
Backported from 889fc62
Signed-off-by: Abhishek Kumar <[email protected]>
---
.../com/cloud/upgrade/dao/DbUpgradeSystemVmTemplate.java | 16 +++++++++++++++-
.../java/com/cloud/upgrade/dao/Upgrade42020to42030.java | 4 ----
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git
a/engine/schema/src/main/java/com/cloud/upgrade/dao/DbUpgradeSystemVmTemplate.java
b/engine/schema/src/main/java/com/cloud/upgrade/dao/DbUpgradeSystemVmTemplate.java
index 4211898adc7..a8d2436672e 100644
---
a/engine/schema/src/main/java/com/cloud/upgrade/dao/DbUpgradeSystemVmTemplate.java
+++
b/engine/schema/src/main/java/com/cloud/upgrade/dao/DbUpgradeSystemVmTemplate.java
@@ -17,9 +17,23 @@
package com.cloud.upgrade.dao;
+import com.cloud.upgrade.SystemVmTemplateRegistration;
+import com.cloud.utils.exception.CloudRuntimeException;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
import java.sql.Connection;
public interface DbUpgradeSystemVmTemplate {
- void updateSystemVmTemplates(Connection conn);
+ default void updateSystemVmTemplates(Connection conn) {
+ Logger logger = LogManager.getLogger(getClass());
+ logger.debug("Updating System Vm template IDs");
+ try {
+ SystemVmTemplateRegistration systemVmTemplateRegistration = new
SystemVmTemplateRegistration("");
+ systemVmTemplateRegistration.updateSystemVmTemplates(conn);
+ } catch (Exception e) {
+ throw new CloudRuntimeException("Failed to find / register
SystemVM template(s)");
+ }
+ }
}
diff --git
a/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42020to42030.java
b/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42020to42030.java
index 68100e16401..e0aa38a717b 100644
--- a/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42020to42030.java
+++ b/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42020to42030.java
@@ -57,8 +57,4 @@ public class Upgrade42020to42030 extends
DbUpgradeAbstractImpl implements DbUpgr
public InputStream[] getCleanupScripts() {
return null;
}
-
- @Override
- public void updateSystemVmTemplates(Connection conn) {
- }
}