From 6363dffee332bffc10f8a8fd9b8223fb99635e97 Mon Sep 17 00:00:00 2001 From: Sina Sadeghi Date: Sun, 24 Aug 2014 17:57:39 +1000 Subject: [PATCH] Windows Server image creation This patch prepends a guide for building Windows images for KVM OpenStack to the guide and retains the previous notes at the bottom of the doc. Change-Id: I029a428055dab59ec0a09b12933d38cd4d209bc1 --- doc/glossary/glossary-terms.xml | 12 ++ doc/image-guide/section_windows-example.xml | 142 ++++++++++++++------ 2 files changed, 112 insertions(+), 42 deletions(-) diff --git a/doc/glossary/glossary-terms.xml b/doc/glossary/glossary-terms.xml index 9fa56d8ac3..624521a2ee 100644 --- a/doc/glossary/glossary-terms.xml +++ b/doc/glossary/glossary-terms.xml @@ -1660,6 +1660,18 @@ + + Cloudbase-Init + + Cloudbase-Init + cloud-init + + + + A Windows port of cloud-init. + + + cloudpipe diff --git a/doc/image-guide/section_windows-example.xml b/doc/image-guide/section_windows-example.xml index 227fcd5c7d..bfcfb3210d 100644 --- a/doc/image-guide/section_windows-example.xml +++ b/doc/image-guide/section_windows-example.xml @@ -1,47 +1,105 @@ -
+%openstack; +]> +
-Example: Microsoft Windows image - We do not yet have a fully documented example of how to create a Microsoft Windows image. - You can use libvirt to install Windows from an installation DVD using the same approach as - with the CentOS and Ubuntu examples. Once the initial install is done, you will need to - perform some Windows-specific customizations. - - Install VirtIO drivers - Installing the VirtIO paravirtualizaion drivers for Windows will improve virtual machine - performance when using KVM as the hypervisor to run Windows. - - Sysprep - Microsoft has a special tool called Sysprep that must be run inside of a Windows guest to prepare it for use as - a virtual machine image. On Windows, invoke sysprep, as follows: - c:\windows\system32\sysprep\sysprep.exe - - - cloudbase-init - cloudbase-init is a Windows port of cloud-init that should be installed - inside of the guest. The source code is available on GitHub. - - - Jordan Rinke's OpenStack Windows resources - Jordan Rinke maintains a collection of resources for managing OpenStack Windows virtual machine - guests. - - - Windows instances require the timezone to be "localtime" - When uploading Windows images, you must set the os_type - parameter to windows, which causes instances to use the - local time zone. - Failing to set this will cause the clock timezone to be UTC, which has unexpected - side effects in Windows. - -
+ Example: Microsoft Windows image + This example creates a Windows Server 2012 qcow2 image, using + virt-install and the KVM hypervisor. + + + + Follow this steps to prepare the installation: + + + Download a Windows Server 2012 installation ISO. Evaluation + images are available on the + Microsoft website (registration required). + + + Download the signed VirtIO drivers ISO from the Fedora + website. + + + Create a 10 GB qcow2 image: + $ qemu-img create -f qcow2 ws2012.qcow2 10G + + + + + Start the Windows Server 2012 installation with the + virt-install command: + # virt-install --connect qemu:///system \ + --name ws2012 --ram 2048 --vcpus 2 \ + --network network=default,model=virtio \ + --disk path=ws2012.qcow2,device=disk,bus=virtio \ + --cdrom /path/to/en_windows_server_2012_x64_dvd.iso \ + --disk path=/path/to/virtio-win-0.1-XX.iso,device=cdrom \ + --vnc --os-type windows --os-variant win2k8 + Use virt-manager or + virt-viewer to connect to the VM and start the + Windows installation. + + + Enable the VirtIO drivers. + The disk is not detected by default by the Windows installer. When + requested to choose an installation target, click Load + driver and browse the file system to select the + E:\WIN8\AMD64 folder. The Windows installer + displays a list of drivers to install. Select the VirtIO SCSI and + network drivers, and continue the installation. + Once the installation is completed, the VM restarts. Define a + password for the administrator when prompted. + + + Log in as administrator and start a command window. + + + Complete the VirtIO drivers installation by running the + following command: + C:\pnputil -i -a E:\WIN8\AMD64\*.INF + + + To allow Cloudbase-Init to run scripts + during an instance boot, set the PowerShell execution policy to be + unrestricted: + C:\powershell +C:\Set-ExecutionPolicy Unrestricted + + + Download and install Cloudbase-Init: + C:\Invoke-WebRequest -UseBasicParsing http://www.cloudbase.it/downloads/CloudbaseInitSetup_Beta_x64.msi -OutFile cloudbaseinit.msi +C:\.\cloudbaseinit.msi + In the configuration options window, change the following settings: + + + Username: Administrator + + + Network adapter to configure: + Red Hat VirtIO Ethernet Adapter + + + Serial port for logging: COM1 + + + When the installation is done, in the Complete the + Cloudbase-Init Setup Wizard window, select the + Run Sysprep and Shutdown + check boxes and click Finish. + Wait for the machine shutdown. + + + + Your image is ready to upload to the Image Service: + $ glance image-create --name WS2012 --disk-format qcow2 \ + --container-format bare --is-public \ + --file ws2012.qcow2 +