fuse environment drain
Gracefully drain (phase one of teardown)
fuse environment drain <id>
No flags beyond the globals. Signals the guest agent to stop gracefully;
transitions the environment from running to draining. Only running
environments can be drained, any other state returns a conflict error.
Drain is phase one of a two-phase teardown, it does not destroy the
environment. The CLI prints a reminder of this after a successful drain. Follow
up with fuse environment destroy
to actually remove it. An environment left draining longer than the
orchestrator’s draining timeout (5m30s by default) is destroyed by the
reconcile loop:
fuse environment drain fuse-abc123
# draining environment "fuse-abc123"
# drain is phase-1 only; the orchestrator destroys a draining environment once
# its draining timeout passes (5m30s by default). run
# `fuse environment destroy fuse-abc123` to remove it now
fuse environment destroy fuse-abc123
When the drain command fails
The state transition to draining is persisted before the in-guest drain
command runs, so a failing drain command leaves the environment in draining
and returns an error. Draining is one-way, DELETE is the only supported
transition out of it, so there is no way back to running and re-draining the
same environment returns a conflict error. The only recovery is
fuse environment destroy, or waiting for
the draining timeout.
The failure reason is stamped onto the environment’s error field, visible via
fuse environment get.