Create a Windows Virtual Machine from an ISO

Overview

Deploy Windows VMs directly from ISO files using Private Cloud Director (PCD)eliminating manual installation and conversion workflows. Upload the Windows ISO and VirtIO drivers, configure installation volumes with optimized VM properties, execute the Windows installation with the required drivers, and generate reusable golden images for consistent enterprise deployments.

This approach streamlines Windows VM provisioning within PCD environments while maintaining standardized configuration management and automated provisioning capabilities.

Prerequisites

Environment Requirements

  • PCD access with Block Storage configured.
  • Network connectivity and VLAN access.
  • Image, volume, and VM creation permissions.

Required Tools

  • PCD CLI (pcdctl) or OpenStack CLI version 6.3.0 and greater.
  • product_acronym web interface for console access

Required Files

  • Windows ISO: Server 2012, 2016, 2019, 2022, or Windows 10.
  • VirtIO Driver ISO: Latest stable from Fedora VirtIO repository, better performance on a Linux (QEMU-KVM) hypervisor.
  • Verify file integrity using checksums

Step 1: Upload Images

  1. Upload Windows Installation ISO

Run the following command to upload a Windows ISO (for example, Windows Server 2012, 2016, 2019, 2022, or Windows 10) to the PCD Image service.

Bash
Copy
  1. Upload VirtIO Driver ISO

Run the following command to upload the VirtIO driver ISO to the PCD Image service.

Bash
Copy

Step 2: Create Volumes

If you do not specify a volume type Private Cloud Director uses __DEFAULT__, and you are adding --type <volume-type> to the volume create command to store volumes on block storage.

  1. Create installation media volume.

This creates a bootable volume that contains the Windows installation media.

Bash
Copy
  1. Create VirtIO driver media volume.

This creates a bootable volume that provides VirtIO drivers during Windows installation.

Bash
Copy
  1. Create Windows OS Target volume.

This creates a target disk where Windows is being installed.

Bash
Copy

Step 3: Launch VM using the created volumes

This step creates a virtual machine with the previously created volumes. The VM is configured as follows:

  • Booting from the Windows installation ISO (devicetype=cdrom): __The VM is loading the Windows installer.
  • Attaching the VirtIO driver ISO __(device type=cdrom)``: The VM is providing essential drivers during the installation.
  • Using the target volume as the installation disk (device_type=disk): The VM is serving this disk as the destination for the Windows OS installation.

The properties specified in the command ensure that the VM is booting correctly and remains compatible with Windows installation requirements.

Bash
Copy

Replace <NETWORK_NAME_OR_UUID> with the appropriate network name or UUID in your environment. Replace <vm-name> with the desired name for your VM.

The openstack volume show commands are referencing the previously created volumes to ensure correct attachment.

Step 4: Configure the VM

  1. Initial Boot Process

Access the VM console from the PCD UI.

  • Press Enter at boot prompt
  • Select Boot Manager and then press Enter.
  • Select UEFI QEMU QEMU CD-ROM and then press Enter.
  • Press any key to boot from CD.

The Windows installer is loading. This occurs only during the first boot.

  1. Install VirtIO Drivers

During Windows installation:

  • Select Browse when prompted for storage drivers.
  • Navigate to VirtIO driver ISO identified by the Windows version you are installing, for example D:\amd64\2k19 for Windows Server 2019.
  • Select and install VirtIO SCSI driver.

VirtIO drivers required for optimal performance.

  1. Disable Secure Boot and vTPM (mandatory for Windows 11 and later)

Windows 11 requires Virtual TPM during installation. To bypass these checks and continue the installation, follow these steps:

  • On the OS selection page, press Shift+F10 to open a command prompt.

  • In the command prompt, type regedit and press Enter to launch the Registry Editor.

  • On the Registry Editor, navigate to HKEY_LOCAL_ MACHINE > SYSTEM > Setup folder.

  • Create a new key named LabConfig as a part of the Setup folder.

  • Within the LabConfig key, create two new REG_DWORD entries and set the values to 1:

    • BypassTPMCheck
    • BypassSecureBootCheck
  • Close the Registry Editor and the command prompt and continue with the Windows installation.

  1. Install Network and Other Required Drivers

After Windows installation completes, install the necessary drivers to enable network connectivity and other devices.

  • Access Device Manager.
  • Right-click Ethernet Controller and select Update Driver Software.
  • Browse to the VirtIO path (for example, E:\NetKVM\2k16\) and complete the installation.
  • Repeat the process for any remaining devices listed in Device Manager.
  1. Verify VirtIO Driver Installation
  • Access Device Manager and then navigate to System devices > VirtIO driver.
    • If the VirtIO driver appears in the list, the driver is already installed.
  • After installation is complete, navigate back to Device Manager > System devices to verify that the VirtIO driver is listed.
  1. Install Cloudbase-Init
  • Download and run Cloudbase-Init to enable automated configuration for future VMs. PCD uses Cloudbase-Init to set the initial Administrator password during VM deployment.
  • Select the option to run Sysprep to create a generalized golden image.
  • Allow the VM to power off automatically once the process is complete.

Step 5: Create Golden Image

  1. Detach the Target Volume Detach the windows-os-target-volumethat contains the installed operating system. This prepares it for upload as a Glance image.
Bash
Copy

After detaching the target volume, you can delete the VM. Its primary purpose is to prepare the Windows image.

  1. Create a Glance Image from the Installation Volume

Run the following command to create a Glance image from the windows-os-target-volume:

Bash
Copy
  1. Set Image Properties

Set the required properties to ensure the VM boots correctly:

Bash
Copy

A reusable golden image is now created and can be used for future Windows VM deployments, allowing you to quickly provision new VMs without having to repeat the installation process.

Step 6: Deploy a VM from the golden image

Refer to the Deploy VMs on your Virtualized Cluster guide to deploy a VM with the new golden image.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated