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
msg = String.format("Upload of template [%s] failed because its owner [%s] does not have enough secondary storage space available.", template.getUuid(), owner.getUuid());
logger.warn(String.format("Zone ID is null, cannot allocate ISO/template in image store [%s].", imageStore));
306
+
returnfalse;
307
+
}
308
+
309
+
DataCenterVOzone = _dcDao.findById(zoneId);
310
+
if (zone == null) {
311
+
logger.warn("Unable to find zone by id [{}], so skip downloading template to its image store [{}].", zoneId, imageStore);
312
+
returnfalse;
313
+
}
314
+
315
+
if (Grouping.AllocationState.Disabled == zone.getAllocationState()) {
316
+
logger.info("Zone [{}] is disabled. Skip downloading template to its image store [{}].", zone, imageStore);
317
+
returnfalse;
318
+
}
319
+
320
+
if (!_statsCollector.imageStoreHasEnoughCapacity(imageStore)) {
321
+
logger.info("Image store doesn't have enough capacity. Skip downloading template to this image store [{}].", imageStore);
322
+
returnfalse;
323
+
}
324
+
325
+
if (zoneSet == null) {
326
+
logger.info(String.format("Zone set is null; therefore, the ISO/template should be allocated in every secondary storage of zone [%s].", zone));
327
+
returntrue;
328
+
}
329
+
330
+
if (isTemplatePrivate && zoneSet.contains(zoneId)) {
331
+
logger.info(String.format("The template is private and it is already allocated in a secondary storage in zone [%s]; therefore, image store [%s] will be skipped.",
332
+
zone, imageStore));
333
+
returnfalse;
334
+
}
335
+
336
+
logger.info(String.format("Private template will be allocated in image store [%s] in zone [%s].", imageStore, zone));
// persist entry in vm_template, vm_template_details and template_zone_ref tables, not that entry at template_store_ref is not created here, and created in createTemplateAsync.
@@ -369,12 +385,67 @@ public List<TemplateOrVolumePostUploadCommand> doInTransaction(TransactionStatus
369
385
if(payloads.isEmpty()) {
370
386
thrownewCloudRuntimeException("unable to find zone or an image store with enough capacity");
* If the template/ISO is marked as private, then it is allocated to a random secondary storage; otherwise, allocates to every storage pool in every zone given by the
0 commit comments