Update GA_offlinefixer.ps1 to v1.3 - #138
Conversation
v1.3: [August 2026] - Stages and atomically replaces the complete WindowsAzure repository.
- Verifies both required service executables in the staged repository.
- Follows the Microsoft Learn offline VM Agent registry and binary-copy procedure.
- Aligns disk safety, rollback accounting, and rescue service restoration with
win-LKGC and win-sac-onLatest.
- Validates the same-disk Gen1/Gen2 BCD store before Guest Agent changes.
- Repairs and verifies only unknown loader device/osdevice mappings.
- Restores the verified BCD backup after any later transaction failure.
- Reloads the persisted on-disk SYSTEM hive and re-verifies required services.
- Writes GA-OfflineRepair-Verification.json to correlate the repaired disk after restore.
- Uses a PowerShell 3-compatible streaming SHA-256 implementation.
- Emits structured telemetry only through the local VMRepair logger.
- Performs no IMDS lookup or other telemetry network request.
- Preserves unrelated content in the target WindowsAzure folder.
- Stages and validates replacement files before moving the existing Agent folder.
- Rolls back the Agent folder and SYSTEM hive after partial repair failures.
- Bounds file-copy retries to avoid client repair jobs appearing stuck.
- Unloads only stale repair hives that actually exist.
- Uses the same partition discovery and collision handling as win-sac-onLatest.
- Preserves the Gen2 source GPT GUID by temporarily changing only the
- matching disposable repair VM OS disk GUID.
- Temporarily changes and restores source identity only for Gen1 MBR disks.
- Identifies and excludes the rescue VM OS disk by physical disk number.
- Requires an attached Microsoft virtual disk before service or disk disruption.
- Groups candidates by physical disk and validates winload plus the SYSTEM hive.
- Temporarily mounts unlettered Windows partition candidates and cleans them up.
- Detects collision-offlined attached disks before target discovery.
- Restores and verifies the original WSearch service state.
- No longer stops Windows Defender on the rescue VM.
- Makes fallback hive copy-back part of per-disk success accounting.
- Removes the unnecessary Azure Instance Metadata Service request.
- Validates the WindowsAzure robocopy source and staged destination content.
- Updated the script (current)
- Aligned nested VM detection with win-LKGC guard pattern.
- Skips Get-VM safely when Hyper-V module is unavailable.
- Fixed relative path evaluation bug for helper files.
- Updated the script again (current)
- Fixed breaking exception when the Hyper-V module is not installed on the host.
- Added explicit checking via Get-Module before executing nested VM discovery.
|
Hi Gabriela Limoli (@glimoli) , Ryan McCallum (@rymccall) , Edwin Bernal Microsoft (@EdwinBernal1) commit 07bab67 on this PR, addresses all the latest feedback not yet implemented. I've also tested it on my side and works well. If possible, please test it and let's see if we can go live with v1.3. Thanks you. ======================
|
VMRepair Script Test Report: GA_offlinefixer.ps1SummaryOverall Score: 98/100 (Grade: A+) — APPROVE AND MERGE
Fault Injection Results
Testing PerformedStrategy: Fault-injection (representative matrix, 6 configs)
Opportunities for Improvement2 points recoverable (current 98 → potential 100)
Branch vs Main: Script Improvement RatioOverall: 74 → 93 (↑19.5 pts, +26.4% improvement) | Lines: 125 → 1,573 (+1,448)
Source: How to Reach 100/100
Validation EvidenceBefore (Corrupted): After (Repaired): Review Checklist
Test Artifacts
Generated by VMRepairMint Script Testing Agent | Test ID: |
v1.3: [August 2026] - Stages and atomically replaces the complete WindowsAzure repository.
- Verifies both required service executables in the staged repository.
- Follows the Microsoft Learn offline VM Agent registry and binary-copy procedure.
- Aligns disk safety, rollback accounting, and rescue service restoration with
win-LKGC and win-sac-onLatest.
- Validates the same-disk Gen1/Gen2 BCD store before Guest Agent changes.
- Repairs and verifies only unknown loader device/osdevice mappings.
- Restores the verified BCD backup after any later transaction failure.
- Reloads the persisted on-disk SYSTEM hive and re-verifies required services.
- Writes GA-OfflineRepair-Verification.json to correlate the repaired disk after restore.
- Uses a PowerShell 3-compatible streaming SHA-256 implementation.
- Emits structured telemetry only through the local VMRepair logger.
- Performs no IMDS lookup or other telemetry network request.
- Preserves unrelated content in the target WindowsAzure folder.
- Stages and validates replacement files before moving the existing Agent folder.
- Rolls back the Agent folder and SYSTEM hive after partial repair failures.
- Bounds file-copy retries to avoid client repair jobs appearing stuck.
- Unloads only stale repair hives that actually exist.
- Uses the same partition discovery and collision handling as win-sac-onLatest.
- Preserves the Gen2 source GPT GUID by temporarily changing only the
- matching disposable repair VM OS disk GUID.
- Temporarily changes and restores source identity only for Gen1 MBR disks.
- Identifies and excludes the rescue VM OS disk by physical disk number.
- Requires an attached Microsoft virtual disk before service or disk disruption.
- Groups candidates by physical disk and validates winload plus the SYSTEM hive.
- Temporarily mounts unlettered Windows partition candidates and cleans them up.
- Detects collision-offlined attached disks before target discovery.
- Restores and verifies the original WSearch service state.
- No longer stops Windows Defender on the rescue VM.
- Makes fallback hive copy-back part of per-disk success accounting.
- Removes the unnecessary Azure Instance Metadata Service request.
- Validates the WindowsAzure robocopy source and staged destination content.
- Updated the script (current)
- Aligned nested VM detection with win-LKGC guard pattern.
- Skips Get-VM safely when Hyper-V module is unavailable.
- Fixed relative path evaluation bug for helper files.
- Updated the script again (current)
- Fixed breaking exception when the Hyper-V module is not installed on the host.
- Added explicit checking via Get-Module before executing nested VM discovery.