Package com.cloud.exception

Examples of com.cloud.exception.DiscoveryException


            }
        }
        if (!isHypervisorTypeSupported) {
            String msg = "Do not support HypervisorType " + hypervisorType + " for " + url;
            s_logger.warn(msg);
            throw new DiscoveryException(msg);
        }
        s_logger.warn("Unable to find the server resources at " + url);
        throw new DiscoveryException("Unable to add the host");
    }
View Full Code Here


          hostIp, 22);
      sshConnection.connect(null, 60000, 60000);
      sshConnection = SSHCmdHelper.acquireAuthorizedConnection(hostIp,
          username, password);
      if (sshConnection == null) {
        throw new DiscoveryException(
            String.format(
                "Cannot connect to ovm host(IP=%1$s, username=%2$s, password=%3$s, discover failed",
                hostIp, username, password));
      }

      if (!SSHCmdHelper.sshExecuteCmd(sshConnection,
          "[ -f '/etc/ovs-agent/agent.ini' ]")) {
        throw new DiscoveryException(
            "Can not find /etc/ovs-agent/agent.ini " + hostIp);
      }

      Map<String, String> details = new HashMap<String, String>();
      OvmResourceBase ovmResource = new OvmResourceBase();
View Full Code Here

            String masterIp = _connPool.getMasterIp(hostIp, username, pass);         
            conn = _connPool.masterConnect(masterIp, username, pass);
            if (conn == null) {
                String msg = "Unable to get a connection to " + url;
                s_logger.debug(msg);
                throw new DiscoveryException(msg);
            }
          
            Set<Pool> pools = Pool.getAll(conn);
            Pool pool = pools.iterator().next();
            Pool.Record pr = pool.getRecord(conn);          
            String poolUuid = pr.uuid;
            Map<Host, Host.Record> hosts = Host.getAllRecords(conn);

            /*set cluster hypervisor type to xenserver*/
            ClusterVO clu = _clusterDao.findById(clusterId);
            if ( clu.getGuid()== null ) {
                setClusterGuid(clu, poolUuid);
            } else {
                List<HostVO> clusterHosts = _resourceMgr.listAllHostsInCluster(clusterId);
                if( clusterHosts != null && clusterHosts.size() > 0) {
                    if (!clu.getGuid().equals(poolUuid)) {
                        if (hosts.size() == 1) {
                            if (!addHostsToPool(conn, hostIp, clusterId)) {
                                String msg = "Unable to add host(" + hostIp + ") to cluster " + clusterId;
                                s_logger.warn(msg);
                                throw new DiscoveryException(msg);
                            }
                        } else {
                            String msg = "Host (" + hostIp + ") is already in pool(" + poolUuid + "), can to join pool(" + clu.getGuid() + ")";
                            s_logger.warn(msg);
                            throw new DiscoveryException(msg);
                        }
                    }
                } else {
                    setClusterGuid(clu, poolUuid);
                }
View Full Code Here

            throw new CloudRuntimeException("Unable to reach the pool master of the existing cluster");
        }
       
        if( !_connPool.joinPool(conn, hostIp, masterIp, username, pass) ){
            s_logger.warn("Unable to join the pool");
            throw new DiscoveryException("Unable to join the pool");
        }  
        return true;
    }
View Full Code Here

                success = true;
                return result;
            }

            s_logger.warn("Unable to find the server resources at " + url);
            throw new DiscoveryException("Unable to add the external cluster");
        } finally {
            if (!success) {
                _clusterDetailsDao.deleteDetails(clusterId);
                _clusterDao.remove(clusterId);
            }
View Full Code Here

            }
        }
        if (!isHypervisorTypeSupported) {
            String msg = "Do not support HypervisorType " + hypervisorType + " for " + url;
            s_logger.warn(msg);
            throw new DiscoveryException(msg);
        }
        s_logger.warn("Unable to find the server resources at " + url);
        throw new DiscoveryException("Unable to add the host");
    }
View Full Code Here

    }

    @Override
    public SwiftVO addSwift(AddSwiftCmd cmd) throws DiscoveryException {
        if (!isSwiftEnabled()) {
            throw new DiscoveryException("Swift is not enabled");
        }
        SwiftVO swift = new SwiftVO(cmd.getUrl(), cmd.getAccount(), cmd.getUsername(), cmd.getKey());
        swift = _swiftDao.persist(swift);
        return swift;
    }
View Full Code Here

                success = true;
                return result;
            }

            s_logger.warn("Unable to find the server resources at " + url);
            throw new DiscoveryException("Unable to add the external cluster");
        } finally {
            if (!success) {
                _clusterDetailsDao.deleteDetails(cluster.getId());
                _clusterDao.remove(cluster.getId());
            }
View Full Code Here

            }
        }
        if (!isHypervisorTypeSupported) {
            String msg = "Do not support HypervisorType " + hypervisorType + " for " + url;
            s_logger.warn(msg);
            throw new DiscoveryException(msg);
        }
        s_logger.warn("Unable to find the server resources at " + url);
        throw new DiscoveryException("Unable to add the host");
    }
View Full Code Here

            try {
                dcMo = new DatacenterMO(context, vmwareDcName);
            } catch(Throwable t) {
                String msg = "Unable to find DC " + vmwareDcName + " in vCenter " + vCenterHost;
                s_logger.error(msg);
                throw new DiscoveryException(msg);
            }

            assert (dcMo != null);

            // Reset custom field property cloud.zone over this DC
View Full Code Here

TOP

Related Classes of com.cloud.exception.DiscoveryException

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.