Copy a running sandbox
Makes count sandboxes that go on from this instant, memory, processes and disk, each with its own id, hostname and network. Either all are made or none is left. The copies have the original's settings; shared volumes come with them, a volume that is not shared stands in the way. Wakes the sandbox.
On a node that copies its disks to an object store, a copy's disk goes there whole before anything written to it afterwards counts as copied. That takes what the original's disk holds over what the node's link carries for such copies: measured on a development machine against a store 33 ms away, 1 GiB in 2 s and 4 GiB in 8 s on a node where nothing else is written, 4 GiB in 23 s beside ten disks written at full speed (a quarter of the node's connections are for such copies while other disks have something to send). Such copies take turns by owner (X-Sandbox-Owner; on a node that belongs to no control plane every sandbox has the same owner), and inside an owner the one that was made first goes first: eight copies of 2 GiB each from one call are there one after the other, the first after 5 s and the last after 35 s, and another owner's copy of 256 MiB made a second later is there after 1.3 s and does not wait for them. Until its disk is there a copy is not in the store at all: a host that is lost takes the copy with it. And for that long the copy's writes to its disk wait, from 0.9 s after the first one; reads, and everything that does not write to the disk, go on.
Takes write.
https://api.glac.ai/v1/sandboxes/{id}/forkAutorizzazione
Parametri di percorso
Parametri di intestazione
Corpo della richiestaJSONfacoltativo
Returns
201
The copies, in the envelope of a list.
400
The request is not one this call takes. invalid_json: the body is not a JSON object; unknown_field: the body has a field this call does not take; unknown_parameter: the query has a parameter this call does not take; invalid_field: a field or query parameter has the wrong type or is out of range; invalid_idempotency_key: Idempotency-Key is empty or over 255 characters.
- exec_idoptionalstring
With
sandbox_movedofPOST …/run: the id of the command the call started and waited for, which goes on where the sandbox went: wait for it there through the control plane withGET …/exec/{exec_id}?wait_seconds=once the move is over. The same call made again starts the command a second time, unless it comes with the same Idempotency-Key.
401
missing_api_key, invalid_api_key, expired_api_key, invalid_token.
403
The credential may not do this. needs_api_key: a sandbox token cannot do this. spend_limit_reached: the sandbox is frozen because a spend limit was reached; it sleeps, with its data, until the limit is raised. account_share_reached: its account has not the room on this node's data drive for the copies (drive.accounts of GET /internal/node): the snapshot they are made from, or the memory of each and a gigabyte to write. Nothing was made.
- exec_idoptionalstring
With
sandbox_movedofPOST …/run: the id of the command the call started and waited for, which goes on where the sandbox went: wait for it there through the control plane withGET …/exec/{exec_id}?wait_seconds=once the move is over. The same call made again starts the command a second time, unless it comes with the same Idempotency-Key.
404
Something the request names does not exist. sandbox_not_found: no such sandbox.
- exec_idoptionalstring
With
sandbox_movedofPOST …/run: the id of the command the call started and waited for, which goes on where the sandbox went: wait for it there through the control plane withGET …/exec/{exec_id}?wait_seconds=once the move is over. The same call made again starts the command a second time, unless it comes with the same Idempotency-Key.
409
The state of something stands in the way. exclusive_volume_attached: the sandbox has a volume that is not shared; sandbox_failed: the sandbox is failed; idempotency_key_reused: the key was used with another body; idempotency_in_progress: the first request with the key is still running; busy: a volume is still behind one of the sandbox's spare drives after an attach that did not get through (its guest's reads of it are held up, a Drive whose blocks do not come), and is taken off it once they end; or the sandbox's guest has a read held up on a Drive it has (its blocks do not come: the message names the Drive and says for how long), until that read ends: the same call is made again in a moment. static_instance: the sandbox is the instance the node keeps of a static spec (GET /internal/static): a copy would be a second of what runs in it.
- exec_idoptionalstring
With
sandbox_movedofPOST …/run: the id of the command the call started and waited for, which goes on where the sandbox went: wait for it there through the control plane withGET …/exec/{exec_id}?wait_seconds=once the move is over. The same call made again starts the command a second time, unless it comes with the same Idempotency-Key.
default
Any other failure, in the same shape. internal (500): the node failed; the message says no more, and the node's log has the reason under the request's id. unavailable (503, retryable): no_capacity, every network slot of the node is in use; memory_full, a machine the call has to start (made, woken, booted from its disk, resumed, rolled back, built) does not fit in the host's memory beside what the machines that run on it are promised, and nothing paused or idle could be put to sleep to make room for it (memory of the node); drive_full, the call would have a template built and the node's data drive has no room for one (drive of the node); unavailable, the node is shutting down, the sandbox was still starting after 10 minutes, or it did not answer, or it is being moved to this node (with Retry-After: 1); fenced, the node's lease fences the sandbox (Node.lease). moved (409): the sandbox was moved to another node, which to names.
- exec_idoptionalstring
With
sandbox_movedofPOST …/run: the id of the command the call started and waited for, which goes on where the sandbox went: wait for it there through the control plane withGET …/exec/{exec_id}?wait_seconds=once the move is over. The same call made again starts the command a second time, unless it comes with the same Idempotency-Key.