Always register VM snapshots in the commit ledger. Use when committing/snapshotting VMs, before destroying VMs, during deploys, or when creating golden images. Ensures no snapshot goes untracked.
Every vers_vm_commit MUST be followed by a commit ledger registration. No exceptions.
After vers_vm_commit returns a commit ID:
curl -s -X POST "https://<INFRA_VM_ADDRESS>:3000/commits" \
-H "Authorization: Bearer $VERS_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"commitId": "<commit-id-from-vers>",
"vmId": "<vm-id>",
"label": "<human-readable description>",
"agent": "<your-agent-name>",
"tags": ["<relevant>", "<tags>"]
}'
| Tag | When |
|---|---|
golden | Golden image commits |
pre-deploy | Before deploying to a VM |
post-deploy | After successful deploy |
agent-session | LT/worker VM before destruction |
infrastructure | Infra VM snapshots |
backup | Periodic backups |
forensics | Snapshot of a dead/zombie agent for investigation |
Include enough context that someone reading the ledger later can understand what this snapshot contains:
❌ vers_vm_commit without registering = ghost snapshot. Nobody can find it later. You WILL forget the commit ID and it's lost forever.
✅ Commit → register → then proceed with whatever you were doing.