Examples of VcResourcePool


Examples of com.vmware.aurora.vc.VcResourcePool

   public void initResource() {
      final String serverMobId =
            Configuration.getString(Constants.SERENGETI_SERVER_VM_MOBID);
      logger.info("server mob id:" + serverMobId);
      final VcVirtualMachine serverVm = findVM(serverMobId);
      VcResourcePool vcRP = getVmRp(serverVm);
      String clusterName = vcRP.getVcCluster().getName();
      String vcRPName = vcRP.getName();
      logger.info("vc rp: " + vcRPName + ", cluster: " + clusterName);
      String networkName = getVMNetwork(serverVm);
      Map<DatastoreType, List<String>> dsNames = getVmDatastore(serverVm);
      if (rpSvc.isDeployedUnderCluster(clusterName, vcRPName)) {
         vcRPName = "";
View Full Code Here

Examples of com.vmware.aurora.vc.VcResourcePool

      logger.info("resource initialized? " + result);
      return result;
   }

   private VcResourcePool getVmRp(final VcVirtualMachine serverVm) {
      VcResourcePool vcRP =
            VcContext.inVcSessionDo(new VcSession<VcResourcePool>() {
               @Override
               protected VcResourcePool body() throws Exception {
                  if (ConfigInfo.isDeployAsVApp()) {
                     VcResourcePool vApp = serverVm.getParentVApp();
                     logger.info("vApp name: " + vApp.getName());
                     VcResourcePool vcRP = vApp.getParent();
                     return vcRP;
                  } else {
                     return serverVm.getResourcePool();
                  }
               }
View Full Code Here

Examples of com.vmware.aurora.vc.VcResourcePool

      }
      VcResourcePoolEntity rp = rpDao.findByName(rpName);
      final String clusterName = rp.getVcCluster();
      final String vcRPName = rp.getVcResourcePool();

      VcResourcePool vcRP =
            VcResourceUtils.findRPInVCCluster(clusterName, vcRPName);
      if (vcRP == null) {
         throw VcProviderException.RESOURCE_POOL_NOT_FOUND(rpName);
      }
      return vcRP;
View Full Code Here

Examples of com.vmware.aurora.vc.VcResourcePool

   @Override
   public boolean isRPExistInVc(String clusterName, String rpName)
         throws VcProviderException {
      boolean result = false;
      VcResourcePool vcRP =
            VcResourceUtils.findRPInVCCluster(clusterName, rpName);
      if (vcRP != null) {
         result = true;
      }
      return result;
View Full Code Here

Examples of com.vmware.aurora.vc.VcResourcePool

      List<VcResourcePoolEntity> allRPEntities =
            rpDao.findAllOrderByClusterName();

      for (VcResourcePoolEntity rpEntity : allRPEntities) {
         VcResourcePool vcRP =
               VcResourceUtils.findRPInVCCluster(rpEntity.getVcCluster(),
                     rpEntity.getVcResourcePool());
         if (vcRP != null) {
            result.add(vcRP);
         } else {
View Full Code Here

Examples of com.vmware.aurora.vc.VcResourcePool

   public Void call() throws Exception {
      VcContext.inVcSessionDo(new VcSession<Void>() {
         @Override
         protected Void body() throws Exception {
            List<VcResourcePool> rps = vcRp.getChildren();
            VcResourcePool delete = null;
            for (VcResourcePool rp : rps) {
               if (rp.getName().equals(deleteRpName)) {
                  delete = rp;
               }
            }
            if (delete != null) {
               delete.destroy();
            }
            return null;
         }
         protected boolean isTaskSession() {
            return true;
View Full Code Here

Examples of com.vmware.aurora.vc.VcResourcePool

   public static String ovfPath = "./src/test/resources/aurora_dbvm-OVF10.ovf";

   public static String dbVersion = "1.0.1000";

   public static VcResourcePool getTestRP() throws Exception {
      VcResourcePool testRP = null;
      for (VcCluster cluster : VcInventory.getClusters()) {
         System.out.println(cluster);
         testRP = cluster.searchRP(VcTestConfig.testRpPath);
         if (testRP != null) {
            break;
View Full Code Here

Examples of com.vmware.aurora.vc.VcResourcePool

   @Override
   public VcVirtualMachine checkNodeStatus(String clusterName,
         String groupName, String nodeName) {
      NodeEntity node = clusterEntityMgr.findNodeByName(nodeName);

      VcResourcePool rp = VcVmUtil.getTargetRp(clusterName, groupName, node);

      String recoverVmName = node.getVmName() + RECOVERY_VM_NAME_POSTFIX;
      if (node.getMoId() != null) {
         VcVirtualMachine vm = VcCache.getIgnoreMissing(node.getMoId());
         // the vm id is null if the vm is removed
View Full Code Here

Examples of com.vmware.aurora.vc.VcResourcePool

    * @return
    */
   public static VcResourcePool findRPInVCCluster(final String clusterName,
         final String vcRPName) {
      logger.debug("find rp in vc: " + clusterName + "/" + vcRPName);
      VcResourcePool vcRP =
            VcContext.inVcSessionDo(new VcSession<VcResourcePool>() {
               @Override
               protected VcResourcePool body() throws Exception {
                  List<VcCluster> vcClusters = VcInventory.getClusters();
                  String targetRP = "";
View Full Code Here

Examples of com.vmware.aurora.vc.VcResourcePool

      return vcRP;
   }

   public static VcVirtualMachine findVmInVcCluster(String vcClusterName,
         String rpName, String vmName) {
      VcResourcePool rp = findRPInVCCluster(vcClusterName, rpName);
      if (rp == null) {
         return null;
      }
      List<VcVirtualMachine> vms = rp.getChildVMs();
      for (VcVirtualMachine vm : vms) {
         if (vm.getName().equals(vmName)) {
            return vm;
         }
      }
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.