# Lab — TCO, the move, and the portability scorecard

**Time:** 120 minutes — 10 setup, 10 audit, 10 OpenRouter, 30 Linode move, 15 TCO, 15 scorecard and runbook (80 core), 20 evidence, 10 teardown. The Linode instance takes two to three minutes to boot, so start it early and audit while it warms up.

**Prerequisite:** the S1 DigitalOcean account and scoped token, the S4 Cloudflare account and R2 buckets, and the S5 catalogue Droplet. The fourth account — Linode/Akamai — is a pre-course task: create it, add a payment method, enable 2FA and make a per-service token with about 90 days of life. Install the CLIs if you have not already: `linode-cli`, `doctl`, `aws` and `jq`.

**You need to know:** usage × unit price is a cost line, and a total is the sum of the lines plus a buffer. A portability score is a weighted average of five 1–5 scores, where 5 means easy to leave. A tier is a storage contract about how often data is read, not just a price.

**Safe-data acknowledgement:** I have read the lab safe-data policy. I will use only the course-supplied synthetic media and will not upload real personal media to any cloud service. I will redact account IDs, emails and every token value from screenshots and logs.

## Task

Build a monthly total cost of ownership for the campus media unit on the DigitalOcean + Cloudflare + OpenRouter stack, audit the real bill, make one live priced inference call, move the catalogue service to Linode/Akamai, rebuild the TCO against the $80 spine, score the move on five portability dimensions, and write an exit runbook.

## What you will build

| Piece | Name | What it proves |
|---|---|---|
| OpenRouter account and key | student-owned, key `course-s6-<id>` | One real priced call and a metered cost |
| DigitalOcean audit | `results/do-*.json` | The bill you actually have, not a quoted price |
| Cloudflare audit | `results/cf-token.json`, dashboard screenshots | The free tiers your bill relies on |
| Linode instance | `course-<id>-s6` | A second independent compute provider |
| Block volume | `course-<id>-s6-vol` | A 30 GiB filesystem attached to the instance |
| Object Storage | `course-<id>-s6` bucket | The S3 API as the portable data layer |
| Firewall | `course-<id>-s6-fw` | Least privilege on a second control plane |
| Container | `course-s6-catalogue:lab` | The portable compute artifact |
| Notebook | `tco_results.json` | The five-line model, the tier drill and the scorecard |
| Runbook | `exit-runbook.md` | Exit cost in bytes, days and dollars |

Run every command from the repository root unless a step says otherwise. Keep a `results/` directory: it is the evidence bundle.

## Steps

### 1. Set up and check the guardrails

Create the evidence directory first. Everything you collect lands here, and the teardown proof is the last thing that does.

```bash
mkdir -p results
```

Now confirm that all four accounts answer. The Linode command prints your account and balance; if it says `Invalid Token`, the token was copied incompletely or has expired.

```bash
linode-cli account view --format company,balance,balance_uninvoiced --text --no-headers
```

List the regions and the Object Storage endpoints. You are looking for `sg-sin-2` and the `sg-sin-1.linodeobjects.com` endpoint. Do not use `ap-south`: it is the legacy Singapore region, marked limited availability, and it serves a different endpoint.

```bash
linode-cli regions list --format id,label --text --no-headers
```

```bash
linode-cli object-storage endpoints --format region,s3_endpoint --text --no-headers
```

Confirm the DigitalOcean side. `doctl account get` proves the scoped token works; it does not create anything. The audit in Step 3 is read-only.

```bash
doctl account get --format Status,DropletLimit
```

```bash
doctl balance get
```

**Panel path.** Linode: *Account → Settings* shows the balance and the credit expiry. DigitalOcean: *Billing* shows the balance and the month-to-date spend.

### 2. Create the OpenRouter account and make one priced call

**Panel path, no CLI equivalent.** Sign up at <https://openrouter.ai>, enable 2FA, and add **$1–2** of credit. Open *Keys → Create Key*, label it `course-s6-<id>`, and copy it once. The account stays for Session 8; the key is revoked at teardown. Record the top-up receipt as evidence — it is the only place the 5.5% credit-purchase fee appears.

Put the key in the environment for this shell only. Never commit it, and clear your shell history if you paste it on a command line.

```bash
export OPENROUTER_API_KEY="<openrouter-key>"
```

Read the balance. The response nests a `data` object with `total_credits` and `total_usage`; the difference is what you can spend.

```bash
curl -s https://openrouter.ai/api/v1/credits -H "Authorization: Bearer $OPENROUTER_API_KEY" | jq .
```

Read the current price of the cheap model before you call it. The rate is quoted per token, and `0.0000001` means $0.10 per million tokens.

```bash
curl -s https://openrouter.ai/api/v1/models | jq -r '.data[] | select(.id == "openai/gpt-4.1-nano") | [.id, .pricing.prompt, .pricing.completion] | @tsv'
```

Make one call. `max_tokens` is deliberately small: this is a priced experiment, not a captioning job. Capture the whole response, because the `id` is how you ask for the bill.

```bash
RESP=$(curl -s https://openrouter.ai/api/v1/chat/completions -H "Authorization: Bearer $OPENROUTER_API_KEY" -H "Content-Type: application/json" -d '{"model": "openai/gpt-4.1-nano", "messages": [{"role": "user", "content": "Caption a campus media unit thumbnail."}], "max_tokens": 64}')
```

```bash
echo "$RESP" | jq '{id, model, usage}' | tee results/openrouter-call.json
```

Ask the provider for its own record of that generation. The `usage` object in the completion is the provider's estimate; `/generation` is the metered record, and it can take a second or two to appear. If it returns 404, wait and retry — do not make a second call.

```bash
curl -s "https://openrouter.ai/api/v1/generation?id=$(echo "$RESP" | jq -r .id)" -H "Authorization: Bearer $OPENROUTER_API_KEY" | jq . | tee results/generation.json
```

**What to look for.** `tokens_prompt`, `tokens_completion` and `total_cost`. Divide `total_cost` by the token count and compare it with the list price; the small difference is the 5.5% credit fee with its $0.80 minimum spread across purchases.

### 3. Audit the real DigitalOcean and Cloudflare bill

This step creates nothing. You are reading what the previous labs already built, so the audit is the unit's actual bill rather than a pricing page.

List the Droplets, volumes and snapshots and save the JSON. These files are the inventory of what would have to move.

```bash
doctl compute droplet list -o json > results/do-droplets.json
```

```bash
doctl compute volume list -o json > results/do-volumes.json
```

```bash
doctl compute snapshot list -o json > results/do-snapshots.json
```

Record the month-to-date balance. Do not print the account email: this file goes into your evidence bundle.

```bash
doctl balance get --format MonthToDateBalance,AccountBalance | tee results/do-balance.txt
```

Verify the Cloudflare token by reading the accounts it can see. A token scoped to R2 and Workers may not have the token-verification endpoint, so the account list is the reliable proof. Then list the R2 buckets; that call needs `Account:R2:Read`, and a token that can deploy a Worker but not read R2 is a scoping lesson from Session 7.

```bash
curl -s https://api.cloudflare.com/client/v4/accounts -H "Authorization: Bearer $CLOUDFLARE_TOKEN" | jq '{success, count: (.result | length)}' | tee results/cf-token.json
```

```bash
curl -s "https://api.cloudflare.com/client/v4/accounts/$CF_ACCOUNT_ID/r2/buckets" -H "Authorization: Bearer $CLOUDFLARE_TOKEN" | jq '.result' | tee results/cf-buckets.json
```

**Panel path, no CLI substitute for the metrics.** Cloudflare dashboard → *R2 → Metrics* for storage and operations; *Workers & Pages → Metrics* for request counts; *Billing → Usage* for the month. Save three screenshots with the account ID covered. The R2 free tier is 10 GB and free egress; the Workers free tier is 100,000 requests a day. The audit exists to show that the model's $0 egress line is a real allowance, not an assumption.

If your API audit worked, copy the usage template and fill in your measured values with `"source": "live"`. If it did not, leave `usage.json` absent; the notebook records that the run used the synthetic sample.

```bash
cp course/weeks/06-economics-vendor-lock/data/usage_sample.json course/weeks/06-economics-vendor-lock/data/usage.json
```

### 4. Create the Linode instance, block volume and firewall

**Panel path.** *Linodes → Create Linode* offers the same choices: region Singapore 2, image Debian 12, plan Linode 2 GB. The CLI is faster and leaves a trace.

Set the identifiers once. The `<student-id>` is a short alias, not your account number or email.

```bash
export STUDENT_ID="<student-id>"
```

```bash
export LINODE_REGION="sg-sin-2"
```

```bash
export LINODE_IMAGE="linode/debian12"
```

```bash
export LINODE_PLAN="g6-standard-1"
```

Create the instance. `--root_pass` generates a throwaway password; SSH key access is the real door. The three tags are what make teardown auditable. The CLI takes one `--tags` flag per tag.

```bash
linode-cli linodes create --label "course-$STUDENT_ID-s6" --type "$LINODE_PLAN" --region "$LINODE_REGION" --image "$LINODE_IMAGE" --root_pass "$(openssl rand -base64 24)" --authorized_keys "$(cat ~/.ssh/do_s1.pub)" --tags course:42-05-0112 --tags "student:$STUDENT_ID" --tags week:6 --text --no-headers
```

Find the new instance by its label and save the id. Looking it up is more reliable than parsing the create output.

```bash
LINODE_ID=$(linode-cli linodes list --format id,label --text --no-headers | awk -v l="course-$STUDENT_ID-s6" '$2==l{print $1}')
```

```bash
echo "$LINODE_ID"
```

Poll the status until it is `running`, then read the IPv4 address. The `tr` strips the JSON brackets and quotes that `--format ipv4` prints.

```bash
linode-cli linodes view "$LINODE_ID" --format status --text --no-headers
```

```bash
LINODE_IP=$(linode-cli linodes view "$LINODE_ID" --format ipv4 --text --no-headers | tr -d '[]", ' | awk '{print $1}')
```

```bash
echo "$LINODE_IP"
```

Create the 30 GiB block volume in the same region and attach it to the instance. A detached volume still bills, so note the id now.

```bash
linode-cli volumes create --label "course-$STUDENT_ID-s6-vol" --size 30 --region "$LINODE_REGION" --linode_id "$LINODE_ID" --text --no-headers
```

```bash
VOLUME_ID=$(linode-cli volumes list --format id,label --text --no-headers | awk -v l="course-$STUDENT_ID-s6-vol" '$2==l{print $1}')
```

```bash
linode-cli volumes view "$VOLUME_ID" --format status --text --no-headers
```

Create the firewall with a default-deny inbound policy: SSH only from your current IP, HTTP and HTTPS from anywhere, all outbound allowed. Replace `<student-ip>` with the address `curl -s https://ifconfig.me` prints. Each rule needs an explicit `action`; the API rejects a rule without one. This is the same shape as the S1 DigitalOcean firewall, on a second control plane.

```bash
linode-cli firewalls create --label "course-$STUDENT_ID-s6-fw" --rules.inbound_policy DROP --rules.outbound_policy ACCEPT --rules.inbound "[{\"protocol\":\"TCP\",\"ports\":\"22\",\"addresses\":{\"ipv4\":[\"<student-ip>/32\"]},\"action\":\"ACCEPT\",\"label\":\"ssh\"},{\"protocol\":\"TCP\",\"ports\":\"80,443\",\"addresses\":{\"ipv4\":[\"0.0.0.0/0\"],\"ipv6\":[\"::/0\"]},\"action\":\"ACCEPT\",\"label\":\"web\"}]" --text --no-headers
```

```bash
FW_ID=$(linode-cli firewalls list --format id,label --text --no-headers | awk -v l="course-$STUDENT_ID-s6-fw" '$2==l{print $1}')
```

Attach the firewall to the instance. There is no `linodes firewall-update` command; the firewall owns the device relation, so the attachment is created from the firewall side.

```bash
linode-cli firewalls device-create "$FW_ID" --id "$LINODE_ID" --type linode
```

### 5. Move the catalogue and thumbnails to Linode Object Storage

Object Storage is an **account-level service**, not a bucket. The $5/month bills while the service is enabled, even if every bucket is empty, and cancelling it deletes every bucket and key. That is why teardown is ordered the way it is.

Set the cluster and endpoint. `sg-sin-1` is the E3 endpoint that `sg-sin-2` serves; confirm it in the endpoint list from Step 1.

```bash
export S3_CLUSTER="sg-sin-1"
```

```bash
export S3_ENDPOINT="https://$S3_CLUSTER.linodeobjects.com"
```

Create an S3 key. Linode's access key and secret are a separate credential from the API token: the token creates the key, and the key moves the bytes. Keep both out of the repository.

```bash
KEYS=$(linode-cli object-storage keys-create --label "course-$STUDENT_ID-s6-key" --regions "$LINODE_REGION" --json)
```

```bash
export AWS_ACCESS_KEY_ID=$(echo "$KEYS" | jq -r '.[0].access_key')
```

```bash
export AWS_SECRET_ACCESS_KEY=$(echo "$KEYS" | jq -r '.[0].secret_key')
```

```bash
export KEY_ID=$(echo "$KEYS" | jq -r '.[0].id')
```

Create the bucket through the S3 API. The endpoint needs an S3 region string; `us-east-1` is the conventional placeholder.

```bash
aws s3api create-bucket --bucket "course-$STUDENT_ID-s6" --endpoint-url "$S3_ENDPOINT" --region us-east-1
```

Copy the catalogue and the thumbnails. This is the portability claim in practice: the same `aws s3 cp` that would work against R2 works here, because both speak the S3 API.

```bash
aws s3 cp course/weeks/06-economics-vendor-lock/data/catalogue.json "s3://course-$STUDENT_ID-s6/catalogue.json" --endpoint-url "$S3_ENDPOINT"
```

```bash
aws s3 cp course/assets/synthetic-media/thumbs/ "s3://course-$STUDENT_ID-s6/thumbs/" --recursive --endpoint-url "$S3_ENDPOINT"
```

Time a 1 GB transfer. The file is random bytes and is synthetic; delete it at teardown. The timing is evidence for the exit-cost estimate, not a benchmark.

```bash
dd if=/dev/urandom of=/tmp/transfer-test.bin bs=1M count=1024
```

```bash
TIMEFORMAT='real %R s'; time aws s3 cp /tmp/transfer-test.bin "s3://course-$STUDENT_ID-s6/transfer-test.bin" --endpoint-url "$S3_ENDPOINT" 2> results/transfer-time.txt
```

List the thumbnails and checksum the catalogue at the destination. The checksum is the move-verification step: a copy is not a move until both ends agree.

```bash
aws s3 ls "s3://course-$STUDENT_ID-s6/thumbs/" --endpoint-url "$S3_ENDPOINT" | tee results/bucket-thumbs.txt
```

```bash
aws s3 cp "s3://course-$STUDENT_ID-s6/catalogue.json" - --endpoint-url "$S3_ENDPOINT" | sha256sum | tee results/catalogue-sha256.txt
```

### 6. Run the container on the instance and prove the routes

Copy the runner and the container sample to the instance. The sample is the portable artifact: a small Python image that serves the S4 routes from any S3-compatible bucket.

```bash
scp -i ~/.ssh/do_s1 course/weeks/06-economics-vendor-lock/remote.sh "root@$LINODE_IP:/root/remote.sh"
```

```bash
scp -i ~/.ssh/do_s1 -r course/samples/s6-catalogue "root@$LINODE_IP:/root/catalogue"
```

Open an interactive shell with the S3 variables exported, so the commands below behave exactly as the automation does. This is the one place a secret travels over the SSH command line; clear your shell history afterwards, and never paste this line into the report.

```bash
ssh -t -i ~/.ssh/do_s1 "root@$LINODE_IP" "export S3_ENDPOINT='$S3_ENDPOINT' S3_BUCKET='course-$STUDENT_ID-s6' AWS_ACCESS_KEY_ID='$AWS_ACCESS_KEY_ID' AWS_SECRET_ACCESS_KEY='$AWS_SECRET_ACCESS_KEY' VOL_LABEL='course-$STUDENT_ID-s6-vol'; bash -l"
```

The next commands run **inside the instance**. Format and mount the block volume. The device appears under a Linode-specific by-id path; using the symlink instead of `/dev/sdb` avoids depending on probe order.

```bash
DEV=$(readlink -f /dev/disk/by-id/scsi-0Linode_Volume_*)
```

```bash
mkfs.ext4 -F "$DEV"
```

```bash
mkdir -p /mnt/catalogue
```

```bash
mount "$DEV" /mnt/catalogue
```

```bash
findmnt /mnt/catalogue
```

```bash
df -h /mnt/catalogue
```

Install Docker from the distribution repository. This is a slow step on a 2 GB instance; the install is about a minute.

```bash
apt-get update -y
```

```bash
apt-get install -y docker.io jq curl
```

```bash
systemctl enable --now docker
```

```bash
docker --version
```

Build the sample. The build needs the network for the S3 client library; if the image registry or PyPI is blocked, use the fallback chain below.

```bash
docker build -t course-s6-catalogue:lab /root/catalogue
```

Run the container with the volume mounted at `/data` and the bucket settings in the environment. The container reads `catalogue.json` from the bucket at startup, so a bad key or endpoint fails immediately in the logs rather than on the first request.

```bash
docker run -d --name catalogue -p 8080:8080 -e S3_ENDPOINT="$S3_ENDPOINT" -e S3_BUCKET="$S3_BUCKET" -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" -v /mnt/catalogue:/data course-s6-catalogue:lab
```

```bash
docker ps --format '{{.Names}}\t{{.Status}}'
```

Prove the three routes. `/health` reports the record count and the catalogue digest; `/assets` returns the array; `/asset/asset-0001` returns one record. A 404 on `/asset/asset-0001` means the catalogue in the bucket is not the one the model expects.

```bash
curl -s http://127.0.0.1:8080/health | jq .
```

```bash
curl -s http://127.0.0.1:8080/assets | jq 'length'
```

```bash
curl -s http://127.0.0.1:8080/asset/asset-0001 | jq .
```

Read the index the container wrote to the block volume. This is the proof that both storage layers are attached: the object layer supplied the catalogue, and the block layer received the index.

```bash
cat /mnt/catalogue/index.json
```

Leave the instance shell.

```bash
exit
```

### 7. Rebuild the TCO and hit the archive trap

Open `notebook.ipynb` in Jupyter or VS Code and run it top to bottom. The notebook is the model: it derives the usage, prices the five lines, computes the Linode column, scores the five dimensions and writes `tco_results.json`.

The starter notebook sets `ARCHIVE_TIER = "block"`. Run it as shipped and read the failure: 1 TB of archive on block storage puts the total near $184 and breaks the $80 spine. Diagnose the storage line, change the tier to `"r2_ia"`, and re-run. Save both runs: the failure is evidence of the diagnosis.

If you prefer the command line, the reference run does the same thing without a notebook server. The first command fails on purpose; the second passes.

```bash
cd course/weeks/06-economics-vendor-lock
```

```bash
uv run python run_notebook.py notebook.ipynb
```

```bash
uv run python run_notebook.py notebook.ipynb --archive-tier r2_ia
```

Copy the artifact into the evidence directory, then return to the repository root.

```bash
cp tco_results.json ../../results/tco_results.json
```

```bash
cd ../../..
```

### 8. Fill the portability scorecard and write the exit runbook

Edit `data/scorecard.json`. Keep the five weights summing to 1.0, score each dimension from 1 to 5 from what you observed, and write one sentence of rationale per row. The defaults give exactly 60 against a threshold of 60; change a score only when your evidence supports it, not to make the number nicer.

Then write `results/exit-runbook.md` with four sections:

1. **Service map** — each service in the current stack and its replacement on Linode/Akamai. Name what has no equivalent, including the Worker and managed inference.
2. **Ordered steps** — copy and verify data, stand up the replacement beside the old service, switch traffic, then remove the old resources. Estimate the days.
3. **Exit cost** — the bytes from the timed transfer, the re-platforming days at the day rate, and the option value.
4. **Decision** — the weighted score, the threshold, and one change the unit should make this quarter.

Rerun the notebook after editing the scorecard, so `tco_results.json` carries your scores rather than the defaults.

```bash
cd course/weeks/06-economics-vendor-lock
```

```bash
uv run python run_notebook.py notebook.ipynb --archive-tier r2_ia
```

```bash
cp tco_results.json ../../results/tco_results.json
```

```bash
cd ../../..
```

### 9. Collect the evidence, verify, and tear down

Copy the instance's results down before deleting it. `results/` on the host holds both the host-side audit and the in-instance routes.

```bash
scp -i ~/.ssh/do_s1 -r "root@$LINODE_IP:/root/results/." results/
```

Run the verifier. It checks the route outputs, the volume mount, the notebook artifact and the score, and it exits non-zero on the first mismatch.

```bash
bash course/weeks/06-economics-vendor-lock/verify.sh results
```

Now tear down. Delete the instance first, then the volume, then the objects, then the bucket, then the key. Order matters because a volume cannot be deleted while attached and Object Storage keeps billing while the service is enabled.

```bash
linode-cli linodes delete "$LINODE_ID"
```

```bash
linode-cli volumes delete "$VOLUME_ID"
```

```bash
linode-cli firewalls delete "$FW_ID"
```

```bash
aws s3 rb "s3://course-$STUDENT_ID-s6" --force --endpoint-url "$S3_ENDPOINT"
```

```bash
linode-cli object-storage keys-delete "$KEY_ID"
```

Cancel the Object Storage service itself. `linode-cli` has an action for this, and the panel path is *Object Storage → Cancel Object Storage*. The command is account-wide: it deletes every remaining bucket and object and invalidates every access key. Deleting the bucket is not enough; the $5/month continues until the service is cancelled. This is the lab's most expensive mistake, and the reason the teardown is part of the evidence.

```bash
linode-cli object-storage cancel
```

List what remains. Empty lists are the proof; a detached volume or a forgotten image is a defect.

```bash
linode-cli images list --format id,label --text --no-headers | tee results/images-after.txt
```

```bash
linode-cli linodes list --format id,label --text --no-headers | tee results/linodes-after.txt
```

```bash
linode-cli volumes list --format id,label --text --no-headers | tee results/volumes-after.txt
```

```bash
linode-cli firewalls list --format id,label --text --no-headers | tee results/firewalls-after.txt
```

```bash
aws s3api list-buckets --endpoint-url "$S3_ENDPOINT" | jq '.Buckets | length' | tee results/buckets-after.txt
```

```bash
linode-cli object-storage keys-list --format id,label --text --no-headers | tee results/keys-after.txt
```

```bash
doctl balance get --format MonthToDateBalance,AccountBalance | tee results/do-balance-after.txt
```

**Panel path.** Revoke the S6 OpenRouter key in the dashboard (*Keys → Revoke*), keep the account and the remaining credit for Session 8, and save the final balance. Remove `/tmp/transfer-test.bin` from your laptop.

## Evidence bundle

Ten items, scored 3/2/1/0:

1. Linode instance, volume and bucket proof (`linode-cli` JSON and the labels/tags).
2. `/health`, `/assets` and `/asset/:id` output from the running container.
3. Moved-data proof: the catalogue checksum, the bucket listing and the row count.
4. The redacted OpenRouter key page, the top-up receipt and the `/generation` JSON.
5. The DigitalOcean and Cloudflare audit, with the balance and three dashboard screenshots (account ID covered).
6. The five-line TCO table or CSV and `tco_results.json`, with the spine delta decomposed by line.
7. The scorecard with weights, scores, rationale, weighted score and band.
8. `exit-runbook.md` with the service map, ordered steps and exit-cost decomposition.
9. The archive-trap log (the failing run and the passing run) and the teardown proof (empty lists plus the final balance).
10. A 150–250-word *what this proves* note.

## Failure and recovery

The archive trap is the designed failure. With `ARCHIVE_TIER = "block"`, the 1 TB archive is priced at $0.10/GB-month, the storage line jumps from about $48 to about $138, and the notebook's spine assertion fails at about $184. The diagnosis is not "make the assertion looser": it is that the tier is wrong for cold bytes. Move the archive to R2 Infrequent Access, re-run, and the total lands near $85. The lesson: **the bytes were never the expensive part; the tier was.**

The live OpenRouter call has its own natural stumbles. A `404` with `0 endpoints out of 1 requested are available matching your guardrail restrictions` means your account enforces zero data retention and the model's provider does not honour it: choose a model whose providers do, rather than turning the privacy setting off. A `404` on `/generation` means the record is not ready yet; wait and retry. A `429` means the free-tier rate limit; wait, or use fewer tokens. A `402` means the credit is gone; top up rather than retrying. Record what happened.

If `mkfs.ext4` says the device is busy, the volume is already formatted and mounted; run `findmnt /mnt/catalogue` before formatting again. If the container exits immediately, `docker logs catalogue` carries the S3 error: a wrong endpoint, a wrong key, or a bucket that does not exist.

## Cost ceiling

**$2 total.** The Linode instance, 30 GiB volume and Object Storage cost about **$0.06** for a two-hour lab; a 24-hour teardown delay stays under **$0.25**. The OpenRouter top-up is **$1–2**, and the unused credit carries to Session 8, so the lab's true cost is the call (well under a cent) plus the credit-purchase fee. No new DigitalOcean or Cloudflare resources are created; both audits are read-only. The evidence must show the balance.

A forgotten month is the real risk: $12 for the instance, $3 for the volume, $5 for Object Storage. Teardown is not optional.

## Teardown

The teardown commands are in Step 9. The complete list: delete the instance, delete the volume (not detach), empty and delete the bucket, cancel Object Storage, delete the S3 key, delete any custom image, revoke the OpenRouter key, leave the remaining credit for Session 8, remove `/tmp/transfer-test.bin`, and record the empty lists and the final balances. A detached volume still bills; an enabled Object Storage service still bills; a saved custom image bills.

## Fallback

The evidence shape does not change; a substitution is labelled item by item.

- **No Linode account or credit:** use the instructor's demo deployment and its published logs, then do the audit, TCO, scorecard and runbook with the published Linode prices. The scorecard still asks what the move would cost.
- **No OpenRouter card:** use a free-tier model; if even that is blocked, use the dated `results/generation.json` snapshot and say so in the note.
- **`doctl` or Cloudflare API blocked:** use the panel screenshots and `data/usage_sample.json`. The notebook records `usage_source: sample`.
- **No card at all:** take an instructor slot; the runner's collected evidence is the substitute, and full points remain possible because the analysis is the assessed artifact.

## Notebook

Open [the lab notebook](notebook.ipynb). It rebuilds the TCO from the fact sheet and the dated price table, computes the Linode column, runs the archive-tier drill, scores the five dimensions and writes `tco_results.json`. Run it before the Linode move so the model is ready when the evidence arrives, then re-run it after you edit the scorecard.
