Package com.vmware.vim25

Examples of com.vmware.vim25.DatastoreInfo


    // When we break cluster hosts into individual hosts used in our resource allocator,
    // we will have to populate ComputeResourceSummary by ourselves here
    //
    HostHardwareSummary hardwareSummary = getHostHardwareSummary();
   
    ComputeResourceSummary resourceSummary = new ComputeResourceSummary();
   
    // TODO: not sure how hyper-threading is counted in VMware
    short totalCores = (short)(hardwareSummary.getNumCpuCores()*hardwareSummary.getNumCpuPkgs());
    resourceSummary.setNumCpuCores(totalCores);
   
    // Note: memory here is in Byte unit
    resourceSummary.setTotalMemory(hardwareSummary.getMemorySize());
   
    // Total CPU is based on socket x core x Mhz
    int totalCpu = hardwareSummary.getCpuMhz() * totalCores;
    resourceSummary.setTotalCpu(totalCpu);

    HostListSummaryQuickStats stats = getHostQuickStats();
    if(stats.getOverallCpuUsage() == null || stats.getOverallMemoryUsage() == null)
      throw new Exception("Unable to get valid overal CPU/Memory usage data, host may be disconnected");
   
    resourceSummary.setEffectiveCpu(totalCpu - stats.getOverallCpuUsage());
   
    // Note effective memory is in MB unit
    resourceSummary.setEffectiveMemory(hardwareSummary.getMemorySize()/(1024*1024) - stats.getOverallMemoryUsage());
   
      if(s_logger.isTraceEnabled())
      s_logger.trace("vCenter API trace - getHyperHostHardwareSummary() done");
     
    return resourceSummary;
View Full Code Here


      s_logger.trace("vCenter API trace - findDatastoreByExportPath(). target MOR: " + _mor.getValue() + ", exportPath: " + exportPath);

    ObjectContent[] ocs = getDatastorePropertiesOnHyperHost(new String[] {"info"});
    if(ocs != null && ocs.length > 0) {
      for(ObjectContent oc : ocs) {
        DatastoreInfo dsInfo = (DatastoreInfo)oc.getPropSet().get(0).getVal();
        if(dsInfo != null && dsInfo instanceof NasDatastoreInfo) {
          NasDatastoreInfo info = (NasDatastoreInfo)dsInfo;
          if(info != null) {
            String vmwareUrl = info.getUrl();
            if(vmwareUrl.charAt(vmwareUrl.length() - 1) == '/')
View Full Code Here

        List<ManagedObjectReference> datastores = getDatastores();

        if (datastores != null) {
            for (ManagedObjectReference morDatastore : datastores) {
                DatastoreInfo info = getDatastoreInfo(morDatastore);

                if (info != null) {
                    if (info.getName().equals(datastoreName))
                        return morDatastore;
                }
            }
        }
View Full Code Here

  public DatastoreInfo getDatastoreInfo(ManagedObjectReference morDatastore) throws Exception {
    return (DatastoreInfo)_context.getVimClient().getDynamicProperty(morDatastore, "info");
  }

  public NasDatastoreInfo getNasDatastoreInfo(ManagedObjectReference morDatastore) throws Exception {
    DatastoreInfo info = (DatastoreInfo)_context.getVimClient().getDynamicProperty(morDatastore, "info");
    if(info instanceof NasDatastoreInfo)
      return (NasDatastoreInfo)info;
    return null;
  }
View Full Code Here

            s_logger.trace("vCenter API trace - findDatastoreByExportPath(). target MOR: " + _mor.getValue() + ", exportPath: " + exportPath);

        ObjectContent[] ocs = getDatastorePropertiesOnHyperHost(new String[] {"info"});
        if (ocs != null && ocs.length > 0) {
            for (ObjectContent oc : ocs) {
                DatastoreInfo dsInfo = (DatastoreInfo)oc.getPropSet().get(0).getVal();
                if (dsInfo != null && dsInfo instanceof NasDatastoreInfo) {
                    NasDatastoreInfo info = (NasDatastoreInfo)dsInfo;
                    if (info != null) {
                        String vmwareUrl = info.getUrl();
                        if (vmwareUrl.charAt(vmwareUrl.length() - 1) == '/')
View Full Code Here

        List<ManagedObjectReference> datastores = getDatastores();

        if (datastores != null) {
            for (ManagedObjectReference morDatastore : datastores) {
                DatastoreInfo info = getDatastoreInfo(morDatastore);

                if (info != null) {
                    if (info.getName().equals(datastoreName))
                        return morDatastore;
                }
            }
        }
View Full Code Here

    public DatastoreInfo getDatastoreInfo(ManagedObjectReference morDatastore) throws Exception {
        return (DatastoreInfo)_context.getVimClient().getDynamicProperty(morDatastore, "info");
    }

    public NasDatastoreInfo getNasDatastoreInfo(ManagedObjectReference morDatastore) throws Exception {
        DatastoreInfo info = (DatastoreInfo)_context.getVimClient().getDynamicProperty(morDatastore, "info");
        if (info instanceof NasDatastoreInfo)
            return (NasDatastoreInfo)info;
        return null;
    }
View Full Code Here

  public DatastoreInfo getDatastoreInfo(ManagedObjectReference morDatastore) throws Exception {
    return (DatastoreInfo)_context.getServiceUtil().getDynamicProperty(morDatastore, "info");
  }
 
  public NasDatastoreInfo getNasDatastoreInfo(ManagedObjectReference morDatastore) throws Exception {
    DatastoreInfo info = (DatastoreInfo)_context.getServiceUtil().getDynamicProperty(morDatastore, "info");
    if(info instanceof NasDatastoreInfo)
      return (NasDatastoreInfo)info;
    return null;
  }
View Full Code Here

      s_logger.trace("vCenter API trace - findDatastoreByExportPath(). target MOR: " + _mor.getValue() + ", exportPath: " + exportPath);

    ObjectContent[] ocs = getDatastorePropertiesOnHyperHost(new String[] {"info"});
    if(ocs != null && ocs.length > 0) {
      for(ObjectContent oc : ocs) {
        DatastoreInfo dsInfo = (DatastoreInfo)oc.getPropSet().get(0).getVal();
        if(dsInfo != null && dsInfo instanceof NasDatastoreInfo) {
          NasDatastoreInfo info = (NasDatastoreInfo)dsInfo;
          if(info != null) {
            String vmwareUrl = info.getUrl();
            if(vmwareUrl.charAt(vmwareUrl.length() - 1) == '/')
View Full Code Here

      s_logger.trace("vCenter API trace - findDatastoreByExportPath(). target MOR: " + _mor.get_value() + ", exportPath: " + exportPath);
   
    ObjectContent[] ocs = getDatastorePropertiesOnHyperHost(new String[] {"info"});
    if(ocs != null && ocs.length > 0) {
      for(ObjectContent oc : ocs) {
        DatastoreInfo dsInfo = (DatastoreInfo)oc.getPropSet(0).getVal();
        if(dsInfo != null && dsInfo instanceof NasDatastoreInfo) {
          NasDatastoreInfo info = (NasDatastoreInfo)dsInfo;
          if(info != null) {
            String vmwareUrl = info.getUrl();
            if(vmwareUrl.charAt(vmwareUrl.length() - 1) == '/')
View Full Code Here

TOP

Related Classes of com.vmware.vim25.DatastoreInfo

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.