/** * Returns a true if the VM Tools installer is mounted of a virtual * machine Returns false if not */ private void getVmToolsInstallerMounted(String vmName, PrintWriter out) throws IOException { try { VirtualMachine vm = (VirtualMachine) getManagedEntity(vmName, "VirtualMachine"); Boolean is = false; if (vm == null) { LOG.warn("No vm named '" + vmName + "' found"); } else { VirtualMachineRuntimeInfo vmRuntime = vm.getRuntime(); is = vmRuntime.isToolsInstallerMounted(); if (is == null) { is = false; } } out.print(is ? "1" : "0"); out.flush(); } catch (Exception ex) { LOG.error("An error occurred : " + ex.toString()); } }