Skip to main content

Preview evacuating a data disk before removal

POST 

/disks/array/evacuate/plan

Required role: admin. Only an account or token with the admin role can call this operation.

Example request
curl --request POST \
--header "Authorization: Bearer $HOSERVA_TOKEN" \
--header "Content-Type: application/json" \
--data @body.json \
"https://$HOSERVA_HOST:8008/api/v1/disks/array/evacuate/plan"

Computes the evacuation plan for the data disk at mountpoint (mechanically a rebalance targeting one specific source disk): every file an evacuation would move from that disk onto the pool's remaining disks, any path-preserving warnings, and the exact typed confirmation evacuateDisk requires. Refused (invalid_plan) when a share on this disk has no other branch to evacuate onto, when an entry on the disk is something the evacuation copy path cannot move (a symlink, fifo, socket or device node), when the remaining disks do not have room even after each one's own minimum free space is kept, or when the disk holds any top-level entry that is neither a configured share's own branch there nor SnapRAID's own bookkeeping (lost+found, snapraid.content*) — there is no procedure for moving such content, so evacuation refuses to start rather than leave it behind unreported; that refusal's own 400 body, EvacuationPlanRefusal, names every offending path in nonSharePaths. Read-only: nothing is copied, synced or deleted, and this preview does not itself put the disk into its removing/no-create state — evacuateDisk's own job does that, before its first copy, so the disk keeps taking new writes only until that job starts, never for as long as it runs. Refused (disk_leaving_array, 409) when the disk is already unpooled or unlisted — only finishDiskRemoval takes it further — and (disk_removal_in_progress) while a different disk is already in removal. An evacuating or evacuated disk is planned again, as the source of a resumed or repeated evacuation. No other disk in removal is ever a target. Evacuation moves the disk's own already-present files off it, protected through the threshold guard. The no-create switch is applied by evacuateDisk's job, not by this preview, and the mergerfs branch-list removal, SnapRAID removal and unmount are not performed by either.

Request​

Responses​

The evacuation plan.