Foreman, Windows and oVirt

Is it possible to pass parameters from Foreman to oVirt when provisioning Windows based images (templates) using oVirt?
i.e: Productkey, Script to run (userdata?)
There is no much information related to Windows hosts besides provisioning from PXE.


Foreman does support passing in “seed data”, if you associate “user data” template kind with your OS and check “user data” for the particular image associated with your oVirt Compute Resource, then Foreman passes it into oVirt.

However what happens in oVirt stays in oVirt logs. Funny way to say: you need to make sure oVirt does something with the data. So far I am failing getting cloud-init to work in oVirt…

I couldn’t debug it any further, but it seems like it doesn’t pass the correct attributes to the API via Fog (i don’t think fog-ovirt support it at the moment).
It should let oVirt know this is a “sysprep” runonce and not a cloudinit, what happens is that instead of attaching the “sysprep” floppy, it attach a cdrom with the default being what was used in the template (even though it’s not attached at all).
I can see the userdata in the “comment” section in oVirt.
See here:

So fog should be aware somehow that it provision a Windows system or atleast support sysprep so Foreman can initiate it.

Unfortunately, we do not use Ruby SDK directly but via Fog library which simplifies things quite bit. You need to send some patches into this library first and then into Foreman. But it’s doable, if you detect Windows OS, then Foreman could set the required flag.

Hi all,
sorry if I jump in the discussion.
Just want to share an idea.
I did some searches and according to the docs of the ovirt-engine-sdk-ruby should exists a way to be agnostic regarding the OS and setting the :use_initialization to true, it should be possible to use cloud-init for Linux and Sysprep for windows.
I didn’t try it yet directly with the ovirt-engine-sdk-ruby, but if it works, should be a matter of changing the vm_start_with_cloudinit.rb or creating a new vm_start_with_initialization.rb, and let Foreman call this method.
What do you think?


1 Like

Good catch, but instead of creating a regression I suggest to provide some new method like start_with_initialization. When there, probably adding all of the three supported flags as well (cloudinit, ignition, sysprep). :slight_smile:

I already created two PRs in fog-ovirt, one to bump the minimum required version of the ovirt-engine-sdk-ruby that introduce the use_initialization and one to introduce the start_with_initialization in the v4 of the api of fog_ovirt.


1 Like