Examples of StopVmSP


Examples of com.vmware.bdd.service.sp.StopVmSP

      VcVirtualMachine vcVm = VcCache.getIgnoreMissing(node.getMoId());
      if (vcVm == null) {
         logger.info("VC vm does not exist for node: " + node.getVmName());
         return false;
      }
      StopVmSP stopVMSP;
      if (vmPoweroff.length > 0 && vmPoweroff[0]) {
         stopVMSP = new StopVmSP(vcVm, true);
      } else {
         stopVMSP = new StopVmSP(vcVm);
      }
      return VcVmUtil.runSPOnSingleVM(node, stopVMSP);
   }
View Full Code Here

Examples of com.vmware.bdd.service.sp.StopVmSP

         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.");
            return true;
         }
         Callable<Void>[] storeProceduresArray =
               storeProcedures.toArray(new Callable[0]);
         // execute store procedures to start VMs
         logger.info("ClusteringService, start to stop vms.");
         BaseProgressCallback callback = new BaseProgressCallback(statusUpdator);

         ExecutionResult[] result =
               Scheduler
                     .executeStoredProcedures(
                           com.vmware.aurora.composition.concurrent.Priority.BACKGROUND,
                           storeProceduresArray, callback);
         if (result == null) {
            logger.error("No VM is stoped.");
            for (NodeOperationStatus status : nodesStatus.values()) {
               status.setSucceed(false);
            }
            failedNodes.addAll(nodesStatus.values());
            return false;
         }

         boolean success = true;
         int total = 0;
         for (int i = 0; i < storeProceduresArray.length; i++) {
            StopVmSP sp = (StopVmSP) storeProceduresArray[i];
            NodeOperationStatus status = nodesStatus.get(sp.getVmName());
            if (result[i].finished && result[i].throwable == null) {
               ++total;
               nodesStatus.remove(status.getNodeName()); // do not return success node
            } else if (result[i].throwable != null) {
               status.setSucceed(false);
               status.setErrorMessage(getErrorMessage(result[i].throwable));
               VcVirtualMachine vm = sp.getVcVm();
               if (vm == null || vm.isPoweredOff()) {
                  ++total;
                  nodesStatus.remove(status.getNodeName()); // do not return success node
               } else {
                  if (!vm.isConnected()
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.