foreman icon indicating copy to clipboard operation
foreman copied to clipboard

Fixes #37519 - Host form - Libvirt improvements

Open stejskalleos opened this issue 1 year ago • 9 comments

  • 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

stejskalleos avatar May 30 '24 06:05 stejskalleos

not sure how to recreate the bug, and the pr needs splitting but the .erb and .js code looks ok

MariaAga avatar Jun 19 '24 17:06 MariaAga

Updated and split into two (https://github.com/theforeman/foreman/pull/10232)

stejskalleos avatar Jul 01 '24 12:07 stejskalleos

  • 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 avatar Aug 05 '24 12:08 nofaralfasi

@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


stejskalleos avatar Aug 19 '24 08:08 stejskalleos

@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.

nofaralfasi avatar Aug 21 '24 10:08 nofaralfasi

I accidentally closed the PR :)

nofaralfasi avatar Aug 21 '24 10:08 nofaralfasi

Even when I use imaged-based provisioning (qcow2 image), it works fine for me.

stejskalleos avatar Aug 21 '24 13:08 stejskalleos

Random thought: could it be thin provisioning?

ekohl avatar Aug 22 '24 10:08 ekohl

@nofaralfasi any other comments? The JS methods have been fixed, should be working and ready for merge.

stejskalleos avatar Aug 27 '24 07:08 stejskalleos

While this isn’t perfect

Ouch :rofl:

The Redmine description updated (same as commit message)

stejskalleos avatar Aug 29 '24 07:08 stejskalleos

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.

nofaralfasi avatar Aug 29 '24 07:08 nofaralfasi