Copy & Sync
Section titled “Copy & Sync”A copy is a complete, independent duplicate of a computer, and it can land in a different project or on a different server. A copy can start from a snapshot you choose.
Syncing a copy with its source is not available yet: to get the source’s later changes, copy the source again.
A scoped auth token needs computers.read and computers.create, plus computers.features.ai or computers.features.hoody_kit if the source has them. See request fields.
This copies production onto an EU server:
# Copy production to EU for redundancyhoody computers copy "$PROD_US_ID" --target-project "$PROJECT_ID" --target-server-id "$EU_SERVER_ID" --name prod-eu-replica// Copy production to EU for redundancyconst euReplica = await client.api.computers.copy(PROD_US_ID, { target_project_id: PROJECT_ID, target_server_id: EU_SERVER_ID, name: 'prod-eu-replica'});# Copy production to EU for redundancycurl -X POST "https://api.hoody.com/api/v1/computers/$PROD_US_ID/copy" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "target_project_id": "'"$PROJECT_ID"'", "target_server_id": "'"$EU_SERVER_ID"'", "name": "prod-eu-replica" }'Copies production to the EU server to stand up the replica. To bring the replica up to date later, copy production again and delete the old replica.
# Copy production to EUhttps://PROJECT_ID-COMPUTER_ID-curl-1.SERVER.computers.hoody.com/api/v1/curl/request?url=https://api.hoody.com/api/v1/computers/PROD_US_ID/copy&method=POST&bearer_token=HOODY_TOKEN&json={"target_project_id":"PROJECT_ID","target_server_id":"EU_SERVER_ID","name":"prod-eu-replica"}&response=transparentOne request, one link
cURL runs inside your computer and can wrap any HTTP request into a single GET URL. The call stops being something you need a client for and becomes something you can paste into a browser, send in a chat, bookmark, schedule with cron, or drop into a no-code tool.
Nothing is installed on the machine that opens it. The link does carry whatever credentials the call needs, so treat it as you would treat those credentials. It also appears in the cURL service's request log, not only the target's. Prefer a delegated token with minimal permissions and an expiry: see API tokens.
Slashes, colons and braces pass through as they are. The one character you must
encode is an & inside a value, which happens when the wrapped URL
carries its own query string. Left raw it ends the value early, and the rest is
read as cURL's own parameters, so you get a 200 on a request you did
not make.
How the wrapping works Chaining calls into one link Turning a link into a shortcut
In the Hub, open Computers, open the computer’s ⋯ menu and choose Make a copy…. Pick the Name, Server and Project for the copy, then press Make copy. To give the copy an SSH key or carry over firewall and network rules, use the API or CLI.
The replica holds production’s state at the time of the copy. A proxy alias URL includes its server’s name, so the replica cannot take over production’s alias. Create and test a separate alias for the replica before a failure. If the US datacenter fails, point your users or your own routing at the replica’s URL.
What a copy includes
Section titled “What a copy includes”| Copied | Root filesystem (files and directories), configuration, including environment variables, installed software (packages, dependencies) and data (databases, user files) |
| New on the copy | Its own computer ID and lifecycle, new service URLs that use the destination project ID and the new computer ID, and source_computer_id naming the source, which becomes null once the source is deleted |
| Not copied | The SSH key (give it one); the source’s snapshot history, so take fresh snapshots on the copy once it is running; proxy aliases, which are separate configuration (create new ones for the copy); firewall and network rules, unless you ask; contents of /ramdisk, if enabled: the copy has its own empty RAM disk, so save any needed contents to persistent storage before copying |
The copy runs independently: changes to the copy do not affect the source, and changes to the source do not reach the copy. It keeps running if the source is deleted. Manage it like any other computer (Managing).
A copy is not charged separately. It counts toward the destination server’s computer limit and uses its shared resources. See Pricing.
Choose where the copy lands
Section titled “Choose where the copy lands”| You send | The copy lands |
|---|---|
target_project_id (required) | In that project, on the source’s server |
target_project_id and target_server_id | In that project, on that server; both can differ from the source in one copy |
name (optional) | Under that name; it is auto-generated if omitted |
Another project suits client demos, separate staging and production projects, personal projects and isolated experiments. Copies must be within your own projects: you cannot copy a computer to a different user’s account. Storage shares share a folder between your own computers, copies included.
Another server gives geographic redundancy, lower latency for nearby users, and disaster recovery in a different datacenter. The copy is slower, because the data crosses the network between servers.
Copy from a snapshot
Section titled “Copy from a snapshot”Pass a snapshot’s name as source_snapshot to copy from a known-good state instead of the source’s current state:
Pin one when the source may have changed since you last tested it: you copy files in a state you know is stable (always copy from the v1.0.0 snapshot). The copy still takes the source computer’s current environment variables, so keep those separately when you need a reproducible environment. Take the value from the snapshot’s name field, not its alias (how a snapshot is named). An auth token needs computers.features.snapshots to use source_snapshot.
Without source_snapshot, the copy takes the source’s current state.
In the Hub, open Computers, select the computer and open the Backups tab. On the snapshot’s row, choose New computer from this, pick the server and project, then press Make the computer.
Give the copy an SSH key
Section titled “Give the copy an SSH key”A copy never carries its source’s SSH key, and cannot be made to. Pass a public key as ssh_public_key on the copy request. Omit it and nothing is generated: the copy has no SSH access until you add a key.
# Omit ssh_public_key → the copy has no SSH key at allPOST /api/v1/computers/{source_id}/copy{ "target_project_id": "{project}", "name": "copy"}
# Give the copy its own key, never the source'sPOST /api/v1/computers/{source_id}/copy{ "target_project_id": "{project}", "name": "copy", "ssh_public_key": "ssh-rsa DIFFERENT_KEY..."}Follow a copy until it runs
Section titled “Follow a copy until it runs”A copy runs asynchronously. It reports copying while it duplicates the source’s current state, or the source_snapshot you name, onto the target server and sets any SSH key you supplied. Then it starts automatically and reports running. With copy_network_rules: true, a network or startup failure can leave the copy stopped. If starting it asks you to configure its network first, reapply its network settings through Network and start it again. Keep the old computer until the copy reports running.
# Check copy statuscurl "https://api.hoody.com/api/v1/computers/$NEW_COPY_ID" \ -H "Authorization: Bearer $HOODY_TOKEN"
# Watch for: "status": "copying" → "status": "running"hoody computers copy ... --until-done waits for the copy and exits 1 if it fails, or 124 once --timeout (default 10m) passes. A failed copy shows status: "failed" and cannot be started: delete it and copy again (troubleshooting).
Typical durations by size are in copy timing.
Get the source’s later changes
Section titled “Get the source’s later changes”Syncing a copy with its source is not available yet. POST /api/v1/computers/{id}/sync answers 409 with COMPUTER_SYNC_UNAVAILABLE for a copy you may update. The copy is left exactly as it was: no files change and its status does not move (sync errors).
Copy the source again when it has updates you need: a production deployment, template improvements, security patches. The new copy holds the source’s current state, or the source_snapshot you name. It gets a new computer ID and service URLs and can go to another project or server. An alias cannot be moved to it: to keep an alias name, delete the proxy alias and create it again for the new copy. The alias URL changes if the destination uses a different server_name; check the new alias’s returned url.
set -eo pipefail
# Copy the source again and wait for it (exits 1 if the copy fails)NEW_COPY_ID=$(hoody computers copy "$SOURCE_ID" --target-project "$PROJECT_ID" --name staging-api-2 \ --until-done -o json | jq -er '.response.id')
# The copy can finish with the new computer stopped: check that it is running.# If it is stopped or failed, keep the old copy and fix the problem first.[ "$(hoody computers get "$NEW_COPY_ID" -o json | jq -r '.status')" = "running" ]
# The new copy is running: delete the old onehoody computers delete "$OLD_COPY_ID" --yes// Copy the source againconst fresh = await client.api.computers.copy(SOURCE_ID, { target_project_id: PROJECT_ID, name: 'staging-api-2'});
// Wait until the new copy is running; stop if it failed or was left stoppedlet status = fresh.data.status;while (status !== 'running') { if (status === 'failed') throw new Error('Copy failed; the old copy is kept'); if (status === 'stopped') throw new Error('Copy did not start; check its status and network configuration. The old copy is kept'); await new Promise((resolve) => setTimeout(resolve, 5000)); status = (await client.api.computers.get(fresh.data.id!)).data.status;}
// Delete the old copy once the new one is runningawait client.api.computers.delete(OLD_COPY_ID);set -eo pipefail
# Copy the source againNEW_COPY_ID=$(curl -sf -X POST "https://api.hoody.com/api/v1/computers/$SOURCE_ID/copy" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"target_project_id": "'"$PROJECT_ID"'", "name": "staging-api-2"}' | jq -r '.data.id')
# Wait until the new copy is running; stop if it failed or was left stoppedwhile true; do STATUS=$(curl -sf "https://api.hoody.com/api/v1/computers/$NEW_COPY_ID" \ -H "Authorization: Bearer $HOODY_TOKEN" | jq -r '.data.status') [ "$STATUS" = running ] && break [ "$STATUS" = failed ] && { echo "Copy failed; the old copy is kept" >&2; exit 1; } [ "$STATUS" = stopped ] && { echo "Copy did not start; check its status and network configuration. The old copy is kept" >&2; exit 1; } sleep 5done
# Delete the old copy once the new one is runningcurl -sf -X DELETE "https://api.hoody.com/api/v1/computers/$OLD_COPY_ID" \ -H "Authorization: Bearer $HOODY_TOKEN"Creates a fresh copy, then deletes the old one. Open the check link (NEW_COPY_ID is the new copy’s data.id); run the delete only once it reports running, and keep the old copy if it reports failed or stopped.
# Copy the source againhttps://PROJECT_ID-COMPUTER_ID-curl-1.SERVER.computers.hoody.com/api/v1/curl/request?url=https://api.hoody.com/api/v1/computers/SOURCE_ID/copy&method=POST&bearer_token=HOODY_TOKEN&json={"target_project_id":"PROJECT_ID","name":"staging-api-2"}&response=transparent
# Check the new copyhttps://PROJECT_ID-COMPUTER_ID-curl-1.SERVER.computers.hoody.com/api/v1/curl/request?url=https://api.hoody.com/api/v1/computers/NEW_COPY_ID&method=GET&bearer_token=HOODY_TOKEN&response=transparent
# Delete the old copyhttps://PROJECT_ID-COMPUTER_ID-curl-1.SERVER.computers.hoody.com/api/v1/curl/request?url=https://api.hoody.com/api/v1/computers/OLD_COPY_ID&method=DELETE&bearer_token=HOODY_TOKEN&response=transparentOne request, one link
cURL runs inside your computer and can wrap any HTTP request into a single GET URL. The call stops being something you need a client for and becomes something you can paste into a browser, send in a chat, bookmark, schedule with cron, or drop into a no-code tool.
Nothing is installed on the machine that opens it. The link does carry whatever credentials the call needs, so treat it as you would treat those credentials. It also appears in the cURL service's request log, not only the target's. Prefer a delegated token with minimal permissions and an expiry: see API tokens.
Slashes, colons and braces pass through as they are. The one character you must
encode is an & inside a value, which happens when the wrapped URL
carries its own query string. Left raw it ends the value early, and the rest is
read as cURL's own parameters, so you get a 200 on a request you did
not make.
How the wrapping works Chaining calls into one link Turning a link into a shortcut
Find the copies of a computer
Section titled “Find the copies of a computer”A computer whose source_computer_id is not null is a copy of the computer it names:
{ "data": { "id": "01bcdef123456789abcdef01", "source_computer_id": "890abcdef12345678901cdef", ... }}To find all copies of a source, filter the computer list by source_computer_id. The SDK’s listAll() follows pagination but throws after 1,000 pages if more results remain; past that, request each page yourself with list(). hoody computers list follows pages up to 10,000 items or 1,000 requests and warns when more results remain. Over HTTP, request each page (example):
Advanced
Section titled “Advanced”- Copy many computers: copy and sync requests share an account-wide limit, by default 10 per 5 minutes and 20 per hour; over it,
429starts nothing. Fan out in bounded batches (batch script). - KVM on the copy: never inherited.
kvm: trueis refused (403) on free-tier and subserver targets; on a dedicated server the copy comes backkvm: falsewith akvm_note: enable KVM once it is stopped (Virtual Machines). - Outcome events: when the copy answer carries an
operation_id, thecomputer.operation.completedorcomputer.operation.failedevent reports the outcome with the same value (Copy & Sync API page). - Recipes: ready flows for refreshing staging, team templates, production-to-staging-to-development chains, multi-region copies, snapshot-copy-deploy and A/B tests (recipes).
Reference
Section titled “Reference”Tables, recipes and troubleshooting: the Copy & Sync reference.
What’s next
Section titled “What’s next”- Snapshots: the source for a pinned copy
- Images: template computers from images
- Create, Edit, Delete: computer fundamentals
- Proxy Aliases: create an alias for a copy