1. Currently supported features

Doing sanity check over edge support bundle. Multiple edge bundles are supported.
In fact, some of the checks, such as checking xtep-groups config is consistent
across site, *requires* that support bundles from all edges, across all sites,
to be available for the check to not produce false positive

Doing sanity check inside a live edge, for state inconsistency in that edge.
The CLI added is

get diagnosis inconsistency

2. Features in progress

- Running it on Macbook to analyze a live setup via SSH (highest priority)
- Running the CLI 'get diagnosis inconsistency' to identify inconsistencies
  across all edges in an edge cluster vs. just the edge where CLI is run

Also, more checks are being added. There is no defined end.

4. How to run it over bundle?

- Download all edge support bundles and uncompress
- At the root directory where "ls -l" shows all edge bundles, run this tool
  nsx/support/check_for_inconsistency --bundle_dir {bundle}

  -- if {bundle} is a directory containing multiple edge support bundles,
     they will be analyzed together. This is the best approach as some
     analysis requires checking state across edges

  -- If {bundle} is a single edge bundle's directory, only info from that
     single edge will be analyzed. Some checks that require cross-edge
     check, e.g. HA state of SR/XTEP-groups, are automatically skipped

5. Knobs to tweak the tool's behavior

   A file 'run.json' controls script behavior. A copy exists in
   nsx/node/cli/src/python/cli/commands/edge/diag, which is used by the
   "get diagnosis inconsistency" CLI. You can specify your own with
   "--run_json path/to/my/private/run.json"

{
    "dump_topology": 1, <---- 0 or disable topo dump (can be 1000's of lines)
    "run_checks" : 1,   <---- 0 to disable checks
    "show_failure_only" : 0, <-- 1 to display a check only if it fails
    "edges" : {"1.1.1.1", "2.2.2.2"}  <----- see below
}
 The {edges} clause can be populated in one of the 3 ways below

  a) "127.0.0.1" - used by CLI, analyze local edge only
  b) "255.255.255.255" - not yet implemented, will also be used by CLI to
                         analyze all edges in an edge cluster
  c) Other, specific addresses, live TB mode is enabled, bundle mode disabled.
     Script will SSH into each address specified assuming they are edges,
     and analyze their states. This is not yet implemented
  For bundle-mode (analyzing multiple bundles offline), this clause can be
  left empty. It is also ignored if "--bundle_dir" option is specified on
  command line

6. Major future work

- Extend the tool to cover more entities, e.g. LB, VPN, FW, various service.
- HTML output with cleaner GUI (e.g. collapsible entry showing detail as needed)
- HTML-based search GUI (by uuid, by common type, e.g. edge/SR/all gvni, etc)
