com.cloud.resource.ResourceManager.findHostByGuid()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中com.cloud.resource.ResourceManager.findHostByGuid方法的一些代码示例,展示了ResourceManager.findHostByGuid的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ResourceManager.findHostByGuid方法的具体详情如下:
包路径:com.cloud.resource.ResourceManager
类名称:ResourceManager
方法名:findHostByGuid

ResourceManager.findHostByGuid介绍

暂无

代码示例

代码示例来源:origin: apache/cloudstack

private HostVO waitForHostConnect(long dcId, long podId, long clusterId, String guid) {
  for (int i = 0; i < _waitTime * 2; i++) {
    List<HostVO> hosts = _resourceMgr.listAllUpAndEnabledHosts(Host.Type.Routing, clusterId, podId, dcId);
    for (HostVO host : hosts) {
      if (host.getGuid().toLowerCase().startsWith(guid.toLowerCase())) {
        return host;
      }
    }
    try {
      Thread.sleep(30000);
    } catch (InterruptedException e) {
      s_logger.debug("Failed to sleep: " + e.toString());
    }
  }
  s_logger.debug("Timeout, to wait for the host connecting to mgt svr, assuming it is failed");
  List<HostVO> hosts = _resourceMgr.findHostByGuid(dcId, guid);
  if (hosts.size() == 1) {
    return hosts.get(0);
  } else {
    return null;
  }
}

代码示例来源:origin: apache/cloudstack

String guidWithTail = calcServerResourceGuid(uuidSeed) + "-HypervResource";
if (_resourceMgr.findHostByGuid(guidWithTail) != null) {
  s_logger.debug("Skipping " + agentIp + " because " + guidWithTail + " is already in the database.");
  return null;

代码示例来源:origin: apache/cloudstack

String hostKernelVer = record.softwareVersion.get("linux");
if (_resourceMgr.findHostByGuid(record.uuid) != null) {
  s_logger.debug("Skipping " + record.address + " because " + record.uuid + " is already in the database.");
  continue;

代码示例来源:origin: apache/cloudstack

Xen xen = new Xen(c);
Xen.Vm vm = xen.getRunningVmConfig(vmName);
HostVO destHost = resourceMgr.findHostByGuid(destUuid);
if (destHost == null) {
  msg = "Unable to find migration target host in DB "

代码示例来源:origin: apache/cloudstack

final HostVO finalHost = _resourceMgr.findHostByGuid(host_guid);
if (finalHost == null) {
  throw new CloudRuntimeException("Host Guid " + host_guid + " doesn't exist in DB, something went wrong while processing start answer: "+startAnswer);

相关文章