Skip to content

Add libvirt support#182

Draft
sbernhard wants to merge 1 commit intotheforeman:masterfrom
ATIX-AG:add_libvirt
Draft

Add libvirt support#182
sbernhard wants to merge 1 commit intotheforeman:masterfrom
ATIX-AG:add_libvirt

Conversation

@sbernhard
Copy link
Contributor

@sbernhard sbernhard commented Feb 20, 2026

@stejskalleos
Copy link
Collaborator

stejskalleos commented Mar 3, 2026

Failure: ForemanBootdisk::VmwareTest::#parse_args#test_0001_should add a cdrom drive while keeping other parameters when provision_method is bootdisk

test failures looks related

Copy link
Collaborator

@stejskalleos stejskalleos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, creating a new host is failing with:

Failed to upload ISO image for instance ian-warmath.dhcp-libvirt.lan: undefined method `upload_iso' for #<Fog::Libvirt::Compute::Real:345020 @uri=#<Fog::Libvirt::Util::URI:0x0000000044ef5e40 @parsed_uri=#<URI::Generic qemu:/system>, @uri="qemu:///system"> @client=#<Libvirt::Connect:0x0000000044ef56c0>> Did you mean? upload_volume

And I get another batch of errors in the log, but I'm not sure whether they are related to this PR. I need to investigate before making connections.

private

def libvirt_iso_pool_name
if respond_to?(:volumes) && volumes.present?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: Is the respond_to?(:volumes) necessary?
The libvirt.rb heavily relies on it, so I think it's safe to assume that Libvirt responds to volumes.

@stejskalleos
Copy link
Collaborator

So, I figured out the other (irrelevant to this PR) errors, and still I got:

2026-03-03T10:31:01 [D|app|34214ee5] Processing task 'Upload ISO image to datastore for ella-cardello.dhcp-libvirt.lan' from 'Host::Managed Main'
2026-03-03T10:31:01 [I|app|34214ee5] Uploading ISO image /tmp/d20260303-84654-ghif0e/ella-cardello.dhcp-libvirt.lan.iso for ella-cardello.dhcp-libvirt.lan
2026-03-03T10:31:01 [W|app|34214ee5] Failed to upload ISO image for instance ella-cardello.dhcp-libvirt.lan: undefined method `upload_iso' for #<Fog::Libvirt::Compute::Real:380900 @uri=#<Fog::Libvirt::Util::URI:0x00007f081eb71128 @parsed_uri=#<URI::Generic qemu:/system>, @uri="qemu:///system"> @client=#<Libvirt::Connect:0x00007f081eb70e08>>
 34214ee5 | Did you mean?  upload_volume
2026-03-03T10:31:01 [I|app|34214ee5] Backtrace for 'Failed to upload ISO image for instance ella-cardello.dhcp-libvirt.lan: undefined method `upload_iso' for #<Fog::Libvirt::Compute::Real:380900 @uri=#<Fog::Libvirt::Util::URI:0x00007f081eb71128 @parsed_uri=#<URI::Generic qemu:/system>, @uri="qemu:///system"> @client=#<Libvirt::Connect:0x00007f081eb70e08>>
 34214ee5 | Did you mean?  upload_volume' error (NoMethodError): undefined method `upload_iso' for #<Fog::Libvirt::Compute::Real:380900 @uri=#<Fog::Libvirt::Util::URI:0x00007f081eb71128 @parsed_uri=#<URI::Generic qemu:/system>, @uri="qemu:///system"> @client=#<Libvirt::Connect:0x00007f081eb70e08>>
 34214ee5 | Did you mean?  upload_volume
 34214ee5 | /home/lstejska/plugins/foreman_bootdisk/app/models/concerns/foreman_bootdisk/compute_resources/libvirt.rb:17:in `iso_upload'
 34214ee5 | /home/lstejska/plugins/foreman_bootdisk/app/models/concerns/foreman_bootdisk/orchestration/compute.rb:59:in `bootdisk_upload_iso'
 34214ee5 | /home/lstejska/plugins/foreman_bootdisk/app/models/concerns/foreman_bootdisk/orchestration/compute.rb:80:in `setIsoImage'

@sbernhard sbernhard marked this pull request as draft March 3, 2026 11:07
@sbernhard
Copy link
Contributor Author

Mark as draft because it needs fog/fog-libvirt#188

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants