Murano requires a Windows Image in QCOW2 format to be built and uploaded into Glance.
The easiest way to build Windows image for Murano is to build it on the host where your OpenStack is installed.
Note
This guide was tested on Ubuntu Server 12.04 x64.
KVM is a default hypervisor in OpenStack, so our build scripts are targeted to this hypervisor only. It may change in future, though.
Install KVM and some additional packages that are required by our scripts
# apt-get install qemu-kvm virtinst virt-manager
Check that your hardware supports hardware virtualization.
$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
If your output differs, check that harware virtualization is enabled in your BIOS settings. You also could try import KVM kernel module
$ sudo modprobe kvm-intel
or
$ sudo modprobe kvm-amd
It might be helpful to add an appropriate module name into /etc/modules file to auto-load it during system boot. Sometimes it is required on Ubuntu systems.
Windows Version | Version String | Save to |
---|---|---|
Windows Server 2008 R2 [1] | 6.1.7601 | /opt/image-builder/share/libvirt/images/ws-2008-eval.iso |
Windows Server 2012 [2] | 6.3.9200 | /opt/image-builder/share/libvirt/images/ws-2012-eval.iso |
Warning
Windows Server 2008 R2 must include Service Pack 1 updates. This is required to install PowerShell V3 which is required by Murano Agent.
[1] | http://www.microsoft.com/en-us/download/details.aspx?id=11093 |
[2] | http://technet.microsoft.com/en-US/evalcenter/hh670538.aspx?ocid=&wt.mc_id=TEC_108_1_33 |
Component | Save to |
---|---|
VirtIO drivers for Windows [4] | /opt/image-builder/share/libvirt/images/virtio-win-0.1-74.iso |
CloudBase-Init for Windows [5] | /opt/image-builder/share/files/CloudbaseInitSetup_Beta.msi |
.NET 4.0 [6] | /opt/image-builder/share/files/dotNetFx40_Full_x86_x64.exe |
PowerShell v3 [7] | /opt/image-builder/share/files/Windows6.1-KB2506143-x64.msu |
Murano Agent [8] | /opt/image-builder/share/files/MuranoAgent.zip |
Git client [9] | /opt/image-builder/share/files/Git-1.8.1.2-preview20130601.exe |
Warning
PowerShell V3 is a mandatory prerequisite. It is required by Murano Agent. To check your PowerShell version use PowerShell command Get-Host.
Warning
When downloading VirtIO drivers choose only stable versions. Unstable versions might lead to errors during guest unattended installation. You can check the latest version avaible here: http://alt.fedoraproject.org/pub/alt/virtio-win/stable
[3] | http://technet.microsoft.com/en-us/evalcenter/hh670538.aspx |
[4] | http://alt.fedoraproject.org/pub/alt/virtio-win/stable/virtio-win-0.1-74.iso |
[5] | https://www.cloudbase.it/downloads/CloudbaseInitSetup_Beta.msi |
[6] | http://www.microsoft.com/en-us/download/details.aspx?id=17718 |
[7] | http://www.microsoft.com/en-us/download/details.aspx?id=34595 |
[8] | https://www.dropbox.com/sh/zthldcxnp6r4flm/AADh6LkVkcw2j8nKZevqedHja/MuranoAgent.zip |
[9] | https://msysgit.googlecode.com/files/Git-1.8.3-preview20130601.exe |
These components are not mandatory for Murano Agent to function properly. However, they may help you work with the image after deployment.
Component | Save to |
---|---|
Far Manager [10] | /opt/image-builder/share/files/Far30b3367.x64.20130717.msi |
Sysinternals Suite [11] | /opt/image-builder/share/files/SysinternalsSuite.zip |
unzip.exe [12] | /opt/image-builder/share/files/unzip.exe |
.NET 4.5 [13] | /opt/image-builder/share/files/dotNetFx45_Full_setup.exe |
[10] | http://www.farmanager.com/files/Far30b3525.x64.20130717.msi |
[11] | http://download.sysinternals.com/files/SysinternalsSuite.zip |
[12] | https://www.dropbox.com/sh/zthldcxnp6r4flm/AACwiyfcrlGDt3ygCFHrbwMra/unzip.exe |
[13] | http://www.microsoft.com/en-us/download/details.aspx?id=30653 |
Tools from this section are not necessary to build an image. However, they may be helpful if you want to create an image with different configuration.
Windows ADK is required if you want to build your own answer files for auto unattended Windows installation.
Download it from http://www.microsoft.com/en-us/download/details.aspx?id=30652
Floppy image with answer file for unattended installation is needed to automate Windows installation process.
Create emtpy floppy image in your home folder
$ mkdir ~/flp/files
$ mkdir ~/flp/mnt
$ dd bs=512 count=2880 if=/dev/zero of=~/flp/floppy.img
$ mkfs.msdos ~/flp/floppy.img
Mount the image
$ mkdir ~/flp/mnt
$ sudo mount -o loop ~/floppy.img ~/flp/mnt
Download autounattend.xml.template file from https://github.com/openstack/murano-deployment/tree/master/contrib/windows/image-builder/share/files
This folder contains unatteded files for several Windows versions, choose one that matches your Windows version.
Copy that file to mounted floppy image
$ cp ~/autounattend.xml.template ~/flp/mnt/autounattend.xml
Replace string %_IMAGE_BUILDER_IP_% in that file with 192.168.122.1
Unmount the image
$ sudo umount ~/flp/mnt
Clone murano-deployment repository
$ git clone git://git.openstack.org/cgit/openstack/murano-deployment.git
Change directory to image-builder folder
$ cd murano-deployment/contrib/windows/image-builder
Create folder structure for image builder
$ sudo make build-root
Download build prerequisites, and copy them to correct folders
Test that all required files are in place
$ sudo make test-build-files
Get list of available images
$ make
Run image build process (e.g. to build Windows Server 2012)
$ sudo make ws-2012-std
Wait until process finishes
The image file ws-2012-std.qcow2 should be stored inside /opt/image-builder/share/images folder.
Note
Please note that the preferred way to build images is to use Image Builder scripts, see Build Windows Image Using Image Builder Script
There are a few scripts which perform all the required post-installation tasks.
They all are located in http://git.openstack.org/cgit/openstack/murano-deployment/tree/contrib/windows/image-builder/share/scripts
Note
There are subfolders for each supported Windows Version. Choose one that matches Windows Version you are building.
This folder contains several scripts
Script Name | Description |
---|---|
wpi.ps1 | Handles component installation and system configuration tasks |
Start-Sysprep.ps1 | Prepares system to be syspreped (cleans log files, stops some services and so on), and starts sysprep |
Start-AtFirstBoot.ps1 | Performes basic after-installation tasks |
Download these scripts and save them into /opt/image-builder/share/scripts
Now you need a virtual machine instance. There are two possible ways to create it - using CLI or GUI tools. We describe both in this section.
$ qemu-img create -f raw /var/lib/libvirt/images/ws-2012.img 40G
# virt-install --connect qemu:///system --hvm --name WinServ \ > --ram 2048 --vcpus 2 --cdrom /opt/samba/share/9200.16384.WIN8_RTM\ >.120725-1247_X64FRE_SERVER_EVAL_EN-US-HRM_SSS_X64FREE_EN-US_DV5.ISO \ > --disk path=/opt/samba/share/virtio-win-0.1-52.iso,device=cdrom \ > --disk path=/opt/samba/share/floppy.img,device=floppy \ > --disk path=/var/lib/libvirt/images/ws-2012.qcow2\ >,format=qcow2,bus=virtio,cache=none \ > --network network=default,model=virtio \ > --memballoon model=virtio --vnc --os-type=windows \ > --os-variant=win2k8 --noautoconsole \ > --accelerate --noapic --keymap=en-us --video=cirrus --force
Launch your virtual machine, connect to its virtual console and complete OS installation. At the end of this step you should have Windows Server system that you are able to log into.
Create folders where Murano components will be installed
Path | Description |
---|---|
C:\Murano | Root directory for Murano |
C:\Murano\Agent | Murano Agent installation directory |
C:\Murano\Modules | PowerShell modules required by Murano |
C:\Murano\Scripts | PowerShell scrtips and other files required by Murano |
Open Explorer and navigate to \192.168.122.1share 192.168.122.1 is an IP address of KVM hypervisor assigned by default.
Copy Murano Agent files into C:MuranoAgent
Copy CoreFunctions directory (entire directory!) into C:MuranoModules
Install .NET 4.0
Register Murano Agent
> cd C:\Murano\Agent
> .\WindowsMuranoAgent.exe /install
Change PowerShell execution policy to less restricted
Set-ExecutionPolicy RemoteSigned
Register CoreFunctions modules
Import-Module C:\Murano\Modules\CoreFunctions\CoreFunctions.psm1 -ArgumentList register
Install CloudInit
Run Sysprep
C:\Murano\Scripts\Start-Sysprep.ps1 -BatchExecution
Wait until sysprep phase finishes and system powers off.
The image must be converted from RAW format to QCOW2 before being imported into Glance.
# qemu-img convert -O qcow2 /var/lib/libvirt/images/ws-2012.raw \
> /var/lib/libvirt/images/ws-2012-ref.qcow2