Interface HypervisorMXBean

All Superinterfaces:
PlatformManagedObject
All Known Implementing Classes:
HypervisorMXBeanImpl

public interface HypervisorMXBean extends PlatformManagedObject
This interface provides information on whether the current Operating System is running directly on physical hardware or running as a Guest (Virtual Machine (VM)/Logical Partition (LPAR)) on top of a Hypervisor. If the Operating System is running as a Guest, the interface provides information about the Hypervisor. Where there are multiple levels of Hypervisor, only the top level Hypervisor information is returned. The supported Hypervisors and the platforms on which they are supported:
  1. Linux and Windows on VMWare.
  2. Linux and Windows on KVM.
  3. Windows on Hyper-V.
  4. AIX and Linux on PowerVM.
  5. Linux and z/OS on z/VM.
  6. Linux and z/OS on PR/SM.

On some hardware, Hypervisor detection might fail, even if the Hypervisor and Operating System combination is supported. In this case you can set an Environment variable - IBM_JAVA_HYPERVISOR_SETTINGS that forces the JVM to recognize the Hypervisor.

  • For example: On Windows to set the Hypervisor as VMWare,
    set IBM_JAVA_HYPERVISOR_SETTINGS="DefaultName=VMWare"
  • Other valid Hypervisor name strings (case insensitive):
    • VMWare, Hyper-V, KVM, PowerVM, PR/SM, z/VM.
  • If the actual Hypervisor and the one provided through the Environment variable differ, the results are indeterminate.

Usage example for the HypervisorMXBean
 
   ...
   try {
	mxbeanName = new ObjectName("com.ibm.virtualization.management:type=Hypervisor");
   } catch (MalformedObjectNameException e) {
	// Exception Handling
   }
   try {
	MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();
	if (true != mbeanServer.isRegistered(mxbeanName)) {
	   // HypervisorMXBean not registered
	}
	HypervisorMXBean hypBean = JMX.newMXBeanProxy(mbeanServer, mxbeanName, HypervisorMXBean.class); 
   } catch (Exception e) {
	// Exception Handling
   }
 
 
Since:
1.7.1
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the vendor of the Hypervisor if running in a virtualized environment.
    boolean
    Indicates if the Operating System is running on a Hypervisor or not.

    Methods declared in interface java.lang.management.PlatformManagedObject

    getObjectName
  • Method Details