Provisioning Windows VMs using Sysprep to RHV/oVirt


We’re running into an issue where we’re not able to successfully provision a Windows VM using Sysprep to RHV/oVirt.

RHV/oVirt’s supported way of doing what VMware does in their Customization Specs is to use Windows Sysprep. We require the VMware Custom Spec functionality for setting the VMs network settings (static IP, DNS, etc). Otherwise when the VM comes up the network is unconfigured and the VM is unreachable.

We’ve tried the “normal” method of setting the network settings using: miq_provision.set_nic_settings()

We also know sysprep itself works correctly. Using the RHV/oVirt UI we can provision Windows VMs just fine by passing in our sysprep script into the Initial Run dialog.

We’ve reached out to Red Hat and they’ve provided us with the following three options:

Use an automate method that replaces the existing limited statemachine, to call the REST api on RHV and supply a sysprep from a source on the API. This is likely to be the route that proves simple and easy to replace later.

Try and use Cloud-INIT on Windows, whilst CloudForms shows the CloudINIT scripts for use, it won’t be able to embed them in the image nor tell RHV to use them as thats an unsupported route. The best you could hope for is use CF to store the script but then use a service OS to inject the sys prep from CF into the image itself.

Use neither CF or RHV, configure your Windows build to use sys prep, set the source to something you can make, like floppy , CD-ROM etc… once you have Windows searching for the unattended.xml from floppy or CD-ROM, you can have automate create the floppy or CD-ROM and hook it up to the vm during provisioning, again using the REST api.

All three of these options seem like quite a lot of work.

Does anyone have experience or suggestions on how to provision Windows VMs on RHV/oVirt using sysprep?

Nick & team


Hi Nick,

I’m working a similar use case (but using EC2 as my infrastructure) and have been trying to engage the RedHat team in the Gitter chat room. This may be helpful to you:

This may well be a bug. In the GUI (see below), you’re able to build a Sysprep configuration file. However, in the provisioning screen, only cloud-init files are offered.

Any update on your efforts?

FYI - this is currently an RFE -

Sounds like @nmaludy may have some workaround code soon

I know @jhardy is working on automate code to cover that.
@jhardy it can be great if you share that here as well.