Package com.cloud.agent.api.storage

Examples of com.cloud.agent.api.storage.DownloadCommand


        }
       
    if(destTmpltHost != null) {
        start();
            String sourceChecksum = _vmMgr.getChecksum(srcTmpltHost.getHostId(), srcTmpltHost.getInstallPath());
      DownloadCommand dcmd = 
              new DownloadCommand(destServer.getStorageUrl(), url, template, TemplateConstants.DEFAULT_HTTP_AUTH_USER, _copyAuthPasswd, maxTemplateSizeInBytes);
      dcmd.setProxy(getHttpProxy());
      if (downloadJobExists) {
        dcmd = new DownloadProgressCommand(dcmd, destTmpltHost.getJobId(), RequestType.GET_OR_RESTART);
       }
      dcmd.setChecksum(sourceChecksum); // We need to set the checksum as the source template might be a compressed url and have cksum for compressed image. Bug #10775
            HostVO ssAhost = _ssvmMgr.pickSsvmHost(destServer);
            if( ssAhost == null ) {
                 s_logger.warn("There is no secondary storage VM for secondary storage host " + destServer.getName());
                 return false;
            }
View Full Code Here


               
        Long maxTemplateSizeInBytes = getMaxTemplateSizeInBytes();
        String secUrl = sserver.getStorageUrl();
    if(vmTemplateHost != null) {
        start();
      DownloadCommand dcmd =
             new DownloadCommand(secUrl, template, maxTemplateSizeInBytes);
      dcmd.setProxy(getHttpProxy());
          if (downloadJobExists) {
              dcmd = new DownloadProgressCommand(dcmd, vmTemplateHost.getJobId(), RequestType.GET_OR_RESTART);
          }
      if (vmTemplateHost.isCopy()) {
        dcmd.setCreds(TemplateConstants.DEFAULT_HTTP_AUTH_USER, _copyAuthPasswd);
      }
      HostVO ssAhost = _ssvmMgr.pickSsvmHost(sserver);
      if( ssAhost == null ) {
               s_logger.warn("There is no secondary storage VM for secondary storage host " + sserver.getName());
               return;
View Full Code Here

        Long maxVolumeSizeInBytes = getMaxVolumeSizeInBytes();
        String secUrl = sserver.getStorageUrl();
    if(volumeHost != null) {
        start();
      DownloadCommand dcmd = new DownloadCommand(secUrl, volume, maxVolumeSizeInBytes, checkSum, url, format);
      dcmd.setProxy(getHttpProxy());
          if (downloadJobExists) {
              dcmd = new DownloadProgressCommand(dcmd, volumeHost.getJobId(), RequestType.GET_OR_RESTART);
              dcmd.setResourceType(ResourceType.VOLUME);
          }
     
      HostVO ssvm = _ssvmMgr.pickSsvmHost(sserver);
      if( ssvm == null ) {
               s_logger.warn("There is no secondary storage VM for secondary storage host " + sserver.getName());
View Full Code Here

        if (jobId != null) {
            dj = jobs.get(jobId);
        }
        if (dj == null) {
            if (cmd.getRequest() == RequestType.GET_OR_RESTART) {
                DownloadCommand dcmd = new DownloadCommand(cmd);
                return handleDownloadCommand(resource, dcmd);
            } else {
                return new DownloadAnswer("Cannot find job", VMTemplateStorageResourceAssoc.Status.DOWNLOAD_ERROR.UNKNOWN);
            }
        }
View Full Code Here

        }
       
    if(destTmpltHost != null) {
        start();
            String sourceChecksum = _vmMgr.getChecksum(srcTmpltHost.getHostId(), srcTmpltHost.getInstallPath());
      DownloadCommand dcmd = 
              new DownloadCommand(destServer.getStorageUrl(), url, template, TemplateConstants.DEFAULT_HTTP_AUTH_USER, _copyAuthPasswd, maxTemplateSizeInBytes);
      if (downloadJobExists) {
        dcmd = new DownloadProgressCommand(dcmd, destTmpltHost.getJobId(), RequestType.GET_OR_RESTART);
       }
      dcmd.setProxy(getHttpProxy());
      dcmd.setChecksum(sourceChecksum); // We need to set the checksum as the source template might be a compressed url and have cksum for compressed image. Bug #10775
            HostVO ssAhost = _ssvmMgr.pickSsvmHost(destServer);
            if( ssAhost == null ) {
                 s_logger.warn("There is no secondary storage VM for secondary storage host " + destServer.getName());
                 return false;
            }
View Full Code Here

               
        Long maxTemplateSizeInBytes = getMaxTemplateSizeInBytes();
        String secUrl = sserver.getStorageUrl();
    if(vmTemplateHost != null) {
        start();
      DownloadCommand dcmd =
             new DownloadCommand(secUrl, template, maxTemplateSizeInBytes);
          if (downloadJobExists) {
              dcmd = new DownloadProgressCommand(dcmd, vmTemplateHost.getJobId(), RequestType.GET_OR_RESTART);
          }
      dcmd.setProxy(getHttpProxy());
      if (vmTemplateHost.isCopy()) {
        dcmd.setCreds(TemplateConstants.DEFAULT_HTTP_AUTH_USER, _copyAuthPasswd);
      }
      HostVO ssAhost = _ssvmMgr.pickSsvmHost(sserver);
      if( ssAhost == null ) {
               s_logger.warn("There is no secondary storage VM for secondary storage host " + sserver.getName());
               return;
View Full Code Here

        Long maxVolumeSizeInBytes = getMaxVolumeSizeInBytes();
        String secUrl = sserver.getStorageUrl();
    if(volumeHost != null) {
        start();
      DownloadCommand dcmd = new DownloadCommand(secUrl, volume, maxVolumeSizeInBytes, checkSum, url, format);
          if (downloadJobExists) {
              dcmd = new DownloadProgressCommand(dcmd, volumeHost.getJobId(), RequestType.GET_OR_RESTART);
              dcmd.setResourceType(ResourceType.VOLUME);
          }
      dcmd.setProxy(getHttpProxy());
      HostVO ssvm = _ssvmMgr.pickSsvmHost(sserver);
      if( ssvm == null ) {
               s_logger.warn("There is no secondary storage VM for secondary storage host " + sserver.getName());
               return;
      }
View Full Code Here

    public void testDownload() {
        s_logger.info("Testing Download answer");
        VMTemplateVO template = new VMTemplateVO(1, "templatename", ImageFormat.QCOW2, true, true, true, TemplateType.USER, "url", true, 32, 1, "chksum", "displayText", true, 30, true,
                HypervisorType.KVM, null);
        DownloadCommand cmd = new DownloadCommand("secUrl", template, 30000000l);
        Request req = new Request(1, 1, cmd, true);

        req.logD("Debug for Download");

View Full Code Here

        }
       
    if(destTmpltHost != null) {
        start();
            String sourceChecksum = _vmMgr.getChecksum(srcTmpltHost.getHostId(), srcTmpltHost.getInstallPath());
      DownloadCommand dcmd = 
              new DownloadCommand(destServer.getStorageUrl(), url, template, TemplateConstants.DEFAULT_HTTP_AUTH_USER, _copyAuthPasswd, maxTemplateSizeInBytes);
      if (downloadJobExists) {
        dcmd = new DownloadProgressCommand(dcmd, destTmpltHost.getJobId(), RequestType.GET_OR_RESTART);
       }
            dcmd.setProxy(getHttpProxy());
      dcmd.setChecksum(sourceChecksum); // We need to set the checksum as the source template might be a compressed url and have cksum for compressed image. Bug #10775
            HostVO ssAhost = _ssvmMgr.pickSsvmHost(destServer);
            if( ssAhost == null ) {
                 s_logger.warn("There is no secondary storage VM for secondary storage host " + destServer.getName());
                 return false;
            }
View Full Code Here

               
        Long maxTemplateSizeInBytes = getMaxTemplateSizeInBytes();
        String secUrl = sserver.getStorageUrl();
    if(vmTemplateHost != null) {
        start();
      DownloadCommand dcmd =
             new DownloadCommand(secUrl, template, maxTemplateSizeInBytes);
          if (downloadJobExists) {
              dcmd = new DownloadProgressCommand(dcmd, vmTemplateHost.getJobId(), RequestType.GET_OR_RESTART);
          }
            dcmd.setProxy(getHttpProxy());

      if (vmTemplateHost.isCopy()) {
        dcmd.setCreds(TemplateConstants.DEFAULT_HTTP_AUTH_USER, _copyAuthPasswd);
      }
      HostVO ssAhost = _ssvmMgr.pickSsvmHost(sserver);
      if( ssAhost == null ) {
               s_logger.warn("There is no secondary storage VM for secondary storage host " + sserver.getName());
               return;
View Full Code Here

TOP

Related Classes of com.cloud.agent.api.storage.DownloadCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.