public Boolean deleteVM(final String vmName) throws VMWareException {

        boolean retVal = false;

        ServiceInstance si = null;

        try {

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

            if (vm == null)
                throw new VMWareException("VM " + vmName + " is not found!");

            logger.log(Level.FINE, "VM-State: " + vm.getRuntime().getPowerState().name());
            if (vm.getRuntime().getPowerState() == VirtualMachinePowerState.poweredOn)
                this.vmOperation(vmName, OpEnum.SHUTDOWN);

            Task task = vm.destroy_Task();

            String result = task.waitForTask();

            retVal = result.equals(Task.SUCCESS);

            return retVal;

        } catch (PlatformConfigFault f) {
            throw new VMWareException(f);
        } catch (RemoteException exc) {
            throw new VMWareException(exc);
        } catch (Exception exc) {
            throw new VMWareException(exc);
        }

    }