Add the zfs module, so the mesh can see the home server's pools and snapshot a dataset
mesh/merge-gate pass: builds new: modules/zfs, sent nowhere; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check fail: its merge-check.sh failed: --- FAIL: TestASnapshotIsAnsweredFromTheListAfterwardsAndRecorded (0.00s)
mesh/delivery superseded: a newer head of the same pull request
mesh/merge-gate pass: builds new: modules/zfs, sent nowhere; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check fail: its merge-check.sh failed: --- FAIL: TestASnapshotIsAnsweredFromTheListAfterwardsAndRecorded (0.00s)
mesh/delivery superseded: a newer head of the same pull request
The home server's pool holds the operator's media library, and no mesh tool could say whether it is healthy, how full it is, when it was last scrubbed or what snapshots exist; the only way was a login. This module reads all of it with fixed zfs and zpool commands (list, get, status, iostat, events, history) and has one act, zfs_snapshot, which only adds a snapshot: refused for an unknown dataset, a name outside [A-Za-z0-9._-], an existing snapshot or no why; run as sudo -n zfs snapshot -- ds@name; answered from zfs list afterwards, with any other snapshot that came or went meanwhile; recorded as the event snapshot.taken. No destroy, rollback, set or send exists, and a test holds every command to its verb. Health (ADR 0240): zfs_health on the watch process, unhealthy for a pool not ONLINE, device or data errors, a pool past 90 % full or no ZFS at all; past 80 % and a scrub older than 35 days are warnings. Beside it, the event follower (zpool events -f, as root) keeps ZFS's errors in its journal past a reboot and is judged by its unit, the check the module does not run itself. No seat (ADR 0121), no package: ZFS is the machine's.
This commit is contained in:
@@ -0,0 +1,115 @@
|
||||
{
|
||||
"module": "zfs",
|
||||
"version": "1",
|
||||
"capabilities": [
|
||||
"service-manager"
|
||||
],
|
||||
"emits": [
|
||||
"snapshot.taken"
|
||||
],
|
||||
"tools": [
|
||||
"zfs_datasets",
|
||||
"zfs_snapshots",
|
||||
"zfs_snapshot",
|
||||
"zfs_pools",
|
||||
"zfs_space",
|
||||
"zfs_pool_layout",
|
||||
"zfs_scrub",
|
||||
"zfs_io",
|
||||
"zfs_arc",
|
||||
"zfs_events",
|
||||
"zfs_properties",
|
||||
"zfs_health"
|
||||
],
|
||||
"replaces": {
|
||||
"zfs_datasets": [
|
||||
"zfs list"
|
||||
],
|
||||
"zfs_snapshots": [
|
||||
"zfs list -t snapshot"
|
||||
],
|
||||
"zfs_snapshot": [
|
||||
"zfs snapshot"
|
||||
],
|
||||
"zfs_pools": [
|
||||
"zpool list",
|
||||
"zpool status -x"
|
||||
],
|
||||
"zfs_space": [
|
||||
"zfs list -o space",
|
||||
"zpool list -v"
|
||||
],
|
||||
"zfs_pool_layout": [
|
||||
"zpool status",
|
||||
"zpool status -v"
|
||||
],
|
||||
"zfs_scrub": [
|
||||
"zpool history -i"
|
||||
],
|
||||
"zfs_io": [
|
||||
"zpool iostat",
|
||||
"zpool iostat -v"
|
||||
],
|
||||
"zfs_arc": [
|
||||
"arcstat",
|
||||
"arc_summary",
|
||||
"cat /proc/spl/kstat/zfs/arcstats"
|
||||
],
|
||||
"zfs_events": [
|
||||
"zpool events",
|
||||
"zpool events -v"
|
||||
],
|
||||
"zfs_properties": [
|
||||
"zfs get all",
|
||||
"zfs get"
|
||||
]
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"id": "watch",
|
||||
"type": "process",
|
||||
"name": "zfs-watch",
|
||||
"artifact": "tools",
|
||||
"run": [
|
||||
"./zfs-tools",
|
||||
"watch"
|
||||
],
|
||||
"health": {
|
||||
"kind": "tool",
|
||||
"tool": "zfs_health",
|
||||
"interval": "60s",
|
||||
"timeout": "20s",
|
||||
"looks": 2,
|
||||
"grace": "60s"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "events",
|
||||
"type": "process",
|
||||
"name": "zfs-events",
|
||||
"artifact": "tools",
|
||||
"run": [
|
||||
"./zfs-tools",
|
||||
"events"
|
||||
],
|
||||
"health": {
|
||||
"kind": "unit"
|
||||
}
|
||||
}
|
||||
],
|
||||
"build": {
|
||||
"artifacts": [
|
||||
{
|
||||
"name": "tools",
|
||||
"kind": "bundle",
|
||||
"language": "go",
|
||||
"system": "arch",
|
||||
"from": "cmd/zfs-tools",
|
||||
"binary": "zfs-tools",
|
||||
"loads": [
|
||||
"zfs-tools"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user