Commit 2ec5a01
feat(kubevirt): add vm_troubleshoot tool for automated VM diagnostics
Adds a new `vm_troubleshoot` MCP Tool that collects comprehensive
diagnostic data for KubeVirt VirtualMachines including VM/VMI status,
DataVolume/PVC state, cloud-init configuration, virt-launcher pod state,
pod logs, and related events.
Key features:
- Targeted event collection using field selectors (no namespace-wide scan)
- DataVolume/PVC status with StorageClass identification
- Cloud-init extraction with sensitive field redaction (passwords, SSH keys)
- Only falls back to PVC lookup when DataVolume is genuinely NotFound
This tool enables AI assistants to proactively diagnose VM issues such as
missing StorageClasses, invalid PVC specs, misconfigured cloud-init, and
scheduling constraints without requiring the user to manually inspect
resources.
Complements the existing vm-troubleshoot Prompt with a proper Tool that
LLMs can invoke automatically based on user intent.
Signed-off-by: Shirly Radco <sradco@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 28a4f1e commit 2ec5a01
4 files changed
Lines changed: 1326 additions & 0 deletions
File tree
- pkg
- mcp/testdata
- toolsets/kubevirt
- vm/troubleshoot
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
236 | 265 | | |
237 | 266 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
0 commit comments