Foreman Libvirt - resource creation parameters information

Request for information more than a problem.

I’m trying to debug a possible problem between Foreman / Libvirt / Libvirt 10 specific components (and most likely a puppet module being the problem).

When provisioning a resource on a libvirt managed hypervisor foreman sends information to the remove libvirt daemon that tells the remove libvirt daemon what to write locally to the $node.xml

What it appears is happening is the that there is no actual code for this (the libvirt compute provider seems very basic) and foreman is just taking the default parameters from libvirt and provisioning the machine based on that.

If I’m correct in that assumption, what I can’t work out is, the parameters used to provision the machine are

a.) the local ones to the foreman node that are passed into the remote libvirt daemon

b.) the local ones to the remote libvirt daemon and foreman just pushed ‘please deploy a vm with X ram and Y CPU’

It looks like option B but I can’t be sure.

if someone could correct my understanding (or confirm it) that would be really helpful.

Hi @ikonia,

In short - Foreman follows option B:
It uses the Ruby fog-libvirt provider to construct only a minimal subset of the Libvirt domain XML. Foreman sends the basic parameters (RAM, vCPUs, disk definitions, network interfaces, boot order, and a few additional flags).

The remote Libvirt daemon is responsible for completing the rest of the configuration. It automatically applies its own defaults when generating the final domain XML on the hypervisor.

Foreman does not manage or store a full domain XML template, the Libvirt compute resource is intentionally lightweight and relies heavily on Libvirt’s built-in defaults.

1 Like

that’s perfect, just what I needed, thanks a lot.

1 Like

Foreman needs a version bump of fog-libvirt to 0.14 to work with EL10 hypervisors

I see it’s already in the develop branch foreman/bundler.d/libvirt.rb at 0b71365123ce1dda4f17d4a6c6f1e316f033e425 · theforeman/foreman · GitHub, so it should be available in the next Foreman release.