Fixes #37519 - Host form - Libvirt improvements
- Provisioning a host with an image that does not exist has the correct error.
- Fixed error for the Libvirt capacity storage.
- Added error to the field when the image is not found
not sure how to recreate the bug, and the pr needs splitting but the .erb and .js code looks ok
Updated and split into two (https://github.com/theforeman/foreman/pull/10232)
- Fixed error for the Libvirt capacity storage.
@stejskalleos What is exactly fixed here? I'm not sure how to test that.
Update: I see now that capacity was undefined before. However, that still doesn't fix the issue. The values are not taken from the form but from somewhere else (capacity is always 128G), so I don't know what's the point of checking that.
@nofaralfasi I don't have that problem, when I set 33G size, then it works as expected:
qemu-img info /home/lstejska/VirtualMachines/ken-hentges.virtual.lan-disk1
=>
image: /home/lstejska/VirtualMachines/ken-hentges.virtual.lan-disk1
file format: qcow2
virtual size: 33 GiB (35433480192 bytes)
disk size: 196 KiB
cluster_size: 65536
Format specific information:
compat: 0.10
compression type: zlib
refcount bits: 16
Child node '/file':
filename: /home/lstejska/VirtualMachines/ken-hentges.virtual.lan-disk1
protocol type: file
file length: 193 KiB (197632 bytes)
disk size: 196 KiB
@nofaralfasi I don't have that problem, when I set 33G size, then it works as expected:
That's my point. The result is not affected by the JS code inside the imageSelected function. Neither the format_type nor the size (capacity) are impacted.
How did you test it? Did you use network-based or image-based provisioning? Keep in mind that this function is only triggered during image-based provisioning.
I accidentally closed the PR :)
Even when I use imaged-based provisioning (qcow2 image), it works fine for me.
Random thought: could it be thin provisioning?
@nofaralfasi any other comments? The JS methods have been fixed, should be working and ready for merge.
While this isn’t perfect
Ouch :rofl:
The Redmine description updated (same as commit message)
While this isn’t perfect
Ouch 🤣
I mean that you fixed the JS code, and it’s working now, but I don't think it's the best approach. However, since it’s not new code, I think it’s okay to merge it.