From VMWare or HyperV, launch your template Windows VM and log in as an administrative user. Make any firewall changes you need, install any packages, and ensure that RDP is enabled.
If the guest has VMWare tools installed, remove them. They won't be needed where we're going.
This isn't so much for KVM as it is for OpenStack, but cloudbase-init is the Windows version of cloud-init. This will set your hostname and such when the VM is created.
Shut down the VM and grab the VMDK or VHDX file it booted from. Copy that file
to a directory on your computer, such as C:\Temp
.
get-vhd C:\Temp\Win10.vhdx
mkdir C:\mount
Dism /mount-image /ImageFile:C:\Temp\Win10.vhdx /Index:1 /MountDir:C:\mount
viostor
driver:
Dism /image:C:\mount /Add-Driver /Driver:E:\viostor\w10\amd64 /Recurse
Baloon
driver:
Dism /image:C:\mount /Add-Driver /Driver:E:\Balloon\w10\amd64 /Recurse
NetKVM
driver:
Dism /image:C:\mount /Add-Driver /Driver:E:\NetKVM\w10\amd64 /Recurse
Dism /image:C:\mount /Get-Drivers
Dism /Unmount-image /MountDir:c:\mount /commit
Now the image is ready to be converted to raw/qcow2 and uploaded to OpenStack.
Note: CloudBase has released a Windows version of qemu-img
so you can do
the conversions on Windows now without VirtualBox tools. You can download it
here