docker-volume-hetzner icon indicating copy to clipboard operation
docker-volume-hetzner copied to clipboard

Add support for automatic resizing if volume size was expanded directly on Hetzner

Open s4ke opened this issue 1 year ago • 3 comments

A stopgap solution until a proper workaround has been found for expanding the volumes could be to add an additional step to mounting where we could check the size of the volume when we created it vs what it is right now.

Then, if it differs, we could run resize2fs before mounting it to the actual container.

What do you think?

s4ke avatar Nov 25 '22 17:11 s4ke

This would probably work, but I wonder if this isn't piling too many responsibilities on the driver. I feel like this might be crossing a conceptual line because it would be a non-trivial change to existing data (as opposed to mkfs/chown on a brand new volume), so the danger of data loss becomes more "real".

But to be honest I haven't used this tool myself in years, so I my opinion might not be that relevant :see_no_evil:

costela avatar Nov 26 '22 12:11 costela

Yeah. This would be something to only do automatically in some cases in my opinion. This should be opt in on a volume to volume Basis because of the reason you stated: data loss.

For now I think its best if I gather some ideas here and come up with a concept. I have resized some Volumes manually myself so it is not that big of a deal, but having this working automatically would be awesome nonetheless.

s4ke avatar Nov 26 '22 12:11 s4ke

Thinking about it, another idea to consider would be to have some Kind of companion service to the plugin or even integrated that exposes an API endpoint that can do the resizing for a particular volume. Then users can decide on their own when and how to resize and even via some kind of automation if they want to.

But again, just an idea. Lets first get the chown PR tested and merged, then we can get fancier.

s4ke avatar Nov 26 '22 18:11 s4ke