In this practical module, we examine how Microsoft Hyper-V Generation-2 virtual machines leverage UEFI firmware and synthetic SCSI controllers over the high-speed VMBus architecture. We then aggregate multiple raw disks into an enterprise Storage Pool and carve out a resilient 2-Way Mirror Virtual Disk mounted as Drive E: DATA-POOL.
โ Generation 1 vs Generation 2 VMs Comparison
Generation 2 VMs were introduced to discard emulated PC motherboard components dating back to the 1990s in favor of modern virtualization paradigms:
| Feature Matrix | Generation 1 VM | Generation 2 VM (Our Lab Standard) |
|---|---|---|
| Firmware | Legacy BIOS (MBR partitions) | UEFI (Unified Extensible Firmware Interface, GPT) |
| Boot Drive Bus | Emulated IDE Controller | Synthetic SCSI Controller (Direct VMBus access) |
| Secure Boot | Not Supported | Hardware-grade Secure Boot (Microsoft UEFI CA) |
| Network Boot (PXE) | Requires Emulated Legacy NIC (Slow) | Standard Synthetic Network Adapter (Gigabit+) |
| VHDX Dynamic Resizing | Offline only for OS disk | Hot expand/shrink online while VM is running |
๐ Storage Spaces Resiliency Modes Explained
Storage Spaces provides three fundamental resiliency profiles, analogous to RAID levels:
- Simple (Striping - RAID 0): Data is striped across all physical drives. Provides highest I/O throughput and 100% capacity efficiency, but offers zero fault tolerance. If 1 disk fails, all data is destroyed.
- Mirror (2-Way / 3-Way - RAID 1/10): Data is duplicated across 2 or 3 separate physical disks. 2-way mirror tolerates 1 simultaneous disk loss; 3-way mirror tolerates 2 simultaneous disk losses. (Selected for our production lab).
- Parity (Striping with Parity - RAID 5): Calculates parity stripes across a minimum of 3 disks. Balances redundancy with capacity efficiency (~66% usable capacity).
Step 1: Hot-Plugging VHDX Storage Disks from Host
Before configuring the storage pool inside the guest VM, we provision 3x 10GB dynamic virtual hard disks and attach them to the SCSI controller of SRV-01:
# Hot-plug 3x 10GB VHDX Disks to SRV-01 SCSI Controller $vmName = "SRV-01" $vhdDir = "C:\HyperV-Labs\Virtual Hard Disks" for ($i = 1; $i -le 3; $i++) { $diskPath = "$vhdDir\$vmName-DataDisk0$i.vhdx" if (-not (Test-Path $diskPath)) { New-VHD -Path $diskPath -SizeBytes 10GB -Dynamic | Out-Null Add-VMHardDiskDrive -VMName $vmName -Path $diskPath -ControllerType SCSI Write-Host " [+] Attached Data Disk: $diskPath" -ForegroundColor Green } }
Step 2: In-Guest Storage Pool, Mirror Disk & Drive E:
Inside SRV-01, we run Configure-StorageSpaces.ps1 to discover unpooled disks, aggregate them into LabStoragePool, create a 2-way mirror virtual disk, and format with NTFS:
# 1. Discover poolable raw physical disks $disks = Get-PhysicalDisk -CanPool $true # 2. Create Storage Pool $poolName = "LabStoragePool" $pool = New-StoragePool -FriendlyName $poolName ` -StorageSubsystemFriendlyName "Windows Storage*" ` -PhysicalDisks $disks # 3. Create 2-Way Mirror Resilient Virtual Disk $vDiskName = "LabVirtualDisk" $vDisk = New-VirtualDisk -StoragePoolFriendlyName $poolName ` -FriendlyName $vDiskName ` -ResiliencySettingName "Mirror" ` -UseMaximumSize # 4. Initialize GPT, Partition and Format NTFS Volume (E:) $diskObj = $vDisk | Get-Disk Initialize-Disk -Number $diskObj.Number -PartitionStyle GPT $partition = New-Partition -DiskNumber $diskObj.Number -UseMaximumSize -AssignDriveLetter Format-Volume -Partition $partition -FileSystem NTFS -NewFileSystemLabel "DATA-POOL" -Confirm:$false
Step 3: Verification & I/O Integrity Test
Execute the Block 1 verification test to audit health and write persistent marker files:
# Run in-guest verification & ".\scripts\01_Block1_HyperV_Storage\Verify-Block1.ps1"