public VirtualMachinePowerState getPowerState(final String vmName) throws VMWareException {
        ServiceInstance si = null;

        try {

            si = this.getServerInstance();
            Folder rootFolder = si.getRootFolder();
            VirtualMachine vm = (VirtualMachine) new InventoryNavigator(rootFolder).searchManagedEntity("VirtualMachine", vmName);

            if (vm != null) {
                return vm.getRuntime().getPowerState();
            }

            return null;

        } catch (PlatformConfigFault f) {
            throw new VMWareException("Problems with " + vmName, f);
        } catch (RemoteException exc) {
            throw new VMWareException("Problems with " + vmName, exc);
        } catch (MalformedURLException exc) {
            throw new VMWareException("Problems with " + vmName, exc);
        }
    }