You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
template registered as raw but actually qcow2 gets the wrong size #14877
A QCOW2 image registered with format RAW is accepted, and its file length is saved as the template's virtual size. On managed block storage (FlashArray, Primera and others) the volume is then created at that wrong size, and the first deploy fails with:
qemu-img: output file is smaller than input file
RawImageProcessor.process() never looks at the image. It takes the file length as the virtual size. Many cloud images are QCOW2 with a .img or .raw name, so this is an easy mistake to make, and the error only shows up at deploy time.
versions
ACS 4.22.1.1 secondary storage, KVM, FlashArray over FibreChannel. Same on 4.22 and main.
The steps to reproduce the bug
Run the raw template processor (what secondary storage runs after a download) on a real 3.5 GiB QCOW2 and a 64 MiB raw image, both named .raw:
> qemu-img info qcowtpl.raw
file format: qcow2
virtual size: 3.5 GiB (3758096384 bytes)
disk size: 196 KiB
rawtpl.raw: accepted as RAW, virtual size recorded 67108864
qcowtpl.raw: accepted as RAW, virtual size recorded 196664
The QCOW2 is recorded as a 196 KiB template. In the FlashArray lab, a template registered this way recorded virtualsize=621284352 while the image's real virtual size was 3758096384, and deploying it failed with the qemu-img error above.
What to do about it?
Check the image header when a template is registered as RAW, and fail the registration with a clear message when it is really QCOW2.
Activity