Commit 208f410
committed
upgrade: consider multiple hypervisors and secondary storages
This fixes an issue during upgrade in edge case.
Steps to reproduce the issue
- deploy an env with ACS 4.18
- the env has multiple hypervisors: KVM and VMware
- the env has multiple secondary storages: sec1 and sec2
- register the new 4.19.1 systemvm template for VMware (systemvm-vmware-4.19.1), but mistakely as a private template.
- the systemvm template is downloaded to sec2 (not sec1). If it is downloaded to sec1, remove it and re-register the template.
- backup the cloudstack databases by `mysqldump -R cloud` and `mysqldump -R cloud_usage`
- install ACS 4.19.1.2 and start mgmt server
Without this PR, got an NPE during mgmt server start
```
2024-10-29 12:46:53,904 ERROR [c.c.u.SystemVmTemplateRegistration] (main:null) (logid:) Failed to register template for hypervisor: VMware
java.lang.NullPointerException
at com.cloud.upgrade.SystemVmTemplateRegistration.updateTemplateDetails(SystemVmTemplateRegistration.java:519)
at com.cloud.upgrade.SystemVmTemplateRegistration.performTemplateRegistrationOperations(SystemVmTemplateRegistration.java:640)
at com.cloud.upgrade.SystemVmTemplateRegistration.registerTemplate(SystemVmTemplateRegistration.java:650)
at com.cloud.upgrade.SystemVmTemplateRegistration$4.doInTransactionWithoutResult(SystemVmTemplateRegistration.java:789)
at com.cloud.utils.db.TransactionCallbackNoReturn.doInTransaction(TransactionCallbackNoReturn.java:25)
```1 parent 03bdf11 commit 208f410
File tree
2 files changed
+9
-6
lines changed- engine/schema/src/main/java/com/cloud/upgrade
- server/src/main/java/com/cloud/storage
2 files changed
+9
-6
lines changedLines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
794 | 794 | | |
795 | 795 | | |
796 | 796 | | |
797 | | - | |
798 | | - | |
799 | | - | |
800 | | - | |
801 | | - | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
802 | 805 | | |
803 | 806 | | |
804 | 807 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3441 | 3441 | | |
3442 | 3442 | | |
3443 | 3443 | | |
3444 | | - | |
| 3444 | + | |
3445 | 3445 | | |
3446 | 3446 | | |
3447 | 3447 | | |
| |||
0 commit comments