DaanHoogland commented on a change in pull request #3828: [WIP DO NOT MERGE]
[KVM] Direct download agnostic of the storage provider
URL: https://github.com/apache/cloudstack/pull/3828#discussion_r369454964
##########
File path:
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
##########
@@ -1693,38 +1696,77 @@ private DirectTemplateDownloader
getDirectTemplateDownloaderFromCommand(DirectDo
@Override
public Answer handleDownloadTemplateToPrimaryStorage(DirectDownloadCommand
cmd) {
final PrimaryDataStoreTO pool = cmd.getDestPool();
- if (!pool.getPoolType().equals(StoragePoolType.NetworkFilesystem)) {
- return new DirectDownloadAnswer(false, "Unsupported pool type " +
pool.getPoolType().toString(), true);
- }
- KVMStoragePool destPool =
storagePoolMgr.getStoragePool(pool.getPoolType(), pool.getUuid());
DirectTemplateDownloader downloader;
+ KVMPhysicalDisk template;
try {
- downloader = getDirectTemplateDownloaderFromCommand(cmd, destPool);
- } catch (IllegalArgumentException e) {
- return new DirectDownloadAnswer(false, "Unable to create direct
downloader: " + e.getMessage(), true);
- }
+ s_logger.info("Verifying temporary location for downloading the
template exists on the host");
+ String temporaryDownloadPath =
resource.getDirectDownloadTemporaryDownloadPath();
+ if (!isLocationAccessible(temporaryDownloadPath)) {
+ String msg = "The temporary location path for downloading
templates does not exist: " +
+ temporaryDownloadPath + " on this host";
+ s_logger.error(msg);
+ return new DirectDownloadAnswer(false, msg, true);
+ }
- try {
+ s_logger.info("Checking for free space on the host for downloading
the template");
Review comment:
in this case i would say that if the operator wants info it would be the
actual size found and not an announcement that it is going to be calculated.
also seems debug to me.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services