{
  "markdown": "<!-- mcp-name: io.github.vmware-skills/vmware-avi -->\n# VMware AVI\n\n> **Author**: Wei Zhou, VMware by Broadcom — wei-wz.zhou@broadcom.com\n> This is a community-driven project by a VMware engineer, not an official VMware product.\n> For official VMware developer tools see [developer.broadcom.com](https://developer.broadcom.com).\n\nEnglish | [中文](README-CN.md)\n\nAVI (NSX Advanced Load Balancer) management and AKO Kubernetes operations tool — 28 tools across 10 categories.\n\n> **Dual mode**: Traditional AVI Controller management + AKO K8s operations in one skill.\n>\n> **Companion skills** handle everything else:\n>\n> | Skill | Scope | Install |\n> |-------|-------|---------|\n> | **[vmware-aiops](https://github.com/vmware-skills/VMware-AIops)** | VM lifecycle, deployment, guest ops, cluster | `uv tool install vmware-aiops` |\n> | **[vmware-monitor](https://github.com/vmware-skills/VMware-Monitor)** | Read-only: inventory, health, alarms, events | `uv tool install vmware-monitor` |\n> | **[vmware-storage](https://github.com/vmware-skills/VMware-Storage)** | Datastores, iSCSI, vSAN management | `uv tool install vmware-storage` |\n> | **[vmware-vks](https://github.com/vmware-skills/VMware-VKS)** | Tanzu Namespaces, TKC cluster lifecycle | `uv tool install vmware-vks` |\n> | **[vmware-nsx](https://github.com/vmware-skills/VMware-NSX)** | NSX networking: segments, gateways, NAT | `uv tool install vmware-nsx-mgmt` |\n> | **[vmware-nsx-security](https://github.com/vmware-skills/VMware-NSX-Security)** | DFW firewall rules, security groups | `uv tool install vmware-nsx-security` |\n> | **[vmware-aria](https://github.com/vmware-skills/VMware-Aria)** | Aria Ops: metrics, alerts, capacity | `uv tool install vmware-aria` |\n\n[![PyPI](https://img.shields.io/pypi/v/vmware-avi)](https://pypi.org/project/vmware-avi/)\n[![Python](https://img.shields.io/pypi/pyversions/vmware-avi)](https://pypi.org/project/vmware-avi/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n[![ClawHub](https://img.shields.io/badge/ClawHub-vmware--avi-orange)](https://clawhub.ai/skills/vmware-avi)\n\n---\n\n## Quick Install\n\n```bash\n# Via uv (recommended)\nuv tool install vmware-avi\n\n# Or via pip\npip install vmware-avi\n\n# China mainland mirror\npip install vmware-avi -i https://pypi.tuna.tsinghua.edu.cn/simple\n\n# Verify installation\nvmware-avi doctor\n```\n\n### Offline / Air-Gapped Install (from source)\n\nThis project uses the modern PEP 517 build system (hatchling), so there is **no\n`setup.py`** by design — that is expected, not a missing file. If you cloned the\nsource and hit `ERROR: File \"setup.py\" or \"setup.cfg\" not found ... editable mode\ncurrently requires a setuptools-based build`, your `pip` is older than 21.3 and\ncannot do an *editable* (`-e`) install with a non-setuptools backend. Editable\nmode is a developer convenience, not needed to run the tool — do one of:\n\n```bash\n# From the source tree — a normal (non-editable) install builds a wheel:\npip install .              # NOT  pip install -e .\n\n# ...or upgrade pip first, and editable works too:\npip install --upgrade pip && pip install -e .\n```\n\nFor a **truly air-gapped host**, build the wheels on a connected machine and copy\nthem over — the target then needs no network:\n\n```bash\n# On a connected machine, collect this package + its dependencies as wheels:\npip wheel . -w dist        # → dist/*.whl   (or: uv build, for just this package)\n\n# Copy dist/ to the air-gapped host, then install offline:\npip install --no-index --find-links dist vmware-avi\n```\n\n---\n\n## Capabilities Overview\n\n### What This Skill Does\n\n| Category | Tools | Count |\n|----------|-------|:-----:|\n| **Virtual Service** | list, status, enable/disable | 3 |\n| **Pool Member** | pool discovery, member list, enable/disable member (drain/restore traffic) | 4 |\n| **SSL Certificate** | list, expiry check | 2 |\n| **Analytics** | VS metrics overview, request error logs | 2 |\n| **Service Engine** | list, health check | 2 |\n| **AKO Pod Ops** | status, logs, restart, version info | 4 |\n| **AKO Config** | values.yaml view, Helm diff, Helm upgrade | 3 |\n| **Ingress Diagnostics** | annotation validation, VS mapping, error diagnosis, fix recommendation | 4 |\n| **Sync Diagnostics** | K8s-Controller comparison, inconsistency list, force resync | 3 |\n| **Multi-cluster** | cluster list, cross-cluster AKO overview, AMKO status | 3 |\n\n### CLI vs MCP: Which Mode to Use\n\n| Scenario | Recommended | Why |\n|----------|:-----------:|-----|\n| **Local/small models** (Ollama, Qwen) | **CLI** | ~2K tokens vs ~8K for MCP |\n| **Cloud models** (Claude, GPT-4o) | Either | MCP gives structured JSON I/O |\n| **Automated pipelines** | **MCP** | Type-safe parameters, structured output |\n| **AKO troubleshooting** | **CLI** | Interactive log tailing, Helm diff output |\n\n> **Rule of thumb**: Use CLI for cost efficiency and small models. Use MCP for structured automation with large models.\n\n### Architecture\n\n```\nUser (Natural Language)\n  |\nAI CLI Tool (Claude Code / Gemini / Codex / Cursor / Trae)\n  | reads SKILL.md\n  |\nvmware-avi CLI\n  |--- avisdk (AVI REST API) ---> AVI Controller ---> Virtual Services / Pools / SEs\n  |--- kubectl / kubernetes ---> K8s Cluster ---> AKO Pods / Ingress / Services\n```\n\n---\n\n## Configuration\n\n### Step 1: Create Config Directory\n\n```bash\nmkdir -p ~/.vmware-avi\nvmware-avi init          # generates config.yaml and .env templates\nchmod 600 ~/.vmware-avi/.env\n```\n\n### Step 2: Edit config.yaml\n\n```yaml\ncontrollers:\n  - name: prod-avi\n    host: avi-controller.example.com\n    username: admin\n    api_version: \"22.1.4\"\n    tenant: admin\n    port: 443\n    verify_ssl: true\n\ndefault_controller: prod-avi\n\nako:\n  kubeconfig: ~/.kube/config\n  default_context: \"\"\n  namespace: avi-system\n```\n\n### Step 3: Set Passwords\n\nCreate `~/.vmware-avi/.env`:\n\n```bash\n# AVI Controller passwords\n# Format: {CONTROLLER_NAME_UPPER}_PASSWORD\nPROD_AVI_PASSWORD=your-password-here\n```\n\nPassword environment variable naming convention:\n```\n{CONTROLLER_NAME_UPPER}_PASSWORD\n# Replace hyphens with underscores, UPPERCASE\n# Example: controller \"prod-avi\" -> PROD_AVI_PASSWORD\n# Example: controller \"staging-alb\" -> STAGING_ALB_PASSWORD\n```\n\n### Step 4: Verify\n\n```bash\nvmware-avi doctor    # checks Controller connectivity + kubeconfig + avisdk\n```\n\n---\n\n## CLI Usage\n\n### Virtual Service Management\n\n```bash\n# List all virtual services\nvmware-avi vs list [--controller prod-avi]\n\n# Check status of a specific VS\nvmware-avi vs status my-webapp-vs\n\n# Enable / disable a VS (disable requires double confirmation)\nvmware-avi vs enable my-webapp-vs\nvmware-avi vs disable my-webapp-vs\n```\n\n### Pool Member Drain / Restore\n\n```bash\n# List pool members and health status\nvmware-avi pool members my-pool\n\n# Graceful drain (disable) — double confirmation required\nvmware-avi pool disable my-pool 10.1.1.5\n\n# Restore traffic (enable)\nvmware-avi pool enable my-pool 10.1.1.5\n```\n\n### SSL Certificate Expiry Check\n\n```bash\n# List all certificates\nvmware-avi ssl list\n\n# Check certificates expiring within 30 days\nvmware-avi ssl expiry --days 30\n```\n\n### Analytics and Error Logs\n\n```bash\n# VS analytics: throughput, latency, error rates\nvmware-avi analytics my-webapp-vs\n\n# Request error logs\nvmware-avi logs my-webapp-vs --since 1h\n```\n\n### Service Engine Health\n\n```bash\n# Name, mgmt IP, operational status, SE group — status sourced from the\n# serviceengine-inventory endpoint (config + runtime merged)\nvmware-avi se list\n\n# Per-SE operational status + connected-VS counts\nvmware-avi se health\n```\n\n### AKO Troubleshooting\n\n```bash\n# Check AKO pod status\nvmware-avi ako status [--context my-k8s-context]\n\n# View AKO logs\nvmware-avi ako logs [--tail 100] [--since 30m]\n\n# Restart AKO pod (double confirmation)\nvmware-avi ako restart\n\n# Show AKO version\nvmware-avi ako version\n```\n\n### AKO Helm Config Management\n\nThe AKO Helm release is discovered automatically (official installs use\n`helm install --generate-name`, so the release is not named `ako`). Upgrades pull\nthe official Broadcom OCI chart\n`oci://projects.packages.broadcom.com/ako/helm-charts/ako` with `--reuse-values`.\n\n```bash\n# View current AKO Helm values (release auto-discovered)\nvmware-avi ako config show\n\n# Show pending changes (diff against the official OCI chart)\nvmware-avi ako config diff\n\n# Helm upgrade (double confirmation + --dry-run default)\nvmware-avi ako config upgrade\n```\n\n### Ingress Diagnostics\n\n```bash\n# Validate Ingress annotations\nvmware-avi ako ingress check <namespace>\n\n# Show Ingress-to-VS mapping\nvmware-avi ako ingress map\n\n# Diagnose why an Ingress has no VS\nvmware-avi ako ingress diagnose <ingress-name>\n```\n\n### Sync Diagnostics\n\n```bash\n# Check K8s-Controller sync status\nvmware-avi ako sync status\n\n# Show inconsistencies between K8s and Controller\nvmware-avi ako sync diff\n\n# Force AKO resync (double confirmation)\nvmware-avi ako sync force\n```\n\n### Multi-cluster AKO\n\n```bash\n# List clusters with AKO deployed\nvmware-avi ako clusters\n\n# Cross-cluster AKO status overview\nvmware-avi ako cluster-overview\n\n# AMKO GSLB status\nvmware-avi ako amko status\n```\n\n---\n\n## MCP Server\n\nThe MCP server exposes all 28 tools via the [Model Context Protocol](https://modelcontextprotocol.io). Works with any MCP-compatible client.\n\n**After `uv tool install vmware-avi`, start the MCP server with one command** (v1.5.15+):\n\n```bash\n# Recommended — single command, no network re-resolve\nvmware-avi mcp\n\n# With custom config path\nVMWARE_AVI_CONFIG=/path/to/config.yaml vmware-avi mcp\n```\n\n### Claude Desktop Config\n\nAdd to `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"vmware-avi\": {\n      \"command\": \"vmware-avi\",\n      \"args\": [\"mcp\"],\n      \"env\": {\n        \"VMWARE_AVI_CONFIG\": \"~/.vmware-avi/config.yaml\"\n      }\n    }\n  }\n}\n```\n\n<details>\n<summary>Alternative: uvx (no install) or legacy entry point</summary>\n\n```bash\n# Run without installing (requires PyPI access each launch)\nuvx --from vmware-avi vmware-avi mcp\n\n# Legacy entry point (still works, kept for backward compatibility)\nvmware-avi-mcp\n```\n\n> **Behind a corporate TLS proxy?** uvx may fail with `invalid peer certificate: UnknownIssuer`.\n> Use the recommended `vmware-avi mcp` form above (no network needed), or set `UV_NATIVE_TLS=true`.\n\n</details>\n\n### MCP Tools (28)\n\n| Category | Tools |\n|----------|-------|\n| Virtual Service (3) | `vs_list`, `vs_status`, `vs_toggle` |\n| Pool Member (4) | `pool_list`, `pool_members`, `pool_member_enable`, `pool_member_disable` |\n| SSL Certificate (2) | `ssl_list`, `ssl_expiry_check` |\n| Analytics (2) | `vs_analytics`, `vs_error_logs` |\n| Service Engine (2) | `se_list`, `se_health` |\n| AKO Pod (4) | `ako_status`, `ako_logs`, `ako_restart`, `ako_version` |\n| AKO Config (3) | `ako_config_show`, `ako_config_diff`, `ako_config_upgrade` |\n| Ingress Diagnostics (3) | `ako_ingress_check`, `ako_ingress_map`, `ako_ingress_diagnose` |\n| Sync Diagnostics (3) | `ako_sync_status`, `ako_sync_diff`, `ako_sync_force` |\n| Multi-cluster (2) | `ako_clusters`, `ako_amko_status` |\n\n---\n\n## Common Workflows\n\n### 1. Maintenance Window -- Drain a Pool Member\n\nWhen taking a backend server offline for patching:\n\n1. List pool members and health status\n   ```bash\n   vmware-avi pool members my-pool\n   ```\n2. Disable the target server (graceful drain)\n   ```bash\n   vmware-avi pool disable my-pool 10.1.1.5\n   ```\n3. Monitor analytics to confirm active connections are draining\n   ```bash\n   vmware-avi analytics my-vs\n   ```\n4. Perform maintenance on the server\n5. Re-enable the server\n   ```bash\n   vmware-avi pool enable my-pool 10.1.1.5\n   ```\n6. Verify health status is green\n   ```bash\n   vmware-avi pool members my-pool\n   ```\n\n### 2. AKO Ingress Not Creating VS\n\nWhen a developer reports their Ingress is not producing a Virtual Service:\n\n1. Verify AKO is running\n   ```bash\n   vmware-avi ako status\n   ```\n2. Validate Ingress annotations\n   ```bash\n   vmware-avi ako ingress check <namespace>\n   ```\n3. Check sync status between K8s and Controller\n   ```bash\n   vmware-avi ako sync status\n   ```\n4. If annotations are wrong, diagnose the specific Ingress\n   ```bash\n   vmware-avi ako ingress diagnose <ingress-name>\n   ```\n5. If sync drift is detected, review the diff and force resync if needed\n   ```bash\n   vmware-avi ako sync diff\n   vmware-avi ako sync force\n   ```\n\n### 3. SSL Certificate Expiry Audit\n\nExpired certificates cause outages. Run periodic checks:\n\n1. Check all certificates expiring within 30 days\n   ```bash\n   vmware-avi ssl expiry --days 30\n   ```\n2. Review which VS uses each expiring certificate (output includes VS mapping)\n3. Plan renewal with the certificate team\n4. After renewal, verify the new certificate is in place\n   ```bash\n   vmware-avi ssl list\n   ```\n\n---\n\n## Troubleshooting\n\n### \"Controller unreachable\" error\n\n1. Run `vmware-avi doctor` to verify connectivity\n2. Check if the controller address and port are correct in `~/.vmware-avi/config.yaml`\n3. For self-signed certs: set `verify_ssl: false` in config.yaml (lab environments only)\n\n### AKO Pod in CrashLoopBackOff\n\n1. Check logs: `vmware-avi ako logs --tail 50`\n2. Common causes: wrong controller IP in values.yaml, network policy blocking AKO to Controller, expired credentials\n3. Fix config: `vmware-avi ako config show` to inspect, then `vmware-avi ako config upgrade` with corrected values (release auto-discovered; pulls the official Broadcom OCI chart)\n\n### Ingress created but no VS on Controller\n\n1. Validate annotations: `vmware-avi ako ingress check <namespace>`\n2. Check AKO logs for rejection reason: `vmware-avi ako logs --since 5m`\n3. Run sync diff: `vmware-avi ako sync diff` to see if the object is stuck\n\n### Pool member shows \"down\" after enable\n\nHealth monitor may still be failing. The member is enabled but unhealthy. Check the actual health status on the Controller side. Fix the backend service first, then the health status will auto-recover.\n\n### SSL expiry check shows 0 certificates\n\nVerify the controller connection has tenant-level access. Certificates are tenant-scoped in AVI. The configured user may only see certs in their tenant.\n\n### AKO sync force has no effect\n\nForce resync triggers AKO to re-reconcile all K8s objects. If the drift persists, the issue is likely in the K8s resource definition itself (bad annotation, missing secret). Use `vmware-avi ako ingress diagnose` to pinpoint the root cause.\n\n---\n\n## Safety Features\n\n| Feature | Details |\n|---------|---------|\n| **Double Confirmation** | Destructive ops (VS disable, pool member disable, AKO restart, Helm upgrade, force resync) require 2 sequential confirmations |\n| **Dry-Run Default** | `ako config upgrade` defaults to `--dry-run` mode -- user must explicitly confirm to apply |\n| **Audit Trail** | All operations logged to `~/.vmware/audit.db` via vmware-policy (`@vmware_tool` decorator) |\n| **Password Protection** | `.env` file loading with permission check; never in shell history |\n| **SSL Support** | `verify_ssl: false` for self-signed certs in isolated lab environments only |\n| **Prompt Injection Protection** | All API-sourced text truncated (500 chars max) and C0/C1 control characters stripped |\n| **Input Validation** | Pool names, VS names, IP addresses, and namespace names validated before API calls |\n\n### Security Details\n\n- **Source Code**: [github.com/vmware-skills/VMware-AVI](https://github.com/vmware-skills/VMware-AVI)\n- **Config File Contents**: `config.yaml` stores controller addresses, usernames, and AKO settings. No passwords or tokens. All secrets stored exclusively in `.env`\n- **Webhook Data Scope**: Disabled by default. No third-party data transmission\n- **TLS Verification**: Enabled by default. Disable only for self-signed certificate environments\n- **Prompt Injection Protection**: `_sanitize()` truncation + control character cleanup on all AVI API responses\n- **Least Privilege**: Use a dedicated AVI service account with minimal permissions. AKO operations require only namespace-scoped kubeconfig access\n\n---\n\n## Companion Skills\n\n| Skill | Scope | Tools | Install |\n|-------|-------|:-----:|---------|\n| **[vmware-avi](https://github.com/vmware-skills/VMware-AVI)** | AVI load balancer, AKO K8s operations | 28 | `uv tool install vmware-avi` |\n| **[vmware-aiops](https://github.com/vmware-skills/VMware-AIops)** | VM lifecycle, deployment, guest ops, cluster | 49 | `uv tool install vmware-aiops` |\n| **[vmware-monitor](https://github.com/vmware-skills/VMware-Monitor)** | Read-only monitoring, alarms, events | 27 | `uv tool install vmware-monitor` |\n| **[vmware-storage](https://github.com/vmware-skills/VMware-Storage)** | Datastores, iSCSI, vSAN | 11 | `uv tool install vmware-storage` |\n| **[vmware-vks](https://github.com/vmware-skills/VMware-VKS)** | Tanzu Namespaces, TKC cluster lifecycle | 20 | `uv tool install vmware-vks` |\n| **[vmware-nsx](https://github.com/vmware-skills/VMware-NSX)** | NSX segments, gateways, NAT, routing | 33 | `uv tool install vmware-nsx-mgmt` |\n| **[vmware-nsx-security](https://github.com/vmware-skills/VMware-NSX-Security)** | DFW firewall, security groups, IDS/IPS | 21 | `uv tool install vmware-nsx-security` |\n| **[vmware-aria](https://github.com/vmware-skills/VMware-Aria)** | Aria Ops: metrics, alerts, capacity | 28 | `uv tool install vmware-aria` |\n| **[vmware-harden](https://github.com/vmware-skills/VMware-Harden)** | Compliance baselines, drift detection | 6 | `uv tool install vmware-harden` |\n\n---\n\n## Version Compatibility\n\n| AVI Controller / Environment | Support | Notes |\n|------------------------------|---------|-------|\n| AVI 30.x in VCF 9.1 | ✅ Full | avisdk 30.x line covers VCF 9.1 bundle |\n| AVI 30.x in VCF 9.0 | ✅ Full | Standard AVI / NSX ALB integration |\n| AVI 22.x — 31.x standalone | ✅ Full | Pin `avisdk>=22.1,<31.0` |\n| AKO 1.10+ | ✅ Full | Kubernetes integration via AKO ConfigMap / GatewayClass |\n\n#### Official Broadcom References\n\n- **SDKs**: <https://developer.broadcom.com/sdks> — VCF Python SDK\n- **REST APIs**: <https://developer.broadcom.com/xapis> — AVI Controller REST API\n- **CLI Tools**: <https://developer.broadcom.com/tools> — VCF PowerCLI 9.1\n\n---\n\n## Troubleshooting & Contributing\n\nIf you encounter any errors or issues, please send the error message, logs, or screenshots to **zhouwei008@gmail.com**. Contributions are welcome -- feel free to join us in maintaining and improving this project!\n\n## License\n\nMIT\n",
  "bytes": 18382,
  "sha": "c64c355bed80d1202afa3e3539b7ccc84b1efb5c9c1f6524eec8f5f687ea5fea",
  "repo_slug": "zw008/vmware-avi",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_zw008_vmware_avi_91884353/readme"
}