Files
mesh-catalog/modules/zfs/module.json
T
jschoubben 0041b69d17
mesh/delivery merged: source.main moved to novox/mesh-catalog@32f1566cc879
mesh/delivery-group group feature/1979-zfs-owns-zfs merged: every member is merged
mesh/check being carried to 0041b69d1736 on 32f1566cc879 | from 117f933dacf0, mesh-delivery 7221a1e5cd7f, mesh-host 0193949efe9f, mesh-sdk e42b9491c93…
zfs: findings is a state of the module's state list, not of requires, so the conditions keeper reads it
The validator refused zfs and mesh-conditions: mesh-conditions reads zfs.findings, which zfs had moved to bus state in requires, where the new form has no readers (ADR 0596 section 2). The keeper process's bus.state keeps naming findings. The manifest test holds it.

Builds: design 42 zfs-owns-zfs A-46 (A-32, 26, 27)
2026-11-13 03:27:38 +01:00

732 lines
20 KiB
JSON

{
"module": "zfs",
"version": "1",
"capabilities": [
"bus-state-calls",
"ledger-calls",
"package-manager",
"service-manager",
"stream-publish"
],
"invokes": [
"seat:node-service-manager.start"
],
"own-secrets": {
"broker-keeper": {
"path": "${dir:keeper-state}/broker-keeper.secret",
"owner": "zfs-keeper"
}
},
"state": [
"findings"
],
"requires": [
{
"name": "events",
"storage": "stream",
"template": "events",
"options": {
"events": [
"config.applied",
"config.refused",
"config.waiting",
"snapshot.taken.person",
"snapshot.taken.schedule",
"snapshot.removed.person",
"snapshot.removed.schedule",
"snapshot.skipped.person",
"snapshot.skipped.schedule",
"run.skipped",
"scrub.requested"
],
"max-age-days": 30
}
},
{
"name": "applied",
"storage": "key-value",
"template": "state"
},
{
"name": "schedule",
"storage": "key-value",
"template": "state"
},
{
"name": "snapshots",
"storage": "ledger",
"template": "ledger",
"options": {
"max-mib": 64
},
"types": [
{
"name": "snapshot",
"schema": {
"dataset": {
"type": "string"
},
"name": {
"type": "string"
},
"kind": {
"type": "string"
},
"at": {
"type": "string"
},
"taken": {
"type": "object"
}
},
"operations": [
{
"name": "taken",
"effect": "set-entry",
"into": "taken",
"key": "name",
"fields": [
"dataset",
"name",
"kind",
"at"
]
},
{
"name": "removed",
"effect": "remove",
"into": "taken",
"key": "name"
}
]
}
]
}
],
"config": {
"pool": {
"type": "string",
"description": "The name of the ZFS pool the module owns: scrubs, trims, takes scheduled ZFS snapshots of and converges; the operator's, with no default.",
"trusted": true,
"required": true,
"renamed-from": "scrub-pool"
},
"scrub-cadence": {
"type": "string",
"description": "How often the pool named by pool is scrubbed: weekly, or monthly on the first scrub-day of each month. Weekly is what the distribution's timer did on the home server before the module, so taking it over moves nothing until the operator chooses.",
"enum": [
"weekly",
"monthly"
],
"trusted": true,
"default": "weekly"
},
"scrub-day": {
"type": "string",
"description": "The weekday the scrub starts, Mon to Sun; for a monthly scrub, the first such day of the month. Checked by the scheduled run, which refuses any other value and runs nothing; Monday is when the distribution's weekly timer fired.",
"enum": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun"
],
"trusted": true,
"default": "Mon"
},
"scrub-time": {
"type": "string",
"description": "The time the scrub starts, HH:MM from 00:00 to 23:59 in the machine's time zone; the scheduled run checks it every quarter of an hour, so the scrub starts within 15 minutes of it. Midnight is when the distribution's weekly timer fired.",
"pattern": "([01][0-9]|2[0-3]):[0-5][0-9]",
"trusted": true,
"default": "00:00"
},
"arc-max": {
"type": "number",
"description": "The most ZFS's read cache in memory (the ARC) may hold, in whole MiB: at least 64 and below the node's memory. Written live and into the options file. Not managed until set.",
"minimum": 64,
"trusted": false
},
"arc-min": {
"type": "number",
"description": "The least the ARC keeps, in whole MiB, not above arc-max. Written live and into the options file. Not managed until set.",
"minimum": 0,
"trusted": false
},
"module-options": {
"type": "list",
"description": "Kernel module parameters, each name=digits, from l2arc_write_max, l2arc_write_boost, l2arc_headroom, l2arc_noprefetch, l2arc_rebuild_enabled, zfs_txg_timeout, zfs_dirty_data_max, zfs_scan_vdev_limit, zfs_scrub_min_time_ms, zfs_resilver_min_time_ms and zfs_arc_sys_free (arc-max and arc-min hold the ARC's). Written into the options file; a live one is also written live, the others take effect at the next load of the kernel module. An empty list is not managed.",
"trusted": true
},
"hostid": {
"type": "string",
"description": "The node's ZFS id: eight hexadecimal digits, not all zero, written to /etc/hostid with ZFS's own writer only when the pool's label holds 0 or this value. Changing it needs a check of the pool's import at the next boot; the module never reboots. Not managed until set.",
"pattern": "^[0-9a-fA-F]{8}$",
"trusted": true
},
"zed": {
"type": "string",
"description": "Whether the ZFS event daemon runs from the module's own folder: on or off. Not managed until set.",
"enum": [
"on",
"off"
],
"trusted": false
},
"zed-handlers": {
"type": "list",
"description": "The event handlers placed in the module's folder: all-syslog (the journal handler) and resilver_finish-start-scrub (a scrub after a resilver). Empty is not managed.",
"trusted": true
},
"trim-schedule": {
"type": "string",
"description": "How often the pool is trimmed by the scheduled run: none, weekly, or monthly on the first trim-day of each month. Any set value holds the distribution's trim timers stopped. Needs trim-day and trim-time for weekly and monthly. Not managed until set.",
"enum": [
"none",
"weekly",
"monthly"
],
"trusted": false
},
"trim-day": {
"type": "string",
"description": "The weekday the trim starts, Mon to Sun; for monthly, the first such day of the month. Not managed until set.",
"enum": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun"
],
"trusted": false
},
"trim-time": {
"type": "string",
"description": "The time the trim starts, HH:MM in the machine's time zone, within 15 minutes. Not managed until set.",
"pattern": "([01][0-9]|2[0-3]):[0-5][0-9]",
"trusted": false
},
"cache-devices": {
"type": "list",
"description": "The pool's cache devices, by their names under /dev/disk/by-id: letters, digits, -, _, . and : only. A kernel-named member is re-added by its stable name; an empty list removes nothing and is not managed.",
"trusted": true
},
"log-devices": {
"type": "list",
"description": "The pool's log devices, by their names under /dev/disk/by-id. An empty list removes nothing and is not managed.",
"trusted": true
},
"log-mirror": {
"type": "boolean",
"description": "Whether log-devices are one mirror: true needs exactly two names, added as one mirror; otherwise each is a log device of its own. Not managed until set.",
"trusted": true
},
"pool-properties": {
"type": "object",
"description": "The pool's properties: autotrim, autoexpand, autoreplace (on, off or default) and failmode (wait, continue, panic or default). Not managed until set.",
"trusted": true
},
"dataset-properties": {
"type": "object",
"description": "Per dataset of the pool, its properties: compression, atime, relatime, recordsize, primarycache, secondarycache, sync, logbias, quota and reservation, each in its own form; never sharenfs or sharesmb. Not managed until set.",
"trusted": true
},
"snapshots": {
"type": "object",
"description": "The scheduled ZFS snapshots of every filesystem of the pool: {\"none\": true}, or keep counts hourly, daily, weekly and monthly, each a whole number from 0 to 168; a count of 0 takes none of that kind and removes none. Only snapshots the module took, named mesh-<kind>-<UTC stamp> and recorded in its ledger, are ever removed. Not managed until set.",
"trusted": true
}
},
"tools": [
"zfs_datasets",
"zfs_snapshots",
"zfs_snapshot",
"zfs_pools",
"zfs_space",
"zfs_pool_layout",
"zfs_scrub",
"zfs_scrub_start",
"zfs_scrub_pause",
"zfs_scrub_stop",
"zfs_snapshots_run_now",
"zfs_snapshots_prune_now",
"zfs_config_apply",
"zfs_snapshots_pause",
"zfs_snapshots_resume",
"zfs_snapshots_record",
"zfs_config",
"zfs_snapshots_schedule",
"zfs_module_events",
"zfs_snapshots_check",
"zfs_findings",
"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"
],
"zfs_scrub_start": [
"zpool scrub"
],
"zfs_scrub_pause": [
"zpool scrub -p"
],
"zfs_scrub_stop": [
"zpool scrub -s"
]
},
"resources": [
{
"id": "utils",
"type": "package",
"package": "zfs-utils"
},
{
"id": "dkms",
"type": "package",
"package": "zfs-dkms"
},
{
"id": "state-dir",
"type": "directory",
"path": "/var/lib/zfs-tools",
"mode": "0755",
"owner": "${machine:account}",
"unknown": "program"
},
{
"id": "cursor-dir",
"type": "directory",
"path": "/run/zfs-events",
"mode": "0700",
"unknown": "program"
},
{
"id": "run-dir",
"type": "directory",
"path": "/run/zfs-tools",
"mode": "0755",
"unknown": "program"
},
{
"id": "keeper-account",
"type": "user",
"name": "zfs-keeper",
"shell": "/usr/bin/nologin"
},
{
"id": "keeper-state",
"type": "directory",
"mode": "0711",
"owner": "zfs-keeper",
"place": "mesh",
"unknown": "program"
},
{
"id": "config-dir",
"type": "directory",
"path": "/etc/zfs-tools",
"mode": "0755",
"unknown": "program"
},
{
"id": "scrub-state-dir",
"type": "directory",
"path": "/var/lib/zfs-scrub",
"mode": "0700",
"unknown": "program"
},
{
"id": "config",
"type": "file",
"path": "/etc/zfs-tools/config.json",
"mode": "0644",
"template": "files/config.json",
"trusted": false
},
{
"id": "options",
"type": "file",
"path": "/etc/modprobe.d/zfs.conf",
"mode": "0644",
"template": "files/zfs.conf",
"if-config": [
"arc-max",
"arc-min",
"module-options"
]
},
{
"id": "zed-dir",
"type": "directory",
"path": "/etc/zfs/mesh-zed.d",
"mode": "0755",
"unknown": "module",
"if-config": [
"zed=on"
]
},
{
"id": "zed-rc",
"type": "file",
"path": "/etc/zfs/mesh-zed.d/zed.rc",
"mode": "0644",
"template": "files/zed.rc",
"if-config": [
"zed=on"
]
},
{
"id": "zed-functions",
"type": "file",
"path": "/etc/zfs/mesh-zed.d/zed-functions.sh",
"mode": "0644",
"template": "files/zed-functions.sh",
"if-config": [
"zed=on"
],
"names-on-purpose": {
"api.pushbullet.com": "the distribution's own zed-functions.sh, kept as the package ships it (A-2): its notifier functions name the notification services' sites in their comments and urls, and none is used unless the operator's zed.rc enables it",
"api.pushover.net": "the distribution's own zed-functions.sh, kept as the package ships it (A-2): its notifier functions name the notification services' sites in their comments and urls, and none is used unless the operator's zed.rc enables it",
"api.slack.com": "the distribution's own zed-functions.sh, kept as the package ships it (A-2): its notifier functions name the notification services' sites in their comments and urls, and none is used unless the operator's zed.rc enables it",
"docs.pushbullet.com": "the distribution's own zed-functions.sh, kept as the package ships it (A-2): its notifier functions name the notification services' sites in their comments and urls, and none is used unless the operator's zed.rc enables it",
"gotify.net": "the distribution's own zed-functions.sh, kept as the package ships it (A-2): its notifier functions name the notification services' sites in their comments and urls, and none is used unless the operator's zed.rc enables it",
"pushover.net": "the distribution's own zed-functions.sh, kept as the package ships it (A-2): its notifier functions name the notification services' sites in their comments and urls, and none is used unless the operator's zed.rc enables it",
"www.pushbullet.com": "the distribution's own zed-functions.sh, kept as the package ships it (A-2): its notifier functions name the notification services' sites in their comments and urls, and none is used unless the operator's zed.rc enables it"
}
},
{
"id": "zed-handler-all-syslog",
"type": "file",
"path": "/etc/zfs/mesh-zed.d/all-syslog.sh",
"mode": "0755",
"template": "files/all-syslog.sh",
"if-config": [
"zed-handlers=all-syslog"
]
},
{
"id": "zed-handler-scrub-after-resilver",
"type": "file",
"path": "/etc/zfs/mesh-zed.d/resilver_finish-start-scrub.sh",
"mode": "0755",
"template": "files/resilver_finish-start-scrub.sh",
"if-config": [
"zed-handlers=resilver_finish-start-scrub"
]
},
{
"id": "zed-drop-ins",
"type": "directory",
"path": "/etc/systemd/system/zfs-zed.service.d",
"mode": "0755",
"unknown": "program",
"if-config": [
"zed=on"
]
},
{
"id": "zed-drop-in",
"type": "file",
"path": "/etc/systemd/system/zfs-zed.service.d/mesh.conf",
"mode": "0644",
"template": "files/zed-mesh.conf",
"if-config": [
"zed=on"
]
},
{
"id": "import-cache",
"type": "service",
"unit": "zfs-import-cache.service",
"state": "running",
"boot": "enabled",
"health": {
"kind": "unit"
}
},
{
"id": "mount",
"type": "service",
"unit": "zfs-mount.service",
"state": "running",
"boot": "enabled",
"health": {
"kind": "unit"
}
},
{
"id": "target",
"type": "service",
"unit": "zfs.target",
"state": "running",
"boot": "enabled",
"health": {
"kind": "unit"
}
},
{
"id": "import-scan",
"type": "service",
"unit": "zfs-import-scan.service"
},
{
"id": "share",
"type": "service",
"unit": "zfs-share.service"
},
{
"id": "volume-wait",
"type": "service",
"unit": "zfs-volume-wait.service"
},
{
"id": "import-target",
"type": "service",
"unit": "zfs-import.target"
},
{
"id": "zed-on",
"type": "service",
"unit": "zfs-zed.service",
"state": "running",
"boot": "enabled",
"if-config": [
"zed=on"
],
"restart-on": [
"zed-rc",
"zed-functions",
"zed-handler-all-syslog",
"zed-handler-scrub-after-resilver",
"zed-drop-in"
],
"health": {
"kind": "unit"
}
},
{
"id": "zed-off",
"type": "service",
"unit": "zfs-zed.service",
"state": "stopped",
"boot": "disabled",
"if-config": [
"zed=off"
]
},
{
"id": "keeper",
"type": "process",
"name": "zfs-keeper",
"artifact": "tools",
"run": [
"./zfs-tools",
"keeper"
],
"user": "zfs-keeper",
"env": {
"MESH_BROKER_FILE": "${dir:keeper-state}/broker-keeper.secret",
"ZFS_KEEPER_SOCKET": "${dir:keeper-state}/keeper.sock"
},
"bus": {
"state": [
"applied",
"schedule",
"findings"
],
"emits": [
"config.applied",
"config.refused",
"config.waiting",
"snapshot.taken.person",
"snapshot.taken.schedule",
"snapshot.removed.person",
"snapshot.removed.schedule",
"snapshot.skipped.person",
"snapshot.skipped.schedule",
"run.skipped"
],
"invokes": [
"zfs.zfs_snapshots_record",
"zfs.zfs_snapshots_schedule",
"seat:node-service-manager.start"
]
},
"health": {
"kind": "unit"
}
},
{
"id": "apply",
"type": "process",
"name": "zfs-config-apply",
"artifact": "tools",
"run": [
"./zfs-tools",
"apply"
],
"run-once": true,
"restart-on": [
"config"
],
"env": {
"ZFS_KEEPER_SOCKET": "${dir:keeper-state}/keeper.sock"
}
},
{
"id": "watch",
"type": "process",
"name": "zfs-watch",
"artifact": "tools",
"run": [
"./zfs-tools",
"watch"
],
"user": "${machine:account}",
"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"
},
"env": {
"ZFS_KEEPER_SOCKET": "${dir:keeper-state}/keeper.sock"
}
},
{
"id": "run",
"type": "process",
"name": "zfs-mesh-run",
"artifact": "tools",
"run": [
"./zfs-tools",
"run"
],
"schedule": "0,15,30,45 * * * *",
"env": {
"ZFS_KEEPER_SOCKET": "${dir:keeper-state}/keeper.sock"
}
},
{
"id": "distribution-weekly",
"type": "service",
"unit": "zfs-scrub-weekly@${config:pool}.timer",
"state": "stopped",
"boot": "disabled"
},
{
"id": "distribution-monthly",
"type": "service",
"unit": "zfs-scrub-monthly@${config:pool}.timer",
"state": "stopped",
"boot": "disabled"
},
{
"id": "distribution-trim-weekly",
"type": "service",
"unit": "zfs-trim-weekly@${config:pool}.timer",
"state": "stopped",
"boot": "disabled",
"if-config": [
"trim-schedule=none",
"trim-schedule=weekly",
"trim-schedule=monthly"
]
},
{
"id": "distribution-trim-monthly",
"type": "service",
"unit": "zfs-trim-monthly@${config:pool}.timer",
"state": "stopped",
"boot": "disabled",
"if-config": [
"trim-schedule=none",
"trim-schedule=weekly",
"trim-schedule=monthly"
]
}
],
"build": {
"artifacts": [
{
"name": "tools",
"kind": "bundle",
"language": "go",
"system": "arch",
"from": "cmd/zfs-tools",
"binary": "zfs-tools",
"loads": [
"zfs-tools"
]
},
{
"name": "files",
"kind": "archive",
"from": "files"
}
]
}
}