[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16310971#comment-16310971
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10146:
---------------------------------------------

marcaurele commented on a change in pull request #2379: CLOUDSTACK-10146: 
Bypass Secondary Storage for KVM templates
URL: https://github.com/apache/cloudstack/pull/2379#discussion_r159596146
 
 

 ##########
 File path: 
plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
 ##########
 @@ -1387,4 +1405,35 @@ public Answer forgetObject(final ForgetObjectCmd cmd) {
         return new Answer(cmd, false, "not implememented yet");
     }
 
+    @Override
+    public Answer handleDownloadTemplateToPrimaryStorage(DirectDownloadCommand 
cmd) {
+        final PrimaryDataStoreTO pool = cmd.getDestPool();
+        if (!pool.getPoolType().equals(StoragePoolType.NetworkFilesystem)) {
+            return new DirectDownloadAnswer(false, "Unsopported pool type " + 
pool.getPoolType().toString());
+        }
+        KVMStoragePool destPool = 
storagePoolMgr.getStoragePool(pool.getPoolType(), pool.getUuid());
+        DirectTemplateDownloader downloader;
+
+        if (cmd instanceof HttpDirectDownloadCommand) {
+            downloader = new HttpDirectTemplateDownloader(cmd.getUrl(), 
cmd.getTemplateId(), destPool.getLocalPath(), cmd.getChecksum(), 
((HttpDirectDownloadCommand) cmd).getHeaders());
+        } else if (cmd instanceof NfsDirectDownloadCommand) {
+            downloader = new NfsDirectTemplateDownloader(cmd.getUrl(), 
destPool.getLocalPath(), cmd.getTemplateId(), cmd.getChecksum());
+        } else if (cmd instanceof MetalinkDirectDownloadCommand) {
+            downloader = new MetalinkDirectTemplateDownloader(cmd.getUrl(), 
destPool.getLocalPath(), cmd.getTemplateId(), cmd.getChecksum());
+        } else {
+            return new DirectDownloadAnswer(false, "Unsopported protocol, 
please provide HTTP(S), NFS or a metalink");
 
 Review comment:
   Same typo here: `Unsupported...`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Bypass Secondary Storage for KVM templates
> ------------------------------------------
>
>                 Key: CLOUDSTACK-10146
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10146
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>    Affects Versions: 4.11.0.0
>            Reporter: Nicolas Vazquez
>            Assignee: Nicolas Vazquez
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to