Skip to main content

Finish removing an evacuated data disk

POST 

/disks/array/remove/finish

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/remove/finish"

Queues a Topology job that takes an evacuated data disk out of the array. The confirmation is the same REMOVE <mountpoint> phrase planDiskEvacuation returned for the disk. Refused synchronously with disk_slot_not_found when no data disk occupies mountpoint, disk_not_evacuated when its removal state is not evacuated, unpooled or unlisted, and confirmation_required for a wrong or missing confirmation; not_configured when the daemon has no parity engine. Before changing anything the job checks all of that again, that the array without the disk still has a data disk and room for every content-file copy, that the disk is mounted by its own filesystem, and that nothing but empty directories and SnapRAID's own content files is left anywhere on it. It then marks the disk unpooled and takes it out of every pool mount, live (a failed live update fails the job); removes the empty directories the evacuation left, since SnapRAID records those too (rmdir only); runs a sync through the threshold guard with only this disk exempt from the zero-files rule, while its data line is still in snapraid.conf, and confirms SnapRAID tracks no file on it; marks it unlisted, regenerates snapraid.conf without it and checks SnapRAID accepts the result; then stops its mount unit, removes the unit file and deletes the disk from the array. The job's result names the disk as safe to physically remove; its filesystem is never wiped. A job that fails or is interrupted leaves the disk in the last state it reached, and running this operation again carries on from there — once unlisted, it never syncs again. A tripped guard leaves the disk unpooled, still listed and mounted, with nothing synced.

Request​

Responses​

The queued disk-removal job.