Files
ProxMenux/AppImage/scripts/tests/fixtures/zpool_status_multi_pool.json
T
DrOwlandClaude Opus 5.5 72491b2445 Show ZFS pool layout, scrub status and device health in Storage view
/api/storage now runs a single `zpool status -j --json-int -P` (OpenZFS
2.3+) for all pools and returns, per pool:
- top-level vdevs with type, raidz/draid parity, class (data, special,
  dedup, log, cache, spare), state and read/write/checksum errors
- member devices with path, resolved base disk, state, error counters,
  slow I/Os, and the spare-N/replacing-N they sit under while swapping
- scrub/resilver status (progress only while running), the pool's
  status/action text and data-error count
- fragmentation, capacity and dedup ratio from `zpool list`

This replaces the per-pool `zpool status` text loop whose result
(zfs_disks) was never used. Member paths (by-id, by-partlabel, wwn) are
resolved to base disks via sysfs rather than an lsblk call per device.
On ZFS without `-j`, pools report details_available: false and the UI
falls back to the existing basic card.

The ZFS pool card shows a layout summary (e.g. "RAIDZ2 | 5 disks |
Scrub finished ...") and opens a details dialog with the vdev tree,
per-device error counts, scrub/resilver progress, and links from each
member disk to its disk details dialog.

Tested against `zpool status -j` output from PVE 9 / OpenZFS 2.4.4:
mirror, raidz2, striped mirrors, single-disk pool, and a file-backed
degraded raidz1 with log, cache and spare devices.

Tests cover the `zpool status -j` -> Storage view shape against real
output from PVE 9 / OpenZFS 2.4.4 hosts (serials and WWNs replaced):
mirror, raidz2, single-disk pool, slow I/Os, and a degraded raidz1 with
log, cache and spare devices; plus a synthetic resilver with a spare
swapping in. Member path -> base disk resolution is tested against a
stubbed sysfs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 11:55:02 +00:00

400 lines
10 KiB
JSON

{
"output_version": {
"command": "zpool status",
"vers_major": 0,
"vers_minor": 1
},
"pools": {
"rpool": {
"name": "rpool",
"state": "ONLINE",
"txg": 25710203,
"spa_version": 5000,
"zpl_version": 5,
"scan_stats": {
"function": "SCRUB",
"state": "FINISHED",
"start_time": 1791674641,
"end_time": 1791675294,
"to_examine": 421980536832,
"examined": 421980536832,
"skipped": 22963814,
"processed": 0,
"errors": 0,
"bytes_per_scan": 0,
"pass_start": 1791674660,
"scrub_pause": 0,
"scrub_spent_paused": 0,
"issued_bytes_per_scan": 421980536832,
"issued": 421980536832
},
"vdevs": {
"rpool": {
"name": "rpool",
"vdev_type": "root",
"class": "normal",
"state": "ONLINE",
"alloc_space": 411243118592,
"total_space": 996432412672,
"def_space": 996432412672,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"vdevs": {
"mirror-0": {
"name": "mirror-0",
"vdev_type": "mirror",
"class": "normal",
"state": "ONLINE",
"alloc_space": 411243118592,
"total_space": 996432412672,
"def_space": 996432412672,
"rep_dev_size": 996432412672,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"vdevs": {
"nvme-CT1000P5PSSD8_2231000000A1-part3": {
"name": "nvme-CT1000P5PSSD8_2231000000A1-part3",
"vdev_type": "disk",
"path": "/dev/disk/by-id/nvme-CT1000P5PSSD8_2231000000A1-part3",
"class": "normal",
"state": "ONLINE",
"rep_dev_size": 996432412672,
"phys_space": 999653638144,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"slow_ios": 0,
"guid": 1001
},
"nvme-s0-1tb-open": {
"name": "nvme-s0-1tb-open",
"vdev_type": "disk",
"path": "/dev/disk/by-partlabel/nvme-s0-1tb-open",
"class": "normal",
"state": "ONLINE",
"rep_dev_size": 996432412672,
"phys_space": 999653638144,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"slow_ios": 0,
"guid": 1001
}
},
"guid": 1001
}
},
"guid": 1001
}
},
"error_count": 0,
"pool_guid": 1000
},
"tank-m1": {
"name": "tank-m1",
"state": "ONLINE",
"txg": 32213752,
"spa_version": 5000,
"zpl_version": 5,
"scan_stats": {
"function": "SCRUB",
"state": "FINISHED",
"start_time": 1791674641,
"end_time": 1791675294,
"to_examine": 528280977408,
"examined": 529354719232,
"skipped": 56623104,
"processed": 0,
"errors": 0,
"bytes_per_scan": 0,
"pass_start": 1791674757,
"scrub_pause": 0,
"scrub_spent_paused": 0,
"issued_bytes_per_scan": 507879882752,
"issued": 528280977408
},
"vdevs": {
"tank-m1": {
"name": "tank-m1",
"vdev_type": "root",
"class": "normal",
"state": "ONLINE",
"alloc_space": 525059751936,
"total_space": 996432412672,
"def_space": 996432412672,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"vdevs": {
"mirror-0": {
"name": "mirror-0",
"vdev_type": "mirror",
"class": "normal",
"state": "ONLINE",
"alloc_space": 525059751936,
"total_space": 996432412672,
"def_space": 996432412672,
"rep_dev_size": 996432412672,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"vdevs": {
"ssd-t1-1Tb-mx500": {
"name": "ssd-t1-1Tb-mx500",
"vdev_type": "disk",
"path": "/dev/disk/by-partlabel/ssd-t1-1Tb-mx500",
"class": "normal",
"state": "ONLINE",
"rep_dev_size": 996432412672,
"phys_space": 1000727379968,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"slow_ios": 0,
"guid": 1001
},
"ssd-t2-1Tb-mx500": {
"name": "ssd-t2-1Tb-mx500",
"vdev_type": "disk",
"path": "/dev/disk/by-partlabel/ssd-t2-1Tb-mx500",
"class": "normal",
"state": "ONLINE",
"rep_dev_size": 996432412672,
"phys_space": 1000727379968,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"slow_ios": 69,
"guid": 1001
}
},
"guid": 1001
}
},
"guid": 1001
}
},
"error_count": 0,
"pool_guid": 1000
},
"tank-rz2": {
"name": "tank-rz2",
"state": "ONLINE",
"txg": 7867809,
"spa_version": 5000,
"zpl_version": 5,
"scan_stats": {
"function": "SCRUB",
"state": "FINISHED",
"start_time": 1791674641,
"end_time": 1791675294,
"to_examine": 10511331161538,
"examined": 10522326277816,
"skipped": 10297184092,
"processed": 0,
"errors": 0,
"bytes_per_scan": 0,
"pass_start": 1791674783,
"scrub_pause": 0,
"scrub_spent_paused": 0,
"issued_bytes_per_scan": 10500336045260,
"issued": 10500336045260
},
"vdevs": {
"tank-rz2": {
"name": "tank-rz2",
"vdev_type": "root",
"class": "normal",
"state": "ONLINE",
"alloc_space": 12094627905536,
"total_space": 19241453486080,
"def_space": 11324969766092,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"vdevs": {
"raidz2-0": {
"name": "raidz2-0",
"vdev_type": "raidz",
"class": "normal",
"state": "ONLINE",
"alloc_space": 12094627905536,
"total_space": 19241453486080,
"def_space": 11324969766092,
"rep_dev_size": 19241453486080,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"vdevs": {
"ssd-3T5-Tosh-B001": {
"name": "ssd-3T5-Tosh-B001",
"vdev_type": "disk",
"path": "/dev/disk/by-partlabel/ssd-3T5-Tosh-B001",
"class": "normal",
"state": "ONLINE",
"rep_dev_size": 3837295580938,
"phys_space": 3837295580938,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"slow_ios": 0,
"guid": 1001
},
"ssd-3T5-Tosh-B002": {
"name": "ssd-3T5-Tosh-B002",
"vdev_type": "disk",
"path": "/dev/disk/by-partlabel/ssd-3T5-Tosh-B002",
"class": "normal",
"state": "ONLINE",
"rep_dev_size": 3837295580938,
"phys_space": 3837295580938,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"slow_ios": 0,
"guid": 1001
},
"ssd-3T5-Tosh-B003": {
"name": "ssd-3T5-Tosh-B003",
"vdev_type": "disk",
"path": "/dev/disk/by-partlabel/ssd-3T5-Tosh-B003",
"class": "normal",
"state": "ONLINE",
"rep_dev_size": 3837295580938,
"phys_space": 3837295580938,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"slow_ios": 0,
"guid": 1001
},
"ssd-3T5-Tosh-B004": {
"name": "ssd-3T5-Tosh-B004",
"vdev_type": "disk",
"path": "/dev/disk/by-partlabel/ssd-3T5-Tosh-B004",
"class": "normal",
"state": "ONLINE",
"rep_dev_size": 3837295580938,
"phys_space": 3837295580938,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"slow_ios": 0,
"guid": 1001
},
"ssd-3T5-Tosh-B005": {
"name": "ssd-3T5-Tosh-B005",
"vdev_type": "disk",
"path": "/dev/disk/by-partlabel/ssd-3T5-Tosh-B005",
"class": "normal",
"state": "ONLINE",
"rep_dev_size": 3837295580938,
"phys_space": 3837295580938,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"slow_ios": 0,
"guid": 1001
}
},
"guid": 1001
}
},
"guid": 1001
}
},
"error_count": 0,
"pool_guid": 1000
},
"tank-spin-1": {
"name": "tank-spin-1",
"state": "ONLINE",
"txg": 23263182,
"spa_version": 5000,
"zpl_version": 5,
"scan_stats": {
"function": "SCRUB",
"state": "FINISHED",
"start_time": 1791674641,
"end_time": 1791675294,
"to_examine": 5761440929546,
"examined": 5761440929546,
"skipped": 358629769216,
"processed": 0,
"errors": 0,
"bytes_per_scan": 0,
"pass_start": 1791674909,
"scrub_pause": 0,
"scrub_spent_paused": 0,
"issued_bytes_per_scan": 5398602092380,
"issued": 5398602092380
},
"vdevs": {
"tank-spin-1": {
"name": "tank-spin-1",
"vdev_type": "root",
"class": "normal",
"state": "ONLINE",
"alloc_space": 5662484883046,
"total_space": 7850513022320,
"def_space": 7850513022320,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"vdevs": {
"mirror-0": {
"name": "mirror-0",
"vdev_type": "mirror",
"class": "normal",
"state": "ONLINE",
"alloc_space": 5662484883046,
"total_space": 7850513022320,
"def_space": 7850513022320,
"rep_dev_size": 7850513022320,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"vdevs": {
"wwn-0x5000c50000000001-part1": {
"name": "wwn-0x5000c50000000001-part1",
"vdev_type": "disk",
"path": "/dev/disk/by-id/wwn-0x5000c50000000001-part1",
"class": "normal",
"state": "ONLINE",
"rep_dev_size": 7850513022320,
"phys_space": 7861508138598,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"slow_ios": 0,
"guid": 1001
},
"wwn-0x5000c50000000002-part1": {
"name": "wwn-0x5000c50000000002-part1",
"vdev_type": "disk",
"path": "/dev/disk/by-id/wwn-0x5000c50000000002-part1",
"class": "normal",
"state": "ONLINE",
"rep_dev_size": 7850513022320,
"phys_space": 7861508138598,
"read_errors": 0,
"write_errors": 0,
"checksum_errors": 0,
"slow_ios": 0,
"guid": 1001
}
},
"guid": 1001
}
},
"guid": 1001
}
},
"error_count": 0,
"pool_guid": 1000
}
}
}