Package com.vmware.bdd.entity

Examples of com.vmware.bdd.entity.NodeEntity


      List<Callable<Void>> storeProcedures = new ArrayList<Callable<Void>>();

      Map<String, NodeOperationStatus> nodesStatus =
            new HashMap<String, NodeOperationStatus>();
      for (int i = 0; i < nodes.size(); i++) {
         NodeEntity node = nodes.get(i);
         if (node.getMoId() == null) {
            logger.info("VC vm does not exist for node: " + node.getVmName());
            continue;
         }
         VcVirtualMachine vcVm = VcCache.getIgnoreMissing(node.getMoId());
         if (vcVm == null) {
            // cannot find VM
            logger.info("VC vm does not exist for node: " + node.getVmName());
            continue;
         }

         StartVmSP.StartVmPrePowerOn prePowerOn = new StartVmSP.StartVmPrePowerOn(isMapDistro,
               (new Gson()).toJson(node.getVolumns()));
         StartVmPostPowerOn query =
               new StartVmPostPowerOn(node.fetchAllPortGroups(),
                     Constants.VM_POWER_ON_WAITING_SEC, clusterEntityMgr);
         VcHost host = null;
         if (node.getHostName() != null) {
            host = VcResourceUtils.findHost(node.getHostName());
         }
         StartVmSP startSp = new StartVmSP(vcVm, prePowerOn, query, host);
         storeProcedures.add(startSp);
         nodesStatus.put(node.getVmName(),
               new NodeOperationStatus(node.getVmName()));
      }

      try {
         if (storeProcedures.isEmpty()) {
            logger.info("no VM is available. Return directly.");
View Full Code Here


                  logger.debug("server data: " + serverData.getName()
                        + ", action:" + serverData.getAction() + ", status:"
                        + serverData.getStatus());
                  Iterator<NodeEntity> iter = group.getNodes().iterator();
                  while (iter.hasNext()) {
                     NodeEntity oldNode = iter.next();
                     if (oldNode.getVmName().equals(serverData.getName())) {
                        logger.debug("old node:" + oldNode.getVmName()
                              + ", status: " + oldNode.getStatus());
                        oldNode.setAction(serverData.getAction());
                        logger.debug("node status: "
                              + NodeStatus.fromString(serverData.getStatus()));
                        String errorMsg = serverData.getError_msg();
                        if (lastUpdate && errorMsg != null
                              && !errorMsg.isEmpty()) {
                           oldNode.setActionFailed(true);
                           oldNode.setErrMessage(errorMsg);
                           logger.debug("error message: " + errorMsg);
                        }
                        if (!oldNode.isDisconnected()) {
                           oldNode.setStatus(
                                 NodeStatus.fromString(serverData.getStatus()),
                                 false);
                           logger.debug("new node:" + oldNode.getVmName()
                                 + ", status: " + oldNode.getStatus());
                        } else {
                           logger.debug("do not override node status for disconnected node.");
                        }

                        update(oldNode);
View Full Code Here

   }

   @Transactional
   @RetryTransaction
   public void removeVmReference(String vmId) {
      NodeEntity node = nodeDao.findByMobId(vmId);
      if (node != null) {
         setNotExist(node);
      }
   }
View Full Code Here

   }

   @Transactional
   @RetryTransaction
   public void syncUpNode(String clusterName, String nodeName) {
      NodeEntity node = findNodeByName(nodeName);
      if (node != null) {
         refreshNodeStatus(node, false);
      }
   }
View Full Code Here

   }

   @Transactional
   @RetryTransaction
   public void refreshNodeByMobId(String vmId, boolean inSession) {
      NodeEntity node = nodeDao.findByMobId(vmId);
      if (node != null) {
         refreshNodeStatus(node, inSession);
      }
   }
View Full Code Here

   }

   @Transactional
   @RetryTransaction
   public void setNodeConnectionState(String vmName) {
      NodeEntity node = nodeDao.findByName(vmName);
      if (node != null) {
         node.setUnavailableConnection();
      }
   }
View Full Code Here

      logger.info("stopCluster, start to create store procedures.");
      List<Callable<Void>> storeProcedures = new ArrayList<Callable<Void>>();
      Map<String, NodeOperationStatus> nodesStatus =
            new HashMap<String, NodeOperationStatus>();
      for (int i = 0; i < nodes.size(); i++) {
         NodeEntity node = nodes.get(i);
         if (node.getMoId() == null) {
            logger.info("VC vm does not exist for node: " + node.getVmName());
            continue;
         }
         VcVirtualMachine vcVm = VcCache.getIgnoreMissing(node.getMoId());

         if (vcVm == null) {
            logger.info("VC vm does not exist for node: " + node.getVmName());
            continue;
         }
         StopVmSP stopSp = new StopVmSP(vcVm);
         storeProcedures.add(stopSp);
         nodesStatus.put(node.getVmName(),
               new NodeOperationStatus(node.getVmName()));
      }

      try {
         if (storeProcedures.isEmpty()) {
            logger.info("no VM is available. Return directly.");
View Full Code Here

   }

   @Transactional
   @RetryTransaction
   public void refreshNodeByMobId(String vmId, String action, boolean inSession) {
      NodeEntity node = nodeDao.findByMobId(vmId);
      if (node != null) {
         node.setAction(action);
         refreshNodeStatus(node, inSession);
      }
   }
View Full Code Here

      return nodeDao.findByMobId(vmId);
   }

   @Transactional
   public NodeEntity getNodeWithNicsByMobId(String vmId) {
      NodeEntity nodeEntity = nodeDao.findByMobId(vmId);
      Hibernate.initialize(nodeEntity.getNics());
      return nodeEntity;
   }
View Full Code Here

   }

   @Transactional
   @RetryTransaction
   public void refreshNodeByVmName(String vmId, String vmName, boolean inSession) {
      NodeEntity node = nodeDao.findByName(vmName);
      if (node != null) {
         node.setMoId(vmId);
         refreshNodeStatus(node, inSession);
      }
   }
View Full Code Here

TOP

Related Classes of com.vmware.bdd.entity.NodeEntity

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.