Examples of ClusterComputeResource


Examples of com.vmware.vim.binding.vim.ClusterComputeResource

   @Override
   public void modifyHASettings(RestartPriority restartPriority, IsolationResponse isolationResponse,
         VmMonitoringState vmMonitoringState) throws Exception {
      AuAssert.check(VcContext.isInTaskSession());

      ClusterComputeResource cluster = MoUtil.getManagedObject(getResourcePool().getVcCluster().getMoRef());
      DasVmSettings dasVmSettings = null;
      boolean found = false;
      DasVmConfigInfo[] dasVmConfig = cluster.getConfiguration().getDasVmConfig();
      if (dasVmConfig != null) {
         for (DasVmConfigInfo iter : dasVmConfig) {
            if (iter.getKey().equals(getMoRef())) {
               found = true;
               dasVmSettings = iter.getDasSettings();
               break;
            }
         }
      }

      if (dasVmSettings == null) {
         dasVmSettings = new DasVmSettingsImpl();
      }
      if (restartPriority != null) {
         dasVmSettings.setRestartPriority(restartPriority.name());
      }
      if (isolationResponse != null) {
         dasVmSettings.setIsolationResponse(isolationResponse.name());
      }

      VmToolsMonitoringSettings vmToolsMonitoringSettings = dasVmSettings.getVmToolsMonitoringSettings();
      if (vmToolsMonitoringSettings == null) {
         // Use the default settings for VmToolsMonitoringSettings
         vmToolsMonitoringSettings = cluster.getConfiguration().getDasConfig().getDefaultVmSettings().getVmToolsMonitoringSettings();
         dasVmSettings.setVmToolsMonitoringSettings(vmToolsMonitoringSettings);
      }

      if (vmMonitoringState != null) {
         vmToolsMonitoringSettings.setVmMonitoring(vmMonitoringState.name());
View Full Code Here

Examples of com.vmware.vim.binding.vim.ClusterComputeResource

   @Override
   public VcTask disableDrs() throws Exception {
      AuAssert.check(VcContext.isInTaskSession());

      ClusterComputeResource cluster = MoUtil.getManagedObject(getResourcePool().getVcCluster().getMoRef());
      boolean found = false;
      DrsVmConfigInfo[] drsVmConfig = cluster.getConfiguration().getDrsVmConfig();
      if (drsVmConfig != null) {
         for (DrsVmConfigInfo iter : drsVmConfig) {
            if (iter.getKey().equals(getMoRef())) {
               found = true;
               break;
View Full Code Here

Examples of com.vmware.vim.binding.vim.ClusterComputeResource

         rpStack.addFirst(rp);
         rp = (ResourcePool)parent;
      }
      // Path is encoded as: [cluster]/path/to/rpName
      StringBuffer pathBuf = new StringBuffer();
      ClusterComputeResource cluster = MoUtil.getManagedObject(rp.getOwner());
      pathBuf.append('[').append(MoUtil.fromURLString(cluster.getName())).append(']');
      for (ResourcePool r : rpStack) {
         pathBuf.append("/").append(MoUtil.fromURLString(r.getName()));
      }
      return pathBuf.toString();
   }
View Full Code Here

Examples of com.vmware.vim.binding.vim.ClusterComputeResource

   }

   @Override
   protected void update(ManagedObject mo) throws Exception {
      AuAssert.check(this.moRef.equals(mo._getRef()));
      ClusterComputeResource cluster = (ClusterComputeResource) mo;
      name = cluster.getName();
      summary = checkReady(cluster.getSummary());
      parent = checkReady(cluster.getParent());
      host = checkReady(cluster.getHost());
      network = checkReady(cluster.getNetwork());
      datastore = checkReady(cluster.getDatastore());
      sharedNetwork = getSharedNetworkInt();
      sharedDatastore = getSharedDatastoreInt();
      ConfigInfoEx configEx =
            (ConfigInfoEx) checkReady(cluster.getConfigurationEx());
      config = VcClusterConfig.create(configEx);
      // Update the transient dasVmConfigInfo
      vmConfigInfo = configEx.getDasVmConfig();
      haDrsIncompatReasonsForRBQual =
            VcClusterConfig.skipHADRSCheck() ? new ArrayList<String>() : config
                  .getHADRSIncompatReasons(false); // Lenient check for a minimal set of config
      haDrsIncompatReasonsForAlert =
            VcClusterConfig.skipHADRSCheck() ? new ArrayList<String>() : config
                  .getHADRSIncompatReasons(true); // Strict check, alert on each config problem
      updateRP(checkReady(cluster.getResourcePool()));
   }
View Full Code Here

Examples of com.vmware.vim.binding.vim.ClusterComputeResource

   @Override
   public VcTask reconfigure(final ConfigSpecEx spec,
         final IVcTaskCallback callback) throws Exception {
      VcTask task = VcContext.getTaskMgr().execute(new IVcTaskBody() {
         public VcTask body() throws Exception {
            final ClusterComputeResource cluster = getManagedObject();
            return new VcTask(TaskType.ReconfigCluster, cluster.reconfigureEx(
                  spec, true), callback);
         }
      });
      return task;
   }
View Full Code Here

Examples of com.vmware.vim25.mo.ClusterComputeResource

   
    ManagedObjectReference mref_drs = new ManagedObjectReference();
    mref_drs.set_value(drs_obj_id);
    mref_drs.setType("ClusterComputeResource");
   
    ClusterComputeResource ccr = (ClusterComputeResource )MorUtil.createExactManagedEntity(si.getServerConnection(), mref_drs);
   
    ClusterConfigSpec ccs = new ClusterConfigSpec();
    ClusterDrsConfigInfo cdci = new ClusterDrsConfigInfo();
    if("manual".equals(mode))
      cdci.setDefaultVmBehavior(DrsBehavior.manual);
    else
      cdci.setDefaultVmBehavior(DrsBehavior.fullyAutomated);
    cdci.setVmotionRate(new Integer(5));
    ccs.setDrsConfig(cdci);
   
    ccr.reconfigureCluster_Task(ccs, true);
   
    si.getServerConnection().logout();
    System.out.println("End of changing DRS config to " + args[3]);
  }
View Full Code Here

Examples of com.vmware.vim25.mo.ClusterComputeResource

    // initialize the system, set up web services
    ServiceInstance si = new ServiceInstance(url, username, password, true);
   
    //create the MOR object for DRS cluster
    ManagedObjectReference mref_drs = createMOR("ClusterComputeResource", drs_obj_id);
    ClusterComputeResource ccr = (ClusterComputeResource )
      MorUtil.createExactManagedEntity(si.getServerConnection(), mref_drs);
   
    // create a new ClusterConfigSpec and populate it with related data for affinity rule
    ClusterConfigSpec ccs = new ClusterConfigSpec();

    ClusterAffinityRuleSpec cars = new ClusterAffinityRuleSpec();
    cars.setName("App and DB Appliance Bundle");
    cars.setEnabled(Boolean.TRUE);
    ManagedObjectReference vm1 = createMOR("VirtualMachine", vm1_oid);
    ManagedObjectReference vm2 = createMOR("VirtualMachine", vm2_oid);
    cars.setVm(new ManagedObjectReference[] {vm1, vm2});
   
    ClusterRuleSpec crs = new ClusterRuleSpec();
    //*NOTE*: the following setOperation has to be called since operation must be set.
    crs.setOperation(ArrayUpdateOperation.add);
    crs.setInfo(cars);

    ccs.setRulesSpec(new ClusterRuleSpec[] {crs});

    // make a call to set the configuration.
    ccr.reconfigureCluster_Task(ccs, true);

    si.getServerConnection().logout();
   
    System.out.println("Done with setting affinity rule for DRS cluster.");
  }
View Full Code Here

Examples of com.vmware.vim25.mo.ClusterComputeResource

      System.out.println("There is no DRS cluster. Exiting.");
      si.getServerConnection().logout();
      return;
    }

    ClusterComputeResource ccr =
        ((ClusterComputeResource)mes[0]);
    EmailMessenger em = new EmailMessenger(
        "mailhost1.vmware.com", "username", "password");

    for(;;)
    {
      StringBuffer sb = new StringBuffer();
      ClusterRecommendation[] recs = ccr.getRecommendation();
      if(recs!=null)
      {
        for(int i=0; i< recs.length; i++)
        {
          sb.append("\n\nRecommendation #" + (i+1));
View Full Code Here

Examples of com.vmware.vim25.mo.ClusterComputeResource

    ManagedEntity[] clusters = new InventoryNavigator(rootFolder).searchManagedEntities("ClusterComputeResource");

    ArrayList<String> clusterList=new ArrayList<String>();
   
    ClusterComputeResource a;
   
    for(int i=0; i<clusters.length; i++)
    {
      ClusterComputeResource cluster = (ClusterComputeResource) clusters[i];
      clusterList.add(cluster.getName());
    }
    return clusterList;
  }
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.