Skip to content

Conversation

@karenheckel
Copy link

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

  • For support of specifying a default disk capacity.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

@dcantah
Copy link
Member

dcantah commented Dec 12, 2025

Hi @karenheckel, thanks for the contribution! Just truncating the file won't have the filesystem inside updated to believe it has {insert new size} available to it unfortunately so this won't work as is. The approach I'd been thinking of for this problem, although this would be a tiny bit complex, is to leave the actual block containing the image contents alone (through the library you can choose whatever size you want for this already) and instead provide a secondary block that we'd create on the fly of the requested size. We'd attach both the container image block (as we already do today) and this new block of the requested size to the VM, mount both of them, and then union the two with overlayfs in the guest, where the upperdir would be the empty block of the requested size. The rationale for this is that in the container you'd now see you have {requested size} available to write. This works both ways, if you want to give a smaller filesystem size this should work completely fine, as well as a much larger size than our images are (512GiB) today as well. Then when the container exits we can just remove the block we made for this little dance.

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.

2 participants