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"] }
Type: object

Type: array
No Additional Items

Tuple Validation

Parameter 1: data

data

Type: object
Default:
{ "pool_names": null, "properties": null, "topology": false, "scan": false, "expand": false, "features": false }

Query parameters.

No Additional Properties

Pool Names

Default: null

Pool names to query. None queries all imported pools.

Type: array of string
No Additional Items
Each item of this array must be:
Type: string
Type: null

Properties

Default: null

Property names to retrieve. None returns no properties.

Type: array of string
No Additional Items
Each item of this array must be:
Type: string
Type: null

Topology

Type: boolean Default: false

Include vdev topology.

Scan

Type: boolean Default: false

Include scan/scrub information.

Expand

Type: boolean Default: false

Include expansion information.

Features

Type: boolean Default: false

Include feature flags.

Result

Type: array of object
No Additional Items
Each item of this array must be:

ZPoolEntry

Type: object
No Additional Properties

Name

Type: string

Name of the zpool.

Guid

Type: integer

Globally unique identifier for the pool.

Status

Type: string

Current pool status (ONLINE, DEGRADED, FAULTED, OFFLINE, etc.).

Healthy

Type: boolean

Whether the pool is in a healthy state.

Warning

Type: boolean

Whether the pool has warning conditions.

Status Code


Detailed status code (e.g., OK, ERRATA, FEATDISABLED, LOCKEDSED_DISKS).

Type: string
Type: null

Status Detail


Human-readable status description.

Type: string
Type: null

Properties

Default: null

Pool properties, keyed by property name.

Type: object

Each additional property must conform to the following schema

ZPoolPropertyValue

Type: object
No Additional Properties

Raw

Type: string

The raw string representation of the property.

Source


The source from where this property received its value (DEFAULT, LOCAL, NONE, etc.).

Type: string
Type: null

Value


The native Python value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null
Type: null

Default: null

Pool vdev topology.

ZPoolTopology

Type: object
No Additional Properties

Data

Type: array of object

Array of data vdev configurations.

No Additional Items
Each item of this array must be:

ZPoolVdev

Type: object
No Additional Properties

Name

Type: string

Vdev name (e.g., 'mirror-0', '/dev/sda1').

Vdev Type

Type: string

Vdev type (e.g., 'mirror', 'raidz1', 'disk').

Guid

Type: integer

Globally unique identifier for this vdev.

State

Type: string

Current state (ONLINE, DEGRADED, FAULTED, OFFLINE, UNAVAIL, etc.).

ZPoolVdevStats

Type: object

Vdev I/O statistics.

No Additional Properties

Timestamp

Type: integer Default: 0

High-resolution timestamp (nanoseconds).

Allocated

Type: integer Default: 0

Allocated space in bytes.

Space

Type: integer Default: 0

Total space in bytes.

Dspace

Type: integer Default: 0

Deflated (compressed) space.

Pspace

Type: integer Default: 0

Physical space.

Rsize

Type: integer Default: 0

Replaceable dev size.

Esize

Type: integer Default: 0

Expandable dev size.

Read Errors

Type: integer Default: 0

Number of read errors.

Write Errors

Type: integer Default: 0

Number of write errors.

Checksum Errors

Type: integer Default: 0

Number of checksum errors.

Initialize Errors

Type: integer Default: 0

Number of initialize errors.

Dio Verify Errors

Type: integer Default: 0

Number of direct I/O verify errors.

Slow Ios

Default: null

Number of slow I/Os.

Type: integer
Type: null

Self Healed Bytes

Type: integer Default: 0

Self-healed bytes.

Fragmentation

Type: integer Default: 0

Fragmentation percentage.

Scan Processed

Type: integer Default: 0

Bytes processed by scan.

Scan Removing

Type: integer Default: 0

Bytes processed by removal.

Rebuild Processed

Type: integer Default: 0

Bytes processed by rebuild.

Noalloc

Type: integer Default: 0

Allocations halted.

Ops Read

Type: integer Default: 0

Read operations.

Ops Write

Type: integer Default: 0

Write operations.

Bytes Read

Type: integer Default: 0

Bytes read.

Bytes Write

Type: integer Default: 0

Bytes written.

Configured Ashift

Default: null

Configured ashift value.

Type: integer
Type: null

Logical Ashift

Default: null

Logical ashift value.

Type: integer
Type: null

Physical Ashift

Default: null

Physical ashift value.

Type: integer
Type: null

Children

Type: array of object

Child vdevs.

No Additional Items
Each item of this array must be:

ZPoolVdev

Type: object
No Additional Properties

Name

Type: string

Vdev name (e.g., 'mirror-0', '/dev/sda1').

Vdev Type

Type: string

Vdev type (e.g., 'mirror', 'raidz1', 'disk').

Guid

Type: integer

Globally unique identifier for this vdev.

State

Type: string

Current state (ONLINE, DEGRADED, FAULTED, OFFLINE, UNAVAIL, etc.).

Type: object

Vdev I/O statistics.

Children

Type: array

Child vdevs.

No Additional Items
Each item of this array must be:
Type: object

Top Guid

Default: null

GUID of the top-level vdev this belongs to.

Type: integer
Type: null

Top Guid

Default: null

GUID of the top-level vdev this belongs to.

Type: integer
Type: null

Log

Type: array of object

Array of ZFS Intent Log (ZIL) vdev configurations.

No Additional Items
Each item of this array must be:

ZPoolVdev

Type: object
No Additional Properties

Name

Type: string

Vdev name (e.g., 'mirror-0', '/dev/sda1').

Vdev Type

Type: string

Vdev type (e.g., 'mirror', 'raidz1', 'disk').

Guid

Type: integer

Globally unique identifier for this vdev.

State

Type: string

Current state (ONLINE, DEGRADED, FAULTED, OFFLINE, UNAVAIL, etc.).

Type: object

Vdev I/O statistics.

Children

Type: array

Child vdevs.

No Additional Items
Each item of this array must be:
Type: object

Top Guid

Default: null

GUID of the top-level vdev this belongs to.

Type: integer
Type: null

Cache

Type: array of object

Array of L2ARC cache vdev configurations.

No Additional Items
Each item of this array must be:

ZPoolVdev

Type: object
No Additional Properties

Name

Type: string

Vdev name (e.g., 'mirror-0', '/dev/sda1').

Vdev Type

Type: string

Vdev type (e.g., 'mirror', 'raidz1', 'disk').

Guid

Type: integer

Globally unique identifier for this vdev.

State

Type: string

Current state (ONLINE, DEGRADED, FAULTED, OFFLINE, UNAVAIL, etc.).

Type: object

Vdev I/O statistics.

Children

Type: array

Child vdevs.

No Additional Items
Each item of this array must be:
Type: object

Top Guid

Default: null

GUID of the top-level vdev this belongs to.

Type: integer
Type: null

Spares

Type: array of object

Array of spare disk configurations.

No Additional Items
Each item of this array must be:

ZPoolVdev

Type: object
No Additional Properties

Name

Type: string

Vdev name (e.g., 'mirror-0', '/dev/sda1').

Vdev Type

Type: string

Vdev type (e.g., 'mirror', 'raidz1', 'disk').

Guid

Type: integer

Globally unique identifier for this vdev.

State

Type: string

Current state (ONLINE, DEGRADED, FAULTED, OFFLINE, UNAVAIL, etc.).

Type: object

Vdev I/O statistics.

Children

Type: array

Child vdevs.

No Additional Items
Each item of this array must be:
Type: object

Top Guid

Default: null

GUID of the top-level vdev this belongs to.

Type: integer
Type: null

Stripe

Type: array of object

Array of stripe (single-disk) vdev configurations.

No Additional Items
Each item of this array must be:

ZPoolVdev

Type: object
No Additional Properties

Name

Type: string

Vdev name (e.g., 'mirror-0', '/dev/sda1').

Vdev Type

Type: string

Vdev type (e.g., 'mirror', 'raidz1', 'disk').

Guid

Type: integer

Globally unique identifier for this vdev.

State

Type: string

Current state (ONLINE, DEGRADED, FAULTED, OFFLINE, UNAVAIL, etc.).

Type: object

Vdev I/O statistics.

Children

Type: array

Child vdevs.

No Additional Items
Each item of this array must be:
Type: object

Top Guid

Default: null

GUID of the top-level vdev this belongs to.

Type: integer
Type: null

Special

Type: array of object

Array of special vdev configurations for metadata.

No Additional Items
Each item of this array must be:

ZPoolVdev

Type: object
No Additional Properties

Name

Type: string

Vdev name (e.g., 'mirror-0', '/dev/sda1').

Vdev Type

Type: string

Vdev type (e.g., 'mirror', 'raidz1', 'disk').

Guid

Type: integer

Globally unique identifier for this vdev.

State

Type: string

Current state (ONLINE, DEGRADED, FAULTED, OFFLINE, UNAVAIL, etc.).

Type: object

Vdev I/O statistics.

Children

Type: array

Child vdevs.

No Additional Items
Each item of this array must be:
Type: object

Top Guid

Default: null

GUID of the top-level vdev this belongs to.

Type: integer
Type: null

Dedup

Type: array of object

Array of deduplication table vdev configurations.

No Additional Items
Each item of this array must be:

ZPoolVdev

Type: object
No Additional Properties

Name

Type: string

Vdev name (e.g., 'mirror-0', '/dev/sda1').

Vdev Type

Type: string

Vdev type (e.g., 'mirror', 'raidz1', 'disk').

Guid

Type: integer

Globally unique identifier for this vdev.

State

Type: string

Current state (ONLINE, DEGRADED, FAULTED, OFFLINE, UNAVAIL, etc.).

Type: object

Vdev I/O statistics.

Children

Type: array

Child vdevs.

No Additional Items
Each item of this array must be:
Type: object

Top Guid

Default: null

GUID of the top-level vdev this belongs to.

Type: integer
Type: null
Type: null

Default: null

Most recent scrub or resilver information.

ZPoolScan

Type: object
No 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: integer

Scan start time (unix timestamp).

End Time


Scan end time as unix timestamp (null while the scan is still running).

Type: integer
Type: null

Percentage

Type: number

Scan progress (between 0 and 100%).

Bytes To Process

Type: integer

Total bytes located by scanner.

Bytes Processed

Type: integer

Total bytes to scan.

Bytes Issued

Type: integer

Issued bytes per scan pass.

Pause


Pause time as unix timestamp (null if the scan is not paused).

Type: integer
Type: null

Errors

Type: integer

Number of scan errors.

Total Secs Left


Number of seconds left (null if the scan is not running).

Type: integer
Type: null
Type: null

Default: null

RAIDZ expansion information.

ZPoolExpand

Type: object
No Additional Properties

State

Type: string

Expansion state (e.g., SCANNING, FINISHED).

Expanding Vdev

Type: integer

Index of the vdev being expanded.

Start Time

Type: integer

Expansion start time (unix timestamp).

End Time


Expansion end time as unix timestamp (null while expanding).

Type: integer
Type: null

Bytes To Reflow

Type: integer

Total bytes that need to be reflowed.

Bytes Reflowed

Type: integer

Total bytes reflowed so far.

Waiting For Resilver

Type: integer

Non-zero if expansion is waiting for a resilver to complete.

Total Secs Left


Estimated seconds remaining (null if not expanding).

Type: integer
Type: null

Percentage

Type: number

Expansion progress (between 0 and 100%).

Type: null

Features

Default: null

Pool feature flags.

Type: array of object
No Additional Items
Each item of this array must be:

ZPoolFeature

Type: object
No Additional Properties

Name

Type: string

Feature name.

Guid

Type: string

Feature GUID.

Description

Type: string

Feature description.

State

Type: string

Feature state.

Type: null


Required roles: POOL_READ