You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5360ab3
Browse filesBrowse the repository at this point in the historyBrowse files
Unable to register private template across all Zones - crosszones flag no longer works.
This was because the code skipped the loop after the first download initiation. Introduced a set so that if it is already downloaded to the same zone then skip it for private template.
Copy file name to clipboardExpand all lines: server/src/com/cloud/template/HypervisorTemplateAdapter.java
+21-4Lines changed: 21 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,9 @@
19
19
importjava.net.MalformedURLException;
20
20
importjava.net.URL;
21
21
importjava.util.Collections;
22
+
importjava.util.HashSet;
22
23
importjava.util.List;
24
+
importjava.util.Set;
23
25
importjava.util.concurrent.ExecutionException;
24
26
25
27
importjavax.ejb.Local;
@@ -219,7 +221,8 @@ public VMTemplateVO create(TemplateProfile profile) {
219
221
thrownewCloudRuntimeException("Unable to find image store to download template " + profile.getTemplate());
220
222
}
221
223
222
-
Collections.shuffle(imageStores);// For private templates choose a random store. TODO - Have a better algorithm based on size, no. of objects, load etc.
224
+
Set<Long> zoneSet = newHashSet<Long>();
225
+
Collections.shuffle(imageStores); // For private templates choose a random store. TODO - Have a better algorithm based on size, no. of objects, load etc.
223
226
for (DataStoreimageStore : imageStores) {
224
227
// skip data stores for a disabled zone
225
228
LongzoneId = imageStore.getScope().getScopeId();
@@ -235,6 +238,14 @@ public VMTemplateVO create(TemplateProfile profile) {
235
238
s_logger.info("Zone " + zoneId + " is disabled, so skip downloading template to its image store " + imageStore.getId());
236
239
continue;
237
240
}
241
+
242
+
// We want to download private template to one of the image store in a zone
0 commit comments