Package com.cloud.agent.api.storage

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


        return;
    }

    @Test
    public final void testPrimaryStorageDownloadCommandHTTP() {
        PrimaryStorageDownloadCommand cmd = samplePrimaryDownloadCommand();
        cmd.setUrl("http://s3-eu-west-1.amazonaws.com/cshv3eu/SmallDisk.vhdx");
        corePrimaryStorageDownloadCommandTestCycle(cmd);
    }
View Full Code Here


        String cmdJson =
            "{\"localPath\":" + s_testLocalStorePathJSON + ",\"poolUuid\":\"" + s_testLocalStoreUUID + "\",\"poolId\":201," + "\"secondaryStorageUrl\":" +
                "\"nfs://10.70.176.36/mnt/cshv3/secondarystorage\"," + "\"primaryStorageUrl\":" + "\"nfs://10.70.176.29E:\\\\Disks\\\\Disks\"," + "\"url\":" +
                "\"nfs://10.70.176.36/mnt/cshv3/secondarystorage/template/tmpl//2/204//af39aa7f-2b12-37e1-86d3-e23f2f005101.vhdx\"," +
                "\"format\":\"VHDX\",\"accountId\":2," + "\"name\":" + "\"204-2-5a1db1ac-932b-3e7e-a0e8-5684c72cb862\"" + ",\"contextMap\":{},\"wait\":10800}";
        PrimaryStorageDownloadCommand cmd = s_gson.fromJson(cmdJson, PrimaryStorageDownloadCommand.class);
        return cmd;
    }
View Full Code Here

        try {
            if (templateStoragePoolRef.getDownloadState() == Status.DOWNLOADED) {
                return templateStoragePoolRef;
            }
            String url = origUrl + "/" + templateHostRef.getInstallPath();
            PrimaryStorageDownloadCommand dcmd = new PrimaryStorageDownloadCommand(template.getUniqueName(), url, template.getFormat(),
                   template.getAccountId(), pool.getId(), pool.getUuid(), _primaryStorageDownloadWait);
            HostVO secondaryStorageHost = _hostDao.findById(templateHostRef.getHostId());
            assert(secondaryStorageHost != null);
            dcmd.setSecondaryStorageUrl(secondaryStorageHost.getStorageUrl());
            // TODO temporary hacking, hard-coded to NFS primary data store
            dcmd.setPrimaryStorageUrl("nfs://" + pool.getHostAddress() + pool.getPath());
           
            for (int retry = 0; retry < 2; retry ++){
              Collections.shuffle(vos); // Shuffling to pick a random host in the vm deployment retries
              StoragePoolHostVO vo = vos.get(0);
              if (s_logger.isDebugEnabled()) {
                  s_logger.debug("Downloading " + templateId + " via " + vo.getHostId());
              }
            dcmd.setLocalPath(vo.getLocalPath());
            // set 120 min timeout for this command
           
            PrimaryStorageDownloadAnswer answer = (PrimaryStorageDownloadAnswer)_agentMgr.easySend(
                     _hvGuruMgr.getGuruProcessedCommandTargetHost(vo.getHostId(), dcmd), dcmd);
              if (answer != null && answer.getResult() ) {
View Full Code Here

        return;
    }

    @Test
    public final void testPrimaryStorageDownloadCommandHTTP() {
        PrimaryStorageDownloadCommand cmd = samplePrimaryDownloadCommand();
        cmd.setUrl("http://s3-eu-west-1.amazonaws.com/cshv3eu/SmallDisk.vhdx");
        corePrimaryStorageDownloadCommandTestCycle(cmd);
    }
View Full Code Here

                        + "\"nfs://10.70.176.36/mnt/cshv3/secondarystorage/template/tmpl//2/204//af39aa7f-2b12-37e1-86d3-e23f2f005101.vhdx\","
                        + "\"format\":\"VHDX\",\"accountId\":2,"
                        + "\"name\":"
                        + "\"204-2-5a1db1ac-932b-3e7e-a0e8-5684c72cb862\""
                        + ",\"contextMap\":{},\"wait\":10800}";
        PrimaryStorageDownloadCommand cmd = s_gson.fromJson(cmdJson,
                PrimaryStorageDownloadCommand.class);
        return cmd;
    }
View Full Code Here

        try {
            if (templateStoragePoolRef.getDownloadState() == Status.DOWNLOADED) {
                return templateStoragePoolRef;
            }
            String url = origUrl + "/" + templateHostRef.getInstallPath();
            PrimaryStorageDownloadCommand dcmd = new PrimaryStorageDownloadCommand(template.getUniqueName(), url, template.getFormat(),
                   template.getAccountId(), pool, _primaryStorageDownloadWait);
            HostVO secondaryStorageHost = _hostDao.findById(templateHostRef.getHostId());
            assert(secondaryStorageHost != null);
            dcmd.setSecondaryStorageUrl(secondaryStorageHost.getStorageUrl());
            // TODO temporary hacking, hard-coded to NFS primary data store
            dcmd.setPrimaryStorageUrl("nfs://" + pool.getHostAddress() + pool.getPath());
           
            for (int retry = 0; retry < 2; retry ++){
              Collections.shuffle(vos); // Shuffling to pick a random host in the vm deployment retries
              StoragePoolHostVO vo = vos.get(0);
              if (s_logger.isDebugEnabled()) {
                  s_logger.debug("Downloading " + templateId + " via " + vo.getHostId());
              }
            dcmd.setLocalPath(vo.getLocalPath());
            // set 120 min timeout for this command
           
            PrimaryStorageDownloadAnswer answer = (PrimaryStorageDownloadAnswer)_agentMgr.easySend(
                     _hvGuruMgr.getGuruProcessedCommandTargetHost(vo.getHostId(), dcmd), dcmd);
              if (answer != null && answer.getResult() ) {
View Full Code Here

TOP

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

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.