Package com.cloud.agent.api

Examples of com.cloud.agent.api.StartupStorageCommand


            }
        } catch (Throwable e) {
            s_logger.warn("Check for master failed, failing the FULL Cluster sync command");
        }

        StartupStorageCommand sscmd = initializeLocalSR(conn);
        if (sscmd != null) {
            return new StartupCommand[] { cmd, sscmd };
        }
        return new StartupCommand[] { cmd };
    }
View Full Code Here


                RouterPrivateIpStrategy.HostLocal, changes, null);
        fillNetworkInformation(cmd);
        cmd.getHostDetails().putAll(getVersionStrings());
        cmd.setCluster(getConfiguredProperty("cluster", "1"));
        StoragePoolInfo pi = initializeLocalStorage();
        StartupStorageCommand sscmd = new StartupStorageCommand();
        sscmd.setPoolInfo(pi);
        sscmd.setGuid(pi.getUuid());
        sscmd.setDataCenter((String) _params.get("zone"));
        sscmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL);

        return new StartupCommand[] { cmd, sscmd };
    }
View Full Code Here

            return;
        }

        long agentId = agent.getId();

        StartupStorageCommand storage = (StartupStorageCommand)cmd;
        if (storage.getResourceType() == Storage.StorageResourceType.STORAGE_HOST ||
                storage.getResourceType() == Storage.StorageResourceType.SECONDARY_STORAGE)
        {
            uploadMonitor.handleUploadSync(agentId);
        }
    }
View Full Code Here

        return Host.Type.SecondaryStorage;
    }

    @Override
    public StartupCommand[] initialize() {
        final StartupStorageCommand cmd = new StartupStorageCommand("dummy",
                StoragePoolType.NetworkFilesystem, 1024*1024*1024*100L,
                new HashMap<String, TemplateInfo>());

        cmd.setResourceType(Storage.StorageResourceType.SECONDARY_STORAGE);
        cmd.setIqn(null);
        cmd.setNfsShare(_guid);

        fillNetworkInformation(cmd);
        cmd.setDataCenter(_dc);
        cmd.setPod(_pod);
        cmd.setGuid(_guid);

        cmd.setName(_guid);
        cmd.setVersion(DummySecondaryStorageResource.class.getPackage().getImplementationVersion());
        /* gather TemplateInfo in second storage */
        cmd.setTemplateInfo(getDefaultSystemVmTemplateInfo());
        cmd.getHostDetails().put("mount.parent", "dummy");
        cmd.getHostDetails().put("mount.path", "dummy");
        cmd.getHostDetails().put("orig.url", _guid);

        String tok[] = _dummyPath.split(":");
        cmd.setPrivateIpAddress(tok[0]);
        return new StartupCommand [] {cmd};
    }
View Full Code Here

          return;
      }

      long agentId = agent.getId();

      StartupStorageCommand storage = (StartupStorageCommand)cmd;
      if (storage.getResourceType() == Storage.StorageResourceType.STORAGE_HOST ||
      storage.getResourceType() == Storage.StorageResourceType.SECONDARY_STORAGE )
      {
        uploadMonitor.handleUploadSync(agentId);
      }
  }
View Full Code Here

    public void processConnect(HostVO host, StartupCommand cmd, boolean forRebalance) throws ConnectionException {
        if (!(cmd instanceof StartupStorageCommand)) {
            return;
        }
       
        StartupStorageCommand ssCmd = (StartupStorageCommand)cmd;
       
        if (ssCmd.getResourceType() != Storage.StorageResourceType.STORAGE_POOL) {
            return;
        }
       
        StoragePoolInfo pInfo = ssCmd.getPoolInfo();
        if (pInfo == null) {
            return;
        }

        DataCenterVO dc = _dcDao.findById(host.getDataCenterId());
View Full Code Here

    if (!(firstCmd instanceof StartupStorageCommand)) {
      return null;
    }

    com.cloud.host.Host.Type type = null;
    StartupStorageCommand ssCmd = ((StartupStorageCommand) firstCmd);
    if (ssCmd.getHostType() == Host.Type.SecondaryStorageCmdExecutor) {
      type = ssCmd.getHostType();
    } else {
      if (ssCmd.getResourceType() == Storage.StorageResourceType.SECONDARY_STORAGE) {
        type = Host.Type.SecondaryStorage;
        if (resource != null && resource instanceof DummySecondaryStorageResource) {
          host.setResource(null);
        }
      } else if (ssCmd.getResourceType() == Storage.StorageResourceType.LOCAL_SECONDARY_STORAGE) {
        type = Host.Type.LocalSecondaryStorage;
      } else {
        type = Host.Type.Storage;
      }

      final Map<String, String> hostDetails = ssCmd.getHostDetails();
      if (hostDetails != null) {
        if (details != null) {
          details.putAll(hostDetails);
        } else {
          details = hostDetails;
        }
      }

      host.setDetails(details);
      host.setParent(ssCmd.getParent());
      host.setTotalSize(ssCmd.getTotalSize());
      host.setHypervisorType(HypervisorType.None);
      host.setType(type);
      if (ssCmd.getNfsShare() != null) {
        host.setStorageUrl(ssCmd.getNfsShare());
      }
    }
   
    return host;
    }
View Full Code Here

        // NB: if the host was configured
        // with a local storage pool, CloudStack may not be able to use it
        // unless
        // it is has service offerings configured to recognise this storage
        // type.
        StartupStorageCommand storePoolCmd = null;
        if (startCmds.length > 1) {
            storePoolCmd = (StartupStorageCommand) startCmds[1];
            // TODO: is this assertion required?
            if (storePoolCmd == null) {
                String frmtStr =
View Full Code Here

                + result[0].toString());
    }

    // @Test
    public final void testJson() {
        StartupStorageCommand sscmd = null;
        com.cloud.agent.api.StoragePoolInfo pi =
                new com.cloud.agent.api.StoragePoolInfo(
                        "test123", "192.168.0.1", "c:\\", "c:\\",
                        StoragePoolType.Filesystem, 100L, 50L);

        sscmd = new StartupStorageCommand();
        sscmd.setPoolInfo(pi);
        sscmd.setGuid(pi.getUuid());
        sscmd.setDataCenter("foo");
        sscmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL);
        s_logger.debug("StartupStorageCommand fromJson is "
                + s_gson.toJson(sscmd));
    }
View Full Code Here

        cmd.setAgentTag("agent-simulator");
        cmd.setDataCenter(String.valueOf(agentHost.getDataCenterId()));
        cmd.setPod(String.valueOf(agentHost.getPodId()));
        cmd.setCluster(String.valueOf(agentHost.getClusterId()));

        StartupStorageCommand ssCmd = initializeLocalSR();

        return new StartupCommand[] { cmd, ssCmd };
    }
View Full Code Here

TOP

Related Classes of com.cloud.agent.api.StartupStorageCommand

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.