Skip to main content

Creating Windows images for mCloud - Knowledgebase / mCloud - Micron21 Knowledge Hub

Creating Windows images for mCloud

Authors list
  • Damian Jackson

Introduction

For BYO licensing clients, Micron21 is unable to provide images due to licensing restrictions.

This guide provides instructions for creating a Windows OpenStack image using the Cloudbase Windows Imaging Tools. This process automates the installation of drivers, updates, and Cloudbase-Init, resulting in a sysprepped image ready for a public or private cloud environment.

Prerequisites

The prerequisites are as follows:

  • Windows Server ISO: The installation media for the version of Windows you wish to image.

  • VirtIO ISO: Version 0.1.271 is the only version currently without known issues (as of Feb 2026). Download here https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.271-1/virtio-win-0.1.271.iso

  • System Requirements: A Windows PC with 4GB+ free memory and 60GB+ free disk space.

  • Hyper-V: The Hyper-V role must be installed and running on your local machine.

  • Git: Installed and available in your command line.

  • Imaging Tools: The generic Cloudbase Windows Imaging Tools. - https://github.com/cloudbase/windows-imaging-tools

Step 1: Prepare the Environment

  1. Open PowerShell as an Administrator.

  2. Navigate to your root directory (e.g., C:\) and clone the imaging tools repository:

git clone https://github.com/cloudbase/windows-imaging-tools.git

cd windows-imaging-tools

git submodule update --init

$ConfigFilePath = ".\config.ini"

New-WindowsImageConfig -ConfigFilePath $ConfigFilePath

# To automate the config options setting:

Set-IniFileValue -Path (Resolve-Path $ConfigFilePath) -Section "DEFAULT" `

-Key "wim_file_path" `

-Value "D:\Sources\install.wim"

  1. Mount your Windows Server ISO by double-clicking it in File Explorer or using Mount-DiskImage. Note the drive letter assigned (e.g., D:).

Step 2: Configure the Build Settings

Since pre-made configuration files are not provided, you must create one based on the config created in step 1.

Open config.ini in a text editor and update the following critical settings:

wim_file_path: Point this to the install.wim file on your mounted Windows ISO (usually D:\sources\install.wim).

virtio_iso_path: Point this to the location of your downloaded VirtIO ISO.

image_name: This defines the OS version (e.g., Windows Server 2025 SERVERSTANDARD). To find the correct index, run Get-WindowsImage -ImagePath "D:\sources\install.wim".

product_key: The license key for your installation

install_updates: Set to True if you want the process to bake in Windows Updates (this will significantly increase build time).

time_zone: The timezone you want your images to have. For AEST, "AUS Eastern Standard Time"

You can also set up Cloudbase-init settings if you want in windows-imaging-tools\cbinit. Full documentation is here:

https://cloudbase-init.readthedocs.io/en/latest/

Step 3: Generate the Image

In your Administrator PowerShell window, run the following commands to start the automated build:

Import-Module .\WinImageBuilder.psm1

Import-Module .\Config.psm1

Import-Module .\UnattendResources\ini.psm1

New-WindowsOnlineImage -ConfigFilePath $ConfigFilePath

What this script does:

  1. Creates a virtual disk (VHDX) and applies the Windows image.

  2. Injects VirtIO drivers.

  3. Creates a temporary Hyper-V VM to run the installation.

  4. Installs Cloudbase-Init.

  5. Performs Sysprep.

  6. Optimizes the drive (defrag and zeroing unused space).

  7. Converts the final result into a .qcow2 image in the .\images\ folder.

Step 4: Convert to RAW (Mandatory for mCloud)

As the mCloud platform utilizes Ceph, we use RAW for our images.

Locate the qemu-img.exe binary (usually found in the .\bin\ folder of the cloned repo) and run:

.\bin\qemu-img.exe convert -f qcow2 -O raw \path\to\your-image.qcow2 \path\to\your-image.img

Step 5: Uploading to OpenStack

When uploading your final image to OpenStack (via Horizon or the CLI), it is vital to set the correct metadata to ensure Windows boots correctly on KVM.

Required Metadata:

Key Value

hw_firmware_type uefi

hw_machine_type q35

hw_qemu_guest_agent yes

img_config_drive mandatory


Helpful Unhelpful