Conversation
This comment has been minimized.
This comment has been minimized.
b122013 to
eb11565
Compare
Member
Author
> zfs.version
zfs.version: "zfs-2.4.0-pve1"
> zfs.datasets{*}
zfs.datasets: [
0: {
properties: {
aclinherit: "restricted"
aclmode: "discard"
acltype: "off"
atime: "on"
available: "24637811257600"
canmount: "on"
casesensitivity: "sensitive"
checksum: "on"
compression: "on"
compressratio: "1.00"
context: "none"
copies: "1"
createtxg: "1"
creation: "1601010375"
dedup: "off"
defcontext: "none"
devices: "on"
direct: "standard"
dnodesize: "legacy"
encryption: "off"
exec: "on"
filesystem_count: "none"
filesystem_limit: "none"
fscontext: "none"
guid: "18418074912290193914"
keyformat: "none"
keylocation: "none"
logbias: "latency"
logicalreferenced: "13986708672000"
logicalused: "13987104441344"
longname: "off"
mlslabel: "none"
mounted: "yes"
mountpoint: "/storage"
nbmand: "off"
normalization: "none"
objsetid: "54"
omvzfsplugin:uuid: "ead3f27b-aa30-4b89-a4d7-1ecc0f46c312"
overlay: "on"
pbkdf2iters: "0"
prefetch: "all"
primarycache: "all"
quota: "0"
readonly: "off"
recordsize: "131072"
redundant_metadata: "all"
refcompressratio: "1.00"
referenced: "13968403506624"
refquota: "0"
refreservation: "0"
relatime: "on"
reservation: "0"
rootcontext: "none"
secondarycache: "all"
setuid: "on"
sharenfs: "off"
sharesmb: "off"
snapdev: "hidden"
snapdir: "hidden"
snapshot_count: "none"
snapshot_limit: "none"
special_small_blocks: "0"
sync: "standard"
type: "filesystem"
used: "13969649766144"
usedbychildren: "1246259520"
usedbydataset: "13968403506624"
usedbyrefreservation: "0"
usedbysnapshots: "0"
utf8only: "off"
version: "5"
volmode: "default"
vscan: "off"
written: "13968403506624"
xattr: "sa"
zoned: "off"
}
quotaBytes: 0
referencedBytes: 13968403506624
type: "filesystem"
reservationBytes: 0
usedBytes: 13969649766144
mounted: true
origin: ""
mountpoint: "/storage"
name: "storage"
snapshots: []
recordsizeBytes: 131072
encryption: "off"
availableBytes: 24637811257600
compression: "on"
creation: 2020-09-24 22:06:15 -0700 PDT
compressratio: 1
}
]
> zfs.pools{*}
zfs.pools: [
0: {
readonly: false
vdevs: [
0: zfs.pool.vdev name="raidz2-0" type="raidz" state="ONLINE" numDevices=4
]
autoexpand: true
autotrim: false
health: "ONLINE"
sizeBytes: 79989470920704
percentUsed: 36
properties: {
allocated: "28840567271424"
altroot: "-"
ashift: "12"
autoexpand: "on"
autoreplace: "off"
autotrim: "off"
bcloneratio: "1.00"
bclonesaved: "0"
bcloneused: "0"
bootfs: "-"
cachefile: "-"
capacity: "36"
checkpoint: "-"
comment: "-"
compatibility: "off"
dedup_table_quota: "auto"
dedup_table_size: "0"
dedupratio: "1.00"
delegation: "on"
expandsize: "-"
failmode: "wait"
feature@allocation_classes: "enabled"
feature@async_destroy: "enabled"
feature@blake3: "enabled"
feature@block_cloning: "enabled"
feature@bookmark_v2: "enabled"
feature@bookmark_written: "enabled"
feature@bookmarks: "enabled"
feature@device_rebuild: "enabled"
feature@device_removal: "enabled"
feature@draid: "enabled"
feature@edonr: "enabled"
feature@embedded_data: "active"
feature@empty_bpobj: "enabled"
feature@enabled_txg: "active"
feature@encryption: "enabled"
feature@extensible_dataset: "active"
feature@fast_dedup: "enabled"
feature@filesystem_limits: "enabled"
feature@head_errlog: "active"
feature@hole_birth: "active"
feature@large_blocks: "enabled"
feature@large_dnode: "enabled"
feature@large_microzap: "enabled"
feature@livelist: "enabled"
feature@log_spacemap: "active"
feature@longname: "enabled"
feature@lz4_compress: "active"
feature@multi_vdev_crash_dump: "enabled"
feature@obsolete_counts: "enabled"
feature@project_quota: "active"
feature@raidz_expansion: "enabled"
feature@redacted_datasets: "enabled"
feature@redaction_bookmarks: "enabled"
feature@redaction_list_spill: "enabled"
feature@resilver_defer: "enabled"
feature@sha512: "enabled"
feature@skein: "enabled"
feature@spacemap_histogram: "active"
feature@spacemap_v2: "active"
feature@userobj_accounting: "active"
feature@vdev_zaps_v2: "active"
feature@zilsaxattr: "active"
feature@zpool_checkpoint: "enabled"
feature@zstd_compress: "enabled"
fragmentation: "4"
free: "51148903649280"
freeing: "0"
guid: "5096186678844629762"
health: "ONLINE"
last_scrubbed_txg: "34958344"
leaked: "0"
listsnapshots: "off"
load_guid: "12824753509653635113"
multihost: "off"
readonly: "off"
size: "79989470920704"
version: "-"
}
fragmentation: 4
autoreplace: false
dedupratio: 1
allocatedBytes: 28840567271424
guid: "5096186678844629762"
name: "storage"
freeBytes: 51148903649280
}
]
> zfs.pools.first.vdevs.first{*}
zfs.pools.first.vdevs.first: {
writeErrors: 0
numDevices: 4
devices: [
0: zfs.pool.vdev name="ata-ST20000NM004E-3HR103_ZX210AAB" type="disk" state="ONLINE" numDevices=0
1: zfs.pool.vdev name="ata-ST20000NM002C-3X6103_ZXA04ZF7" type="disk" state="ONLINE" numDevices=0
2: zfs.pool.vdev name="ata-ST20000NM004E-3HR103_ZX22FLCW" type="disk" state="ONLINE" numDevices=0
3: zfs.pool.vdev name="ata-ST20000NM004E-3HR103_ZX22EJJC" type="disk" state="ONLINE" numDevices=0
]
readErrors: 0
path: ""
name: "raidz2-0"
slowIos: 0
checksumErrors: 0
type: "raidz"
state: "ONLINE"
}
zfs.pools.first.vdevs.first.devices.first: {
path: "/dev/disk/by-id/ata-ST20000NM004E-3HR103_ZX210AAB-part1"
checksumErrors: 0
writeErrors: 0
name: "ata-ST20000NM004E-3HR103_ZX210AAB"
devices: []
state: "ONLINE"
slowIos: 13
readErrors: 0
type: "disk"
numDevices: 0
} |
Contributor
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Add zfs, zfs.pool, and zfs.dataset resources for querying ZFS storage pools and datasets (filesystems, volumes, snapshots, bookmarks). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
Author
|
/review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
zfs,zfs.pool, andzfs.datasetresources to the OS providerzfs.poolandzfs.datasetsupportinit(name)for targeted lookup and lazyproperties()for the full property setzfs.dataset.snapshots()filters child snapshots from the cached dataset listBytessuffix for clarity (e.g.,sizeBytes,usedBytes,quotaBytes)Example queries
Test plan
mql run local -c "zfs.pools { name health sizeBytes }"zfs.pool(name: "...")init lookup workszfs.dataset(name: "...").snapshotsfilters correctly