hcloud-upload-image icon indicating copy to clipboard operation
hcloud-upload-image copied to clipboard

Upload doesn't fail if qcow2 image exceeds 960MB limit

Open rmsc opened this issue 7 months ago • 7 comments

I'm experimenting with a custom bootc image that is getting a bit too big, and noticed this warning while uploading:

image must be smaller than 960 MB (rescue system root disk) for qcow2 run-id="<redacted>" maximum-size=960 actual-size=1018

The upload nevertheless continues, which I believe it shouldn't.

rmsc avatar May 10 '25 18:05 rmsc

The 960 MB are a guesstimate from my side, there is no guarantee that the ramdisk has this size, it may be bigger or smaller in the future. Considering this, I did not want to make the validation fatal, and give the user the option to abort or continue.

apricote avatar May 10 '25 19:05 apricote

I see, thanks. In my case the upload finishes successfully and the node boots fine.

Just to be sure, does this mean that the image was fully uploaded and not corrupted/truncated in any way?

rmsc avatar May 12 '25 09:05 rmsc

I would expect an error to happen if the file could not be copied fully to the disk first.

Maybe I failed to do the conversion between bytes, megabytes, mebibytes and what not correctly.

apricote avatar May 12 '25 14:05 apricote

I also had problems with size. Fedora CoreOS is ~10GB uncompressed.

For now I manually used the rescue system with following command:

wget -O - https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/42.20250803.3.0/x86_64/fedora-coreos-42.20250803.3.0-hetzner.x86_64.raw.xz | xz -d -c | dd of=/dev/sda bs=10M status=progress

This writes the image directly to disk without using the disk. Maybe it could be integrated in hcloud-upload-image?

twaldecker avatar Sep 01 '25 09:09 twaldecker

.raw.xz are already streamed to the disk, pretty much in the same way that you suggested. See this test case here on the exact command: https://github.com/apricote/hcloud-upload-image/blob/b9af8855d5c0c1e40ddfaa670296731b2ed0c53e/hcloudimages/client_test.go#L44-L49

What error did you see?

apricote avatar Sep 01 '25 12:09 apricote

There was no error. In the Hetzner Console was the state that the snapshot is being created, but the progress never reported more than 0%.

twaldecker avatar Sep 04 '25 08:09 twaldecker

That is not related to hcloud-upload-image then, but a problem in the backend.

apricote avatar Sep 04 '25 09:09 apricote