OpenStack Windows Image

Openstack Windows 2016 Image

Preparation:

Download a Windows 2016 Server ISO image at Microsoft (requires registration.)

Download the Fedora VirtIO drivers. (https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso)

Create a VM inside VirtualBox

Choose a name, as a type, choose Microsoft Windows, and as a version choose Other Windows (64 bit).

Assign the VM a minimum of 2GB memory.        


Create a virtual disc with a minimum disc space of 15GB, the standard 20GB is fine, as a type, choose QCOW.


To click export mode,


To click to create the machine.

When the VM is created, do not start it yet. We first have to fine-tune certain things in the settings screen:

System > processor: Add a second CPU, this saves us time

Storage: Connect the first CD-ROM to the Windows ISO you’ve downloaded and Add a second CD-ROM (secondary master) to the existing IDE controller and connect the virtio driver disc to this CD-ROM.

To add disk,

Audio: Disable audio (unless you like to use it)

Network: Change the network to bridge mode, this way you can access it with RDP and Change the network type to virtio-net

Ports: Enable the first serial port (COM1), this is for logging and debugging purposes

Now you have a VM you can boot.

The two ISOs now have the correct start-up sequence, after booting, your VM will start to install from the ISO.

Windows want to be aware of some regional settings, after which it will ask which version of Windows to install.

In this example, we will choose Windows Server 2016 Standard Evaluation 

Read the license terms, if you want to continue, you will have to accept them

After this, choose Custom installation



Installing Drivers 

Now you have the option to install the viostor SCSI drivers, these are necessary, even though we use the IDE controller of VirtualBox at this moment.


Finally, Windows will ask for a passphrase, after that the installation will be finished. Because you want to create an image, you now have to edit your own settings. There are many manuals available on rules about what you can and cannot edit, and why. We will limit ourselves to the necessary settings.

To click load driver :

Navigate to E:\NetKVM\2k16\amd64 and install netkvm.inf (select the file and press the right mouse button)


To click to install Net kvm drive.

Next, install the IO drivers E:\viostor\2k16\amd64\viostor.inf (select the file and press right mouse button)





Click Next to install drive.

After this, the NIC will work, we will need this in a while but now we know for sure that the necessary IO drivers are installed.

Remote Desktop

To be able to use RDP later on, which makes maintenance easier, we have to change two things:

Start Powershell to open the firewall for RDP:

# Enable-NetFirewallRule -name RemoteDesktop-UserMode-In-TCP

Click on Start > Settings, and search for remote desktop, now choose to allow remote desktop access to your computer.


In the popup choose to Allow remote connections to this computer, Click OK to close the popup.

If you are using an unofficial- or older RDP client, remove the checkbox below.

Click on Apply and press OK



To click remote Setting,

To click Allow remote connections to this computer and uncheck all connections only from computers running a remote desktop with network-level authentication.

Click apply and ok.


You can now test the RDP connection, which should work by now 

Cloud-Init

To be able to use Cloud-Init (we need this to, for example, be able to set an admin passphrase when deploying) we have to configure this:

# Set-ExecutionPolicy Unrestricted

After this, download and install Cloud-Init:

Invoke-WebRequest -UseBasicParsing https://cloudbase.it/downloads/CloudbaseInitSetup_Stable_x64.msi -OutFile cloudbaseinit.msi

The download is approximately 40MB

To run cloud-init:


Click Next

To continue, you will have to read and accept the license terms

Click Next

The default settings will be fine, again click Next

Leave everything be except for the Serial port for logging, set that to COM1


Next…

Install

When the installation is finished, select both run Sysprep and Shutdown when Sysprep terminates.



To click to finish 

If you click Finish the Windows installation will be prepared for use as an image and the VM will be closed.

Now you have a Windows image that is switched off, based upon a qcow file which we can upload to OpenStack.


Uploading the Image

When the upload speed of your internet connection isn’t that high (because Windows images are mostly around 10GB) I suggest you use the OpenStack CLI tools for this (see below).

Before we upload the image, we need to convert this as a qcow2 image,

You can use any Linux system :

yum -y install qemu-kvm libvirt virt-install bridge-utils

Once qemu-kvm is installed, you can now convert qcow to qcow2.

To convert :

[root@controller ~]# qemu-img convert -f qcow -O qcow2 windows2016.qcow windows2016.qcow2

Qcow2 image has been ready to upload :

Go to an OpenStack Dashboard

Login

On the left, choose ‘Images’

Create Image

Enter a name and a description

Image Source > Image File en selects the qcow image you have created. The location can be

found in VirtualBox. In your case, it’s a qcow of nearly 13GB.

Change the format to Qcow2

Architecture: x86_64

Minimum Disk: 20

Minimum RAM: 2048

Create Image

Now, the web interface will upload the entire image, after which it will be processed and put

inside the list of available images.



Relevant Blogs:

OpenStack Installation 

Types of Nodes in Openstack   

Kubernetes AWS Integration   

kubernetes init containers

Recent Comments

No comments

Leave a Comment