Create a Windows VM from an ISO in PCD
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
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.
pcdctl image create "windows-installation-iso" --os-interface admin --insecure \
--disk-format iso \
--container-format bare \
--file /path/to/windows-installation.isoUpload VirtIO Driver ISO
Run the following command to upload the VirtIO driver ISO to the PCD Image service.
pcdctl image create "virtio-driver-iso" --os-interface admin --insecure \
--disk-format iso \
--container-format bare \
--file /path/to/virtio-win.isoStep 2: Create Volumes
Create the installation media volume.
This creates a bootable volume that contains the Windows installation media.
pcdctl volume create --image windows-installation-iso --size 10 --bootable windows-installation-volume --insecureCreate VirtIO driver media volume.
This creates a bootable volume that provides VirtIO drivers during Windows installation.
pcdctl volume create --image virtio-driver-iso --size 2 virtio-driver-volume --insecureCreate Windows OS Target volume.
This creates a target disk where Windows is being installed.
pcdctl volume create --size 40 --bootable windows-os-target-volume --insecure
pcdctl volume set \
--image-property hw_boot_menu=true \
--image-property hw_firmware_type=uefi \
--image-property hw_machine_type=q35 \
--image-property hw_tpm_model=tpm-crb \
--image-property hw_tpm_version=2.0 \
--image-property hw_cdrom_bus=sata \
--image-property hw_disk_bus=virtio \
--image-property hw_scsi_model=virtio-scsi \
--image-property os_secure_boot=required \
--image-property os_type=windows \
--image-property hw_video_model=qxl \
windows-os-target-volumeStep 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 (
device_type=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.
openstack server create --insecure --flavor m1.xlarge --network <NETWORK_NAME_OR_UUID> \
--block-device source_type=volume,uuid=$(openstack volume show windows-os-target-volume -f value -c id --insecure),destination_type=volume,device_type=disk,boot_index=0 \
--block-device source_type=volume,uuid=$(openstack volume show windows-installation-volume -f value -c id --insecure),destination_type=volume,device_type=cdrom,boot_index=1 \
--block-device source_type=volume,uuid=$(openstack volume show virtio-driver-volume -f value -c id --insecure),destination_type=volume,device_type=cdrom,boot_index=-1 \
--availability-zone <PCD-Cluster-Name> \
<VM-Name>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. Replace <PCD-Cluster-Name> with your PCD cluster name.
The pcdctl volume show command is referencing the previously created volumes to ensure correct attachment.
Step 4: Configure the VM
Initial Boot Process
Access the VM console from the PCD UI.
Press Enter at the 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.


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\2k19for Windows Server 2019.Select and install VirtIO SCSI driver.


OPTIONAL: Disable Secure Boot and vTPM
Certain operating systems like Windows 11 require TPM and Secure Boot. If your VM does not have Secure Boot or a TPM but you still want to continue the installation, you can bypass these checks. To proceed, 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.


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.
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.


If it does not appear, continue with the following steps.
Download the VirtIO setup package from Index of /groups/virt/virtio-win/direct-downloads.
Run virtio-setup to install the drivers.




After installation is complete, navigate back to Device Manager > System devices to verify that the VirtIO driver is listed.

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 s ysprep to create a generalized golden image.
Allow the VM to power off automatically once the process is complete.

Step 5: Create Golden Image
Detach the Windows Installer and VirtIO drivers: Detach the windows-installation-volume and virtio-driver-volume. This leaves your VM with windows-os-target-volume with windows installed. This can be done from the UI
Create a Glance Image from the Installation Volume: Navigate to the windows-os-target-volume in the volumes page in the UI and select the action to
Upload as Image.Set Image Properties: Set the required properties to ensure the VM boots correctly. This can also be done in the UI using the
Edit Propertiesoption.
pcdctl --os-interface admin --insecure image set <windows-image-name> \
--property hw_boot_menu=true \
--property hw_firmware_type=uefi \
--property hw_machine_type=q35 \
--property hw_tpm_model=tpm-crb \
--property hw_tpm_version=2.0 \
--property hw_disk_bus=virtio \
--property hw_scsi_model=virtio-scsi \
--property hw_vif_model=virtio \
--property os_secure_boot=required \
--property os_type=windows \
--property hw_video_model=qxlA 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.
Last updated
Was this helpful?
