Skip to content

Commit e9f3eb7

Browse files
authored
docs(tdx): warn that changing app-compose breaks the sealed disk (#3745)
1 parent 70c40b0 commit e9f3eb7

1 file changed

Lines changed: 35 additions & 1 deletion

File tree

docs/running-an-mpc-node-in-tdx-external-guide.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ Use the following custom settings for MPC:
890890
1. Launcher docker compose file - provided above.
891891
2. VM HW setting (use exactly those settings, since vCPU/Memory are measured):
892892
vCPU number=8, Memory = 64GB, disk = 1000 GB
893-
3. Pre-launch Script and Init Script - both must be empty (a non-empty script fails attestation). Caution: the Pre-launch Script may not be empty by default - clear it before deploying.
893+
3. Pre-launch Script and Init Script - both must be empty. They are part of the app-compose and are **measured** (see the warning below), so a non-empty script both fails attestation *and* changes the disk-sealing key. Caution: the Pre-launch Script may not be empty by default - clear it before deploying.
894894
4. user-config - provided above
895895
5. Toggles:
896896
- KMS = disable
@@ -915,6 +915,8 @@ Use the following custom settings for MPC:
915915
916916
![VMM Web Page (2/2)](./attachments/VMM_web_page_deploy_2.png)
917917
918+
> **⚠️ Never change the app-compose (or the vCPU/memory) of a running node** — it will fail to start, since the disk is encrypted with a key derived from those measured inputs. If this happens, see [Troubleshooting: node won't start after an app-compose change](#node-wont-start-after-an-app-compose-change) to recover.
919+
918920
#### Using the script
919921
920922
The [`deploy-launcher.sh`](https://github.com/near/mpc/blob/main/deployment/cvm-deployment/deploy-launcher.sh) helper in `deployment/cvm-deployment/` handles both the template render and the dstack-vmm deploy. End-to-end flow:
@@ -1875,6 +1877,38 @@ python $VMM_CLI_PATH --url $VMM_URL start <vm-id>
18751877
Common failure scenarios and how to diagnose them. This section grows as new
18761878
cases are identified.
18771879
1880+
### Node won't start after an app-compose change
1881+
1882+
**Symptom:** after changing the app-compose (a pre-launch/init script, a toggle,
1883+
the launcher compose) — or editing config through the **web UI**, or changing
1884+
**memory/vCPU** — the CVM no longer boots and `dstack-prepare` fails with:
1885+
1886+
```text
1887+
No key available with this passphrase
1888+
Error: Failed to open encrypted data disk
1889+
```
1890+
1891+
**Why:** the disk-encryption key is derived from the node's boot measurements,
1892+
which include the app-compose and the memory/vCPU settings. Change any of them and
1893+
the node derives a different key that can't unseal the existing disk. (The web UI
1894+
can trigger this even when the visible settings look unchanged, since it
1895+
re-serializes the app-compose on save.)
1896+
1897+
**Fix — restore the exact original measurements.** The disk data is intact; do
1898+
**not** reformat it.
1899+
1900+
1. Regenerate a *byte-hash-identical* app-compose from the original inputs via
1901+
[`deploy-launcher.sh`](#using-the-script) (it never adds scripts and pins
1902+
vCPU/Memory). Revert any memory/vCPU change back to 8 vCPU / 64 GB.
1903+
2. Confirm `sha256sum .app-compose.json` matches the original `compose_hash` — the
1904+
32 bytes after the leading `01` in a pre-incident boot log's `mr_config_id`.
1905+
3. Push it to the existing CVM and restart:
1906+
1907+
```bash
1908+
python $VMM_CLI_PATH --url $VMM_URL update-app-compose <vm-id> .app-compose.json
1909+
python $VMM_CLI_PATH --url $VMM_URL stop <vm-id> && python $VMM_CLI_PATH --url $VMM_URL start <vm-id>
1910+
```
1911+
18781912
### Wiping the NEAR indexer data (force a re-sync)
18791913
18801914
**Symptom:** the embedded NEAR node won't sync — it stays at genesis, reports stale/corrupt

0 commit comments

Comments
 (0)