Examples of AboutInfo


Examples of com.vmware.vim.binding.vim.AboutInfo

    * This function either completes the entire initialization successfully
    * or rolls back partial initialization on any failure. In the latter case,
    * we will attempt to re-initialize again at a later time on VC use.
    */
   public static synchronized void initVcContext() {
      AboutInfo info = null;
      genCount++;
      if (initialized) {
         logger.info("VC already initialized");
         return;
      }
      /*
       * Don't attempt to relogin into VC on fatal errors (will fail again) or
       * when we are in the middle of a shutdown operation (just logged out).
       */
      if (fatalInitError) {
         logger.warn("Fatal VC init error");
         throw VcException.INIT_ERROR();
      }
      if (shutdown) {
         logger.warn("initVcContext during shutdown");
         throw VcException.SHUTDOWN_ERROR();
      }
      /* No partial initialization tolerated. */
      AuAssert.check(vcCleaner == null          &&
             vcService == null          &&
             eventService == null);

      vcCleaner = new VcCleaner();

      try {
         VmodlContext.getContext();
      } catch(IllegalStateException ex) {
         //Context has not been initialized. Continue to initialize
         VmodlContext.initContext(new String[] { "com.vmware.vim.binding.vim" });
      }

      try {
         vcService = new VcService("VcService");
         info = vcService.getServiceInstanceContent().getAbout();
         serverGuid = info.getInstanceUuid();
         vcVersion = info.getVersion();
      } catch (Exception e) {
         logger.error("init vc context failed (vc session)");
         initFailure(VcException.LOGIN_ERROR(e), null, false); // Retry later.
      }
      checkVcVersion(info);
View Full Code Here

Examples of com.vmware.vim25.AboutInfo

  public AboutInfo getHostAboutInfo() throws Exception {
    return (AboutInfo)_context.getServiceUtil().getDynamicProperty(_mor, "config.product");
  }
 
  public VmwareHostType getHostType() throws Exception {
    AboutInfo aboutInfo = getHostAboutInfo();
    if("VMware ESXi".equals(aboutInfo.getName()))
      return VmwareHostType.ESXi;
    else if("VMware ESX".equals(aboutInfo.getName()))
      return VmwareHostType.ESX;
   
    throw new Exception("Unrecognized VMware host type " + aboutInfo.getName());
  }
View Full Code Here

Examples of com.vmware.vim25.AboutInfo

            if(!((HostMO)hyperHost).isHyperHostConnected()) {
              s_logger.info("Host " + hyperHost.getHyperHostName() + " is not in connected state");
              return null;
            }
           
            AboutInfo aboutInfo = ((HostMO)hyperHost).getHostAboutInfo();
            hostApiVersion = aboutInfo.getApiVersion();
           
        } catch (Exception e) {
            String msg = "VmwareResource intialize() failed due to : " + VmwareHelper.getExceptionMessage(e);
            s_logger.error(msg);
            invalidateServiceContext();
View Full Code Here

Examples of com.vmware.vim25.AboutInfo

  public AboutInfo getHostAboutInfo() throws Exception {
    return (AboutInfo)_context.getVimClient().getDynamicProperty(_mor, "config.product");
  }

  public VmwareHostType getHostType() throws Exception {
    AboutInfo aboutInfo = getHostAboutInfo();
    if("VMware ESXi".equals(aboutInfo.getName()))
      return VmwareHostType.ESXi;
    else if("VMware ESX".equals(aboutInfo.getName()))
      return VmwareHostType.ESX;

    throw new Exception("Unrecognized VMware host type " + aboutInfo.getName());
  }
View Full Code Here

Examples of com.vmware.vim25.AboutInfo

            } else if(mor.getType().equals("ClusterComputeResource")) {
                List<ManagedObjectReference> hosts = (List<ManagedObjectReference>)serviceContext.getVimClient().getDynamicProperty(mor, "host");
                assert(hosts != null);

                if (hosts.size() > 0) {
                    AboutInfo about = (AboutInfo)(serviceContext.getVimClient().getDynamicProperty(hosts.get(0), "config.product"));
                    String version = about.getApiVersion();
                    int maxHostsPerCluster = _hvCapabilitiesDao.getMaxHostsPerCluster(HypervisorType.VMware, version);
                    if (hosts.size() > maxHostsPerCluster) {
                        String msg = "Failed to add VMware cluster as size is too big, current size: " + hosts.size() + ", max. size: " + maxHostsPerCluster;
                        s_logger.error(msg);
                        throw new DiscoveredWithErrorException(msg);
View Full Code Here

Examples of com.vmware.vim25.AboutInfo

                  return null;
              }
             
              ((HostMO)hyperHost).enableVncOnHostFirewall();
 
              AboutInfo aboutInfo = ((HostMO)hyperHost).getHostAboutInfo();
              hostApiVersion = aboutInfo.getApiVersion();
 
          } catch (Exception e) {
              String msg = "VmwareResource intialize() failed due to : " + VmwareHelper.getExceptionMessage(e);
              s_logger.error(msg);
              invalidateServiceContext();
View Full Code Here

Examples of com.vmware.vim25.AboutInfo

            } else if(mor.getType().equals("ClusterComputeResource")) {
                List<ManagedObjectReference> hosts = (List<ManagedObjectReference>)serviceContext.getVimClient().getDynamicProperty(mor, "host");
                assert(hosts != null);

                if (hosts.size() > 0) {
                    AboutInfo about = (AboutInfo)(serviceContext.getVimClient().getDynamicProperty(hosts.get(0), "config.product"));
                    String version = about.getApiVersion();
                    int maxHostsPerCluster = _hvCapabilitiesDao.getMaxHostsPerCluster(HypervisorType.VMware, version);
                    if (hosts.size() > maxHostsPerCluster) {
                        String msg = "Failed to add VMware cluster as size is too big, current size: " + hosts.size() + ", max. size: " + maxHostsPerCluster;
                        s_logger.error(msg);
                        throw new DiscoveredWithErrorException(msg);
View Full Code Here

Examples of com.vmware.vim25.AboutInfo

                    return null;
                }

                ((HostMO)hyperHost).enableVncOnHostFirewall();

                AboutInfo aboutInfo = ((HostMO)hyperHost).getHostAboutInfo();
                hostApiVersion = aboutInfo.getApiVersion();

            } catch (Exception e) {
                String msg = "VmwareResource intialize() failed due to : " + VmwareHelper.getExceptionMessage(e);
                s_logger.error(msg);
                invalidateServiceContext();
View Full Code Here

Examples of com.vmware.vim25.AboutInfo

            } else if (mor.getType().equals("ClusterComputeResource")) {
                List<ManagedObjectReference> hosts = serviceContext.getVimClient().getDynamicProperty(mor, "host");
                assert (hosts != null);

                if (hosts.size() > 0) {
                    AboutInfo about = (AboutInfo)(serviceContext.getVimClient().getDynamicProperty(hosts.get(0), "config.product"));
                    String version = about.getApiVersion();
                    int maxHostsPerCluster = _hvCapabilitiesDao.getMaxHostsPerCluster(HypervisorType.VMware, version);
                    if (hosts.size() > maxHostsPerCluster) {
                        String msg = "Failed to add VMware cluster as size is too big, current size: " + hosts.size() + ", max. size: " + maxHostsPerCluster;
                        s_logger.error(msg);
                        throw new DiscoveredWithErrorException(msg);
View Full Code Here

Examples of com.vmware.vim25.AboutInfo

                  return null;
              }
             
              ((HostMO)hyperHost).enableVncOnHostFirewall();
 
              AboutInfo aboutInfo = ((HostMO)hyperHost).getHostAboutInfo();
              hostApiVersion = aboutInfo.getApiVersion();
 
          } catch (Exception e) {
              String msg = "VmwareResource intialize() failed due to : " + VmwareHelper.getExceptionMessage(e);
              s_logger.error(msg);
              invalidateServiceContext();
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.