Examples of DownloadCommand


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

        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

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);
      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

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

               
        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

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

        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

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

        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

Examples of org.apache.cloudstack.storage.command.DownloadCommand

    @Override
    public void createAsync(DataStore dataStore, DataObject data, AsyncCompletionCallback<CreateCmdResult> callback) {
        Long maxTemplateSizeInBytes = getMaxTemplateSizeInBytes();
        VirtualMachineTemplate tmpl = _templateDao.findById(data.getId());
        DataStore cacheStore = cacheManager.getCacheStorage(dataStore.getScope());
        DownloadCommand dcmd = new DownloadCommand((TemplateObjectTO)(data.getTO()), maxTemplateSizeInBytes);
        dcmd.setCacheStore(cacheStore.getTO());
        dcmd.setProxy(getHttpProxy());

        EndPoint ep = _epSelector.select(data);
        if (ep == null) {
            s_logger.warn("There is no secondary storage VM for downloading template to image store " + dataStore.getName());
            return;
View Full Code Here

Examples of org.apache.cloudstack.storage.command.DownloadCommand

        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

Examples of org.apache.cloudstack.storage.command.DownloadCommand

        Long maxTemplateSizeInBytes = getMaxTemplateSizeInBytes();
        if (vmTemplateStore != null) {
            start();
            VirtualMachineTemplate tmpl = this._templateDao.findById(template.getId());
            DownloadCommand dcmd = new DownloadCommand((TemplateObjectTO)(template.getTO()), maxTemplateSizeInBytes);
            dcmd.setProxy(getHttpProxy());
            if (downloadJobExists) {
                dcmd = new DownloadProgressCommand(dcmd, vmTemplateStore.getJobId(), RequestType.GET_OR_RESTART);
            }
            if (vmTemplateStore.isCopy()) {
                dcmd.setCreds(TemplateConstants.DEFAULT_HTTP_AUTH_USER, _copyAuthPasswd);
            }
            EndPoint ep = _epSelector.select(template);
            if (ep == null) {
                s_logger.warn("There is no secondary storage VM for downloading template to image store " + store.getName());
                return;
View Full Code Here

Examples of org.apache.cloudstack.storage.command.DownloadCommand

        Long maxVolumeSizeInBytes = getMaxVolumeSizeInBytes();
        if (volumeHost != null) {
            start();
            Volume vol = this._volumeDao.findById(volume.getId());
            DownloadCommand dcmd = new DownloadCommand((VolumeObjectTO)(volume.getTO()), maxVolumeSizeInBytes, checkSum, url, format);
            dcmd.setProxy(getHttpProxy());
            if (downloadJobExists) {
                dcmd = new DownloadProgressCommand(dcmd, volumeHost.getJobId(), RequestType.GET_OR_RESTART);
                dcmd.setResourceType(ResourceType.VOLUME);
            }

            EndPoint ep = this._epSelector.select(volume);
            if (ep == null) {
                s_logger.warn("There is no secondary storage VM for image store " + store.getName());
View Full Code Here

Examples of org.apache.cloudstack.storage.command.DownloadCommand

        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);
        NfsTO nfs = new NfsTO("secUrl", DataStoreRole.Image);
        TemplateObjectTO to = new TemplateObjectTO(template);
        to.setImageDataStore(nfs);
        DownloadCommand cmd = new DownloadCommand(to, 30000000l);
        Request req = new Request(1, 1, cmd, true);

        req.logD("Debug for Download");

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.