Murano requires a Windows Image in QCOW2 format to be builded 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
Please check that hardware virtualization supported and enabled in BIOS.
The following packages should be installed on any host which will be used to build Windows Image:
On Ubuntu you could install them using the command below:
># apt-get install ipxe-qemu kvm-ipxe qemu-kvm virt-goodies \
virtinst virt-manager libvirt0 libvirt-bin \
munin-libvirt-plugins python python-libvirt \
python-libxml2 python-minimal python-pycurl \
python-pyorbit python-requests python-six \
samba samba-common openssh-server virt-top virt-what
Download the files below and copy them into their places in your ${SHARE_PATH} folder (we usually use /opt/samba/share as ${SHARE_PATH}):
This section describes additional software which is required to build an Windows Image.
Windows ADK
Windows Assessment and Deployment Kit (ADK) for Windows® 8 is required to build your own answer files for auto unattended Windows installation.
You can dowload it from http://www.microsoft.com/en-us/download/details.aspx?id=30652.
PuTTY
PuTTY is a useful tool to manage your Linux boxes via SSH.
You can download it from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html.
Windows Server ISO image
We use the following Windows installation images:
Windows Server 2008 R2
7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso
Windows Server 2012
- Image Name:
9200.16384.WIN8_RTM.120725-1247_X64FRE_SERVER_EVAL_EN-US-HRM_SSS_X64FREE_EN-US_DV5.iso
VirtIO Red Hat drivers ISO image
Warning
Please, choose stable version instead of latest, We’ve got errors with unstable drivers during guest unattended install.
Download drivers from http://alt.fedoraproject.org/pub/alt/virtio-win/stable/
Floppy Image With Unattended File
Run following commands as root:
Create emtpy floppy image in your home folder
># dd bs=512 count=2880 \
if=/dev/zero of=~/floppy.img \
mkfs.msdos ~/floppy.img
Mount the image to /media/floppy
># mkdir /media/floppy mount -o loop \
~/floppy.img /media/floppy
Download autounattend.xml file from https://raw.githubusercontent.com/stackforge/murano-deployment/master/image-builder/share/files/ws-2012-std/autounattend.xml.template
># cd ~
># wget https://raw.githubusercontent.com/stackforge/murano-deployment/master/image-builder/share/files/ws-2012-std/autounattend.xml.template
Copy our autounattend.xml to /media/floppy
># cp ~/autounattend.xml /media/floppy
Unmount the image
># umount /media/floppy
Clone murano-deployment repository
># git clone git://github.com/stackforge/murano-deployment.git
Change directory to murano-deployment/image-builder folder.
Create folder structure for image builder
># make build-root
Create shared resource
Add to /etc/samba/smb.conf.
[image-builder-share]
comment = Image Builder Share
browsable = yes
path = /opt/image-builder/share
guest ok = yes
guest user = nobody
read only = no
create mask = 0755
Restart samba services.
># restart smbd && restart nmbd
Test that all required files are in place
># make test-build-files
Get list of available images
># make
Run image build process
># make ws-2012-std
Wait until process finishes
9. The image file ws-2012-std.qcow2 should be stored under /opt/image-builder/share/images folder.
Warning
Please note that the preferred way to build images is to use Automated Build described in the previous chapter.
Get Post-Install Scripts
There are a few scripts which perform all the required post-installation tasks.
Package installation tasks are performed by script named wpi.ps1.
Download it from https://raw.github.com/stackforge/murano-deployment/master/image-builder/share/scripts/ws-2012-std/wpi.ps1
Note
There are a few scripts named wpi.ps1, each supports only one version of Windows image. The script above is intended to be used to create Windows Server 2012 Standard. To build other version of Windows please use appropriate script from scripts folder.
Clean-up actions to finish image preparation are performed by Start-Sysprep.ps1 script.
Download it from https://raw.github.com/stackforge/murano-deployment/master/image-builder/share/scripts/ws-2012-std/Start-Sysprep.ps1
These scripts should be copied to the shared resource folder, subfolder Scripts.
Create a VM
This section describes steps required to build an image of Windows Virtual Machine which could be used with Murano. There are two possible ways to create it - from CLI or using GUI tools. We describe both in this section.
Note
Run all commands as root.
Way 1: Using CLI Tools
This section describes the required step to launch a VM using CLI tools only.
Preallocate disk image
># qemu-img create -f raw /var/lib/libvirt/images/ws-2012.img 40G
Start the VM
># 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
Way 2: Using virt-manager UI
A VM also could be lauched via GUI tools like virt-manager.
Convert the image from RAW to QCOW2 format.
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