zpool.query¶
Query ZFS pools with flexible options for properties, topology, scan, and features.
Returns information about both imported and non-imported pools. By default, only minimal data is returned (name, guid, status, health); additional sections like topology, scan, properties, etc. must be opted into via their respective flags. Pools that exist in the database but are not currently imported are returned with an OFFLINE status.
The boot pool can be queried by explicitly passing its name in pool_names. It is excluded from results when pool_names is null (query-all mode).
Examples:
# Query all pools (minimal info: name, guid, status, health) {}
# Query specific pools with properties {
"pool_names": ["tank", "boot-pool"], "properties": ["size", "capacity"] }
# Query with full topology and scan information {
"pool_names": ["tank"], "topology": true, "scan": true }
# Query everything {
"topology": true, "scan": true, "expand": true, "features": true, "properties": ["size", "capacity", "health"] }
No Additional Items
Tuple Validation
Parameter 1: data
data
Type: objectQuery parameters.
No Additional PropertiesPool Names
Default: nullPool names to query. None queries all imported pools.
No Additional Items
Each item of this array must be:
Properties
Default: nullProperty names to retrieve. None returns no properties.
No Additional Items
Each item of this array must be:
Topology
Type: boolean Default: falseInclude vdev topology.
Scan
Type: boolean Default: falseInclude scan/scrub information.
Expand
Type: boolean Default: falseInclude expansion information.
Features
Type: boolean Default: falseInclude feature flags.
Result
Type: array of objectNo Additional Items
Each item of this array must be:
ZPoolEntry
Type: objectNo Additional Properties
Name
Type: stringName of the zpool.
Guid
Type: integerGlobally unique identifier for the pool.
Status
Type: stringCurrent pool status (ONLINE, DEGRADED, FAULTED, OFFLINE, etc.).
Healthy
Type: booleanWhether the pool is in a healthy state.
Warning
Type: booleanWhether the pool has warning conditions.
Status Code
Detailed status code (e.g., OK, ERRATA, FEATDISABLED, LOCKEDSED_DISKS).
Status Detail
Human-readable status description.
Properties
Default: nullPool properties, keyed by property name.
Each additional property must conform to the following schema
ZPoolPropertyValue
Type: objectNo Additional Properties
Raw
Type: stringThe raw string representation of the property.
Source
The source from where this property received its value (DEFAULT, LOCAL, NONE, etc.).
Value
The native Python value of the property.
Pool vdev topology.
ZPoolTopology
Type: objectNo Additional Properties
Data
Type: array of objectArray of data vdev configurations.
No Additional ItemsEach item of this array must be:
ZPoolVdev
Type: objectNo Additional Properties
Name
Type: stringVdev name (e.g., 'mirror-0', '/dev/sda1').
Vdev Type
Type: stringVdev type (e.g., 'mirror', 'raidz1', 'disk').
Guid
Type: integerGlobally unique identifier for this vdev.
State
Type: stringCurrent state (ONLINE, DEGRADED, FAULTED, OFFLINE, UNAVAIL, etc.).
ZPoolVdevStats
Type: objectVdev I/O statistics.
No Additional PropertiesTimestamp
Type: integer Default: 0High-resolution timestamp (nanoseconds).
Allocated
Type: integer Default: 0Allocated space in bytes.
Space
Type: integer Default: 0Total space in bytes.
Dspace
Type: integer Default: 0Deflated (compressed) space.
Pspace
Type: integer Default: 0Physical space.
Rsize
Type: integer Default: 0Replaceable dev size.
Esize
Type: integer Default: 0Expandable dev size.
Read Errors
Type: integer Default: 0Number of read errors.
Write Errors
Type: integer Default: 0Number of write errors.
Checksum Errors
Type: integer Default: 0Number of checksum errors.
Initialize Errors
Type: integer Default: 0Number of initialize errors.
Dio Verify Errors
Type: integer Default: 0Number of direct I/O verify errors.
Slow Ios
Default: nullNumber of slow I/Os.
Self Healed Bytes
Type: integer Default: 0Self-healed bytes.
Fragmentation
Type: integer Default: 0Fragmentation percentage.
Scan Processed
Type: integer Default: 0Bytes processed by scan.
Scan Removing
Type: integer Default: 0Bytes processed by removal.
Rebuild Processed
Type: integer Default: 0Bytes processed by rebuild.
Noalloc
Type: integer Default: 0Allocations halted.
Ops Read
Type: integer Default: 0Read operations.
Ops Write
Type: integer Default: 0Write operations.
Bytes Read
Type: integer Default: 0Bytes read.
Bytes Write
Type: integer Default: 0Bytes written.
Configured Ashift
Default: nullConfigured ashift value.
Logical Ashift
Default: nullLogical ashift value.
Physical Ashift
Default: nullPhysical ashift value.
Children
Type: array of objectChild vdevs.
No Additional ItemsEach item of this array must be:
ZPoolVdev
Type: objectNo Additional Properties
Name
Type: stringVdev name (e.g., 'mirror-0', '/dev/sda1').
Vdev Type
Type: stringVdev type (e.g., 'mirror', 'raidz1', 'disk').
Guid
Type: integerGlobally unique identifier for this vdev.
State
Type: stringCurrent state (ONLINE, DEGRADED, FAULTED, OFFLINE, UNAVAIL, etc.).
Vdev I/O statistics.
Children
Type: arrayChild vdevs.
No Additional ItemsEach item of this array must be:
Top Guid
Default: nullGUID of the top-level vdev this belongs to.
Top Guid
Default: nullGUID of the top-level vdev this belongs to.
Log
Type: array of objectArray of ZFS Intent Log (ZIL) vdev configurations.
No Additional ItemsEach item of this array must be:
ZPoolVdev
Type: objectNo Additional Properties
Name
Type: stringVdev name (e.g., 'mirror-0', '/dev/sda1').
Vdev Type
Type: stringVdev type (e.g., 'mirror', 'raidz1', 'disk').
Guid
Type: integerGlobally unique identifier for this vdev.
State
Type: stringCurrent state (ONLINE, DEGRADED, FAULTED, OFFLINE, UNAVAIL, etc.).
Vdev I/O statistics.
Children
Type: arrayChild vdevs.
No Additional ItemsEach item of this array must be:
Top Guid
Default: nullGUID of the top-level vdev this belongs to.
Cache
Type: array of objectArray of L2ARC cache vdev configurations.
No Additional ItemsEach item of this array must be:
ZPoolVdev
Type: objectNo Additional Properties
Name
Type: stringVdev name (e.g., 'mirror-0', '/dev/sda1').
Vdev Type
Type: stringVdev type (e.g., 'mirror', 'raidz1', 'disk').
Guid
Type: integerGlobally unique identifier for this vdev.
State
Type: stringCurrent state (ONLINE, DEGRADED, FAULTED, OFFLINE, UNAVAIL, etc.).
Vdev I/O statistics.
Children
Type: arrayChild vdevs.
No Additional ItemsEach item of this array must be:
Top Guid
Default: nullGUID of the top-level vdev this belongs to.
Spares
Type: array of objectArray of spare disk configurations.
No Additional ItemsEach item of this array must be:
ZPoolVdev
Type: objectNo Additional Properties
Name
Type: stringVdev name (e.g., 'mirror-0', '/dev/sda1').
Vdev Type
Type: stringVdev type (e.g., 'mirror', 'raidz1', 'disk').
Guid
Type: integerGlobally unique identifier for this vdev.
State
Type: stringCurrent state (ONLINE, DEGRADED, FAULTED, OFFLINE, UNAVAIL, etc.).
Vdev I/O statistics.
Children
Type: arrayChild vdevs.
No Additional ItemsEach item of this array must be:
Top Guid
Default: nullGUID of the top-level vdev this belongs to.
Stripe
Type: array of objectArray of stripe (single-disk) vdev configurations.
No Additional ItemsEach item of this array must be:
ZPoolVdev
Type: objectNo Additional Properties
Name
Type: stringVdev name (e.g., 'mirror-0', '/dev/sda1').
Vdev Type
Type: stringVdev type (e.g., 'mirror', 'raidz1', 'disk').
Guid
Type: integerGlobally unique identifier for this vdev.
State
Type: stringCurrent state (ONLINE, DEGRADED, FAULTED, OFFLINE, UNAVAIL, etc.).
Vdev I/O statistics.
Children
Type: arrayChild vdevs.
No Additional ItemsEach item of this array must be:
Top Guid
Default: nullGUID of the top-level vdev this belongs to.
Special
Type: array of objectArray of special vdev configurations for metadata.
No Additional ItemsEach item of this array must be:
ZPoolVdev
Type: objectNo Additional Properties
Name
Type: stringVdev name (e.g., 'mirror-0', '/dev/sda1').
Vdev Type
Type: stringVdev type (e.g., 'mirror', 'raidz1', 'disk').
Guid
Type: integerGlobally unique identifier for this vdev.
State
Type: stringCurrent state (ONLINE, DEGRADED, FAULTED, OFFLINE, UNAVAIL, etc.).
Vdev I/O statistics.
Children
Type: arrayChild vdevs.
No Additional ItemsEach item of this array must be:
Top Guid
Default: nullGUID of the top-level vdev this belongs to.
Dedup
Type: array of objectArray of deduplication table vdev configurations.
No Additional ItemsEach item of this array must be:
ZPoolVdev
Type: objectNo Additional Properties
Name
Type: stringVdev name (e.g., 'mirror-0', '/dev/sda1').
Vdev Type
Type: stringVdev type (e.g., 'mirror', 'raidz1', 'disk').
Guid
Type: integerGlobally unique identifier for this vdev.
State
Type: stringCurrent state (ONLINE, DEGRADED, FAULTED, OFFLINE, UNAVAIL, etc.).
Vdev I/O statistics.
Children
Type: arrayChild vdevs.
No Additional ItemsEach item of this array must be:
Top Guid
Default: nullGUID of the top-level vdev this belongs to.
Most recent scrub or resilver information.
ZPoolScan
Type: objectNo Additional Properties
Function
Type: enum (of string)Type of ZFS pool scan.
Must be one of:
- "RESILVER"
- "SCRUB"
State
Type: enum (of string)Current lifecycle state of the scan.
Must be one of:
- "SCANNING"
- "FINISHED"
- "CANCELED"
Start Time
Type: integerScan start time (unix timestamp).
End Time
Scan end time as unix timestamp (null while the scan is still running).
Percentage
Type: numberScan progress (between 0 and 100%).
Bytes To Process
Type: integerTotal bytes located by scanner.
Bytes Processed
Type: integerTotal bytes to scan.
Bytes Issued
Type: integerIssued bytes per scan pass.
Pause
Pause time as unix timestamp (null if the scan is not paused).
Errors
Type: integerNumber of scan errors.
Total Secs Left
Number of seconds left (null if the scan is not running).
RAIDZ expansion information.
ZPoolExpand
Type: objectNo Additional Properties
State
Type: stringExpansion state (e.g., SCANNING, FINISHED).
Expanding Vdev
Type: integerIndex of the vdev being expanded.
Start Time
Type: integerExpansion start time (unix timestamp).
End Time
Expansion end time as unix timestamp (null while expanding).
Bytes To Reflow
Type: integerTotal bytes that need to be reflowed.
Bytes Reflowed
Type: integerTotal bytes reflowed so far.
Waiting For Resilver
Type: integerNon-zero if expansion is waiting for a resilver to complete.
Total Secs Left
Estimated seconds remaining (null if not expanding).
Percentage
Type: numberExpansion progress (between 0 and 100%).
Features
Default: nullPool feature flags.
No Additional Items
Each item of this array must be:
ZPoolFeature
Type: objectNo Additional Properties
Name
Type: stringFeature name.
Guid
Type: stringFeature GUID.
Description
Type: stringFeature description.
State
Type: stringFeature state.
Required roles: POOL_READ