Create a 10G-size image file with kvm-img:
kvm-img create-f qcow2 win2008.img 10G
because Windows does not have a default Virtio driver, it is downloaded first
wget Http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/virtio-win-0.1-15.iso
wget http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/virtio-win-1.1.16.vfd
start KVM, map drive VfD to floppy disk a
kvm-m 1024-cdrom en_windows_server_2008_r2_dvd.iso-drive FILE=WIN2008.IMG,IF=VIRTIO,BOOT=ON-FDA Virtio-win-1.1.16.vfd-boot d-nographic-vnc:1
using VNC to access the installation, in the installation of the need to select the hard drive, after installation, to stop the virtual machine, re-start with the following command
kvm-m 1024-drive file=win2008.img,if=virtio,boot=on-cdrom virtio-win-0.1-15.iso-net nic,model=virtio-net user-b Oot c-nographic-vnc:1
again with VNC access, should be prompted to automatically install the Virtio network card driver
Add this image with glance, specifying a format of Qcow2
Glance add-a your_glance_token name= "win2008" Is_public=true Disk_format=qcow2 < win2008.img
It 's done.
OpenStack Windows Image Maker