code: public boolean vmExists(final String vmOrUuid) {
          String[] lines = execute("list", "vms").split("\\s");
          for (String line : lines) {
              if (line.endsWith("{" + vmOrUuid + "}") || line.startsWith("\"" + vmOrUuid + "\""))
                  return true;
          }
          return false;
      }
docs: Checks if VM exists. Accepts UUID or VM name as an argument.