Skip to content

Conversation

@shanduur
Copy link
Member

@shanduur shanduur commented Oct 30, 2025

volumeType in UserVolumeConfig can be set to disk.
When set to disk, a full block device is used for the volume.

When volumeType = "disk":

  • Size specific settings are not allowed in the provisioning block (minSize, maxSize, grow).

@shanduur shanduur force-pushed the lvm-volumes branch 17 times, most recently from b928782 to 7dc9ae9 Compare November 6, 2025 11:11
@shanduur shanduur marked this pull request as ready for review November 6, 2025 11:12
@talos-bot talos-bot moved this from To Do to In Review in Planning Nov 6, 2025
}

v.TypedSpec().Type = block.VolumeTypeDisk
v.TypedSpec().Locator.Match = labelVolumeMatch(volumeID)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is unused/should be dropped? as it's a disk, we can't match on label

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need some kind of matcher, but I think we can reuse disk locator here? This should be sufficient.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, a good way is to reboot Talos and see what it does?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't seen any issues, however it goes through the provisioning flow each time - reusing disk locator should cut that, right?

Copy link
Member Author

@shanduur shanduur Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-project-automation github-project-automation bot moved this from In Review to Approved in Planning Nov 6, 2025
}

v.TypedSpec().Type = block.VolumeTypeDisk
v.TypedSpec().Locator.Match = diskSelector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does work, but by chance a bit (with a specific form of disk selector).

we have a problem here, the disk selector is evaluated in:

https://github.com/shanduur/talos/blob/0d8c0228615d4353f9f5ded9d8b682200ee7e342/pkg/machinery/cel/celenv/celenv.go#L34-L61

while volume locator in:

https://github.com/shanduur/talos/blob/0d8c0228615d4353f9f5ded9d8b682200ee7e342/pkg/machinery/cel/celenv/celenv.go#L62-L86

So anything which does simple disk.<something> works as they both have same.

But e.g. system_disk is not available in volume locator, also volume locator runs for partitions as well, so it might match it by accident.

So I think we need a separate locator.DiskMatch or something close to that for disk volumes.

Open to any other ideas as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if the changes I did make any sense. I've added different *cel.Env that is selected based on volume type: https://github.com/siderolabs/talos/pull/12104/files#diff-29f79fc583c81df9b1167eb597fb3642587aa952b153ee5c3c5190005577bd6bR54-R61

@shanduur shanduur force-pushed the lvm-volumes branch 4 times, most recently from 9c43c0f to 23a86c2 Compare November 7, 2025 19:51
Copy link
Member

@Orzelius Orzelius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool
Love the thorough tests!

When set to `disk`, a full block device is used for the volume.

When `volumeType = "disk"`:
- Size specific settings are not allowed in the provisioning block (`minSize`, `maxSize`, `grow`).

Signed-off-by: Mateusz Urbanek <mateusz.urbanek@siderolabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Approved

Development

Successfully merging this pull request may close these issues.

4 participants