public static boolean isVMRunning ( String hostIpPort , String id ) throws TargetException { boolean result = false ; String ip = OcciVMUtils . getVMIP ( hostIpPort , id ) ; try { InetAddress inet = InetAddress . getByName ( ip ) ; result = inet . isReachable ( 5000 ) ; } catch ( Exception e ) { result = false ; final Logger logger = Logger . getLogger ( OcciVMUtils . class . getName ( ) ) ; logger . info ( e . getMessage ( ) ) ; } return result ; }
Checks if VM is running .