Making available Windows mirrors for OpenStack, currently officially authorized only by http://www.cloudbase.it/windows-cloud-images/for Windows Server R2 Evaluation Cloud Image. We can see such words on the website.
Microsoft Windows Server R2 standard Evaluation are now available as a downloadable cloud image, customized by our Engineers and ready to be is directly deployed in OpenStack.
Theoretically, this image can be deployed directly to our openstack using glance. But in most cases, users need to customize their own Windows mirrors. This article provides a complete image production process.
Production environment Unbuntu 14.04 Server
The use of KVM commands to establish a virtual machine every time to enter a very long command, easy to enter errors, you can use Libvirt to manage virtual machines, Libvirt support Kvm,xen and other mainstream virtual machine management, installation:
Install QEMU-KVM libvirt-bin virtinst
Download the Virtio driver because the win by default does not support the Virtio driver, while managing the virtual machine via OpenStack requires Virtio driver. Need two Virtio drive, one is the hard disk, one is the network card, namely: Virtio-win-0.1-30.iso and VIRTIO-WIN-1.1.16.VFD
wget ' http://autosetup1.googlecode.com/files/virtio-win-1.1.16.vfd '
wget ' Http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/virtio-win-0.1-30.iso '
When I install, the first link is OK, but the second one is error 404. So I found a newer version in the other place https://fedorapeople.org/groups/virt/virtio-win/ DIRECT-DOWNLOADS/ARCHIVE-VIRTIO/VIRTIO-WIN-0.1.105-1/Note Select the corresponding two versions above
Download a win7 of the official pure version of the image Win7.iso put three files under the same subdirectory under Ubuntu,/home/house/under
Set up a hard drive map to store the image files we generated in the future
Qemu-img create-f qcow2 Windows7.qcow2 15G
Output: Formatting ' windows7.qcow2 ', Fmt=qcow2 size=21474836480 encryption=off cluster_size=65536 Lazy_refcounts=off
At this point you will be able to see the file in the previous directory, create the image below
virt-install --connect qemu:/// Span style= "color: #008000;" >system \ --name windows7--ram 2048 --vcpus 2 --network network=default,model=virtio --disk path=windows7.qcow2,format=qcow2,device=disk,bus=virtio -- Cdrom/home/house/win7.iso --disk path=/home/house/virtio-win-0.1 . 105 . Iso,device=cdrom --vnc 10.74 . 116.31 :
Output: Starting install ...
Creating domain ... | 0 B 00:00
Cannot open display:
Run ' Virt-viewer--help ' to see a full list of the available command line options
Domain installation still in progress. Waiting for installation to complete.
We did not install the graphical interface, so we could not install it manually, install the graphical interface, and use Virt-viewer directly, so we used another tool spice for remote installation. Http://www.spice-space.org/download.html
In the above command, we need to replace--VNC with--graphics spice,listen=0.0.0.0
virt-Install --connect qemu:///system \ 20482 -- Network network=default,model=virtio --disk path=windows7.qcow2,format=qcow2,device=disk,bus= Virtio --cdrom/home/zhangjun/win7.iso --disk path=/home/zhangjun/virtio-win-0.1 . iso,device=cdrom --os-type windows--os-variant win7 --graphics spice,listen= 0.0. 0.0
Open Spice Enter the IP address of your installation machine in connection address: spice://192.168.1.2:5900 (port number default 5900, if other installers are in, then Auto + 1)
Click on the Connec to enter the installation interface, click on the driver select interface Load driver, browse and drive virtio-win-0.1.1
You can see the radhat virtIO SCSI disk drive. Select to install the NIC driver in a similar directory after entering the system.
Note: Some problems may occur during installation, and some VIRT commands are recommended to view the status of the virtual machine
Virsh-c QEMU:///system list//View virtual machine // off // Delete // Cancel Domin
This is the time to do it, we successfully made a qcow2 image. Then deploy it to glance.
Glance image-create--name "Windows7"--file home/house/windows7.qcow2--disk-format qcow2--container-format Bare-- Is-public True--progress
You can see this virtual machine on the dashboard after the success. After a successful creation, note that you need to add the rule TCP port 3389 to the security group where it resides, turn off the firewall, turn on Remote Desktop Connection, and then ping and connect remotely.
OpenStack makes Windows7 images