Skip to content

Commit 71013b6

Browse files
author
Daman Arora
committed
fix SystemVM template URL update for S3 secondary storage
1 parent 28a6564 commit 71013b6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

engine/schema/src/main/java/com/cloud/upgrade/SystemVmTemplateRegistration.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ public void registerTemplates(List<Pair<Hypervisor.HypervisorType, CPU.CPUArch>>
960960
public void doInTransactionWithoutResult(final TransactionStatus status) {
961961
List<Long> zoneIds = getEligibleZoneIds();
962962
if (zoneIds.isEmpty()) {
963-
updateTemplateUrlsForNonNfsStores(hypervisorsArchInUse);
963+
updateSystemVmTemplateUrlsForNonNfsStores();
964964
return;
965965
}
966966
for (Long zoneId : zoneIds) {
@@ -988,8 +988,9 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
988988
}
989989
}
990990

991-
private void updateTemplateUrlsForNonNfsStores(List<Pair<Hypervisor.HypervisorType, CPU.CPUArch>> hypervisorsInUse) {
992-
for (Pair<Hypervisor.HypervisorType, CPU.CPUArch> hypervisorArch : hypervisorsInUse) {
991+
public void updateSystemVmTemplateUrlsForNonNfsStores() {
992+
for (Pair<Hypervisor.HypervisorType, CPU.CPUArch> hypervisorArch :
993+
clusterDao.listDistinctHypervisorsArchAcrossClusters(null)) {
993994
MetadataTemplateDetails templateDetails = getMetadataTemplateDetails(hypervisorArch.first(), hypervisorArch.second());
994995
if (templateDetails == null) {
995996
continue;

server/src/main/java/com/cloud/storage/StorageManagerImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3585,6 +3585,7 @@ public ImageStore discoverImageStore(String name, String url, String providerNam
35853585

35863586
if (((ImageStoreProvider)storeProvider).needDownloadSysTemplate()) {
35873587
// trigger system vm template download
3588+
new SystemVmTemplateRegistration().updateSystemVmTemplateUrlsForNonNfsStores();
35883589
_imageSrv.downloadBootstrapSysTemplate(store);
35893590
} else {
35903591
// populate template_store_ref table

0 commit comments

Comments
 (0)