Skip to content

fix(volume): keep verity volumes out of the data disk search - #1459

Merged
kvinwang merged 1 commit into
nextfrom
fix/verity-volume-data-label
Oct 20, 2026
Merged

kvinwang merged 1 commit into
nextfrom
fix/verity-volume-data-label

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

A verity volume labelled its data partition dstack-data, the label dstack-prepare uses to find the app data disk. On a fresh CVM, whose data disk has no partition yet, the guest picked the volume's p2 and ran luksFormat on it; the boot failed with Failed to setup luks volume (it only did not destroy the volume because the VMM attaches volumes read-only). Seen on v0.6.0 with a 490 GiB model volume; next has the same code.

  • dstack verity labels the data partition dstack-volume-data. The guest opens volume partitions by number, so nothing else reads the label, and the verity root is unchanged.
  • dstack-prepare.sh skips disks carrying a dstack-volume partition, so volumes built by released versions are safe too, and refuses more than one dstack-data partition instead of taking the first.

Tested: cargo test -p dstack-volume; the new selection on a synthetic sysfs (data disk only; data disk + old volume; old volume only on a fresh VM -> falls back to /dev/vdb; two data partitions -> error; new-label volume); the same failure worked around on a TDX CVM by relabelling the volume's p2.

dstack-prepare finds the app data disk by its partition label,
dstack-data. A verity volume built by `dstack verity` used the same
label for its data partition, so on a fresh CVM, whose data disk has no
partition yet, the guest picked the volume and ran luksFormat on it.
That failed only because the VMM attaches volumes read-only, and the
CVM did not boot.

Label the volume's data partition dstack-volume-data; the guest opens
volume partitions by number, so nothing else reads the label. Old
volumes keep the old label, so dstack-prepare also skips any disk with a
dstack-volume partition, and refuses more than one dstack-data
partition instead of taking the first.

Signed-off-by: Kevin Wang <wy721@qq.com>
@kvinwang
kvinwang merged commit 247c3ad into next Oct 20, 2026
16 checks passed
@kvinwang
kvinwang deleted the fix/verity-volume-data-label branch October 20, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant