sureshanaparti commented on code in PR #11291:
URL: https://github.com/apache/cloudstack/pull/11291#discussion_r2238591183


##########
engine/schema/src/main/java/com/cloud/upgrade/SystemVmTemplateRegistration.java:
##########
@@ -731,6 +748,7 @@ public void 
registerTemplateForNonExistingEntries(Hypervisor.HypervisorType hype
         Long templateId = null;
         try {
             MetadataTemplateDetails templateDetails = 
getMetadataTemplateDetails(hypervisor, arch);
+            updateSystemVmTemplateGuestOsId();

Review Comment:
   guest os id for debian 5 is hardcoded to 15 (very old entries), later user 
is allowed to add guest os and there are no hardcoded ids. if there are no user 
guest os added, the default id for debian 12 would be 363. this call will 
update the guest os id before registering the non existing systemvm templates. 
Moved this call to _updateSystemVmTemplates()_.
   
   
https://github.com/apache/cloudstack/blob/4aed972e78c44674a2f65683f2f4434bd39de979/engine/schema/src/main/resources/META-INF/db/schema-21to22.sql#L612-L612
   
   
https://github.com/apache/cloudstack/blob/4aed972e78c44674a2f65683f2f4434bd39de979/engine/schema/src/main/resources/META-INF/db/schema-21to22.sql#L962-L963
 
   
   ```
   mysql> SELECT * FROM cloud.guest_os WHERE display_name = 'Debian GNU/Linux 
12 (64-bit)';
   
+-----+-------------+------+--------------------------------------+------------------------------+---------------------+---------+-----------------+---------+
   | id  | category_id | name | uuid                                 | 
display_name                 | created             | removed | is_user_defined 
| display |
   
+-----+-------------+------+--------------------------------------+------------------------------+---------------------+---------+-----------------+---------+
   | 363 |           2 | NULL | 565d58aa-ade8-468d-a829-036e73f11961 | Debian 
GNU/Linux 12 (64-bit) | 2025-07-28 15:13:07 | NULL    |               0 |       
1 |
   
+-----+-------------+------+--------------------------------------+------------------------------+---------------------+---------+-----------------+---------+
   1 row in set (0.00 sec)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to