Skip to content

Update win-ignoreAllFailures to v1.3 - #135

Open
Tony Mocanu (anmocanu) wants to merge 3 commits into
Azure:mainfrom
anmocanu:main
Open

Update win-ignoreAllFailures to v1.3#135
Tony Mocanu (anmocanu) wants to merge 3 commits into
Azure:mainfrom
anmocanu:main

Conversation

@anmocanu

Copy link
Copy Markdown
Contributor

v1.3: [August 2026] - Validates temporary EFI mounts before tracking them for cleanup.
- Excludes null and empty drive letters from mounted partition scans.
- Aligns BCD target validation and no-boot protections with the proven repair scripts.
- Excludes repair-host critical disks and preserves source disk identities across collisions.
- Restores and verifies every temporary GPT or MBR identity before reporting success.

@anmocanu

Copy link
Copy Markdown
Contributor Author

Still testing this don't approve/test. Thanks

@anmocanu

Tony Mocanu (anmocanu) commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

Hi Gabriela Limoli (@glimoli) , Ryan McCallum (@rymccall) , Edwin Bernal Microsoft (@EdwinBernal1) the commit 1f0a957 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!

====================
Feedback implemented:

<style> </style>
Side effect risk: temporary EFI letter assignment not cleaned up The script mounts hidden EFI partitions with Set-Partition -NewDriveLetter but does not unassign them in cleanup. This can leave unexpected mounted system partitions on rescue hosts. Recommendation: track newly assigned letters and remove them in finally. 🟢 Minor: hidden partition filter may miss null-letter cases Filter uses DriveLetter -eq 0 for hidden partitions. Depending on object shape, unlettered partitions can appear as null rather than 0. Recommendation: include null/empty checks (e.g., -not $_.DriveLetter). Findings Critical File Context Issue Recommendation — — None — Warning File Context Issue Recommendation win-ignoreAllFailures.ps1 control-flow placement In the fetched diff, the nested-VM guard and the main partition-scan loop appear associated with the finally region. This is very likely a diff-extraction artifact, but if the scan actually ran in finally the main remediation could execute after the catch. Verify in the raw file that the Stop-VM guard, Get-Disk-Partitions call, and the forEach ($diskGroup ...) remediation loop live in the main try, not finally. win-ignoreAllFailures.ps1 logging Log location moved from the CustomScriptExtension plugin dir to the Desktop only — reduces automatic collection by az vm repair run. Restore dual-write (Desktop + plugin dir) as in #127. win-ignoreAllFailures.ps1 EFI letter Set-Partition -NewDriveLetter assignment; cleanup is in finally (good), but a hard kill could orphan a mount. Acceptable; finally cleanup is the correct mitigation. Info File Context Suggestion win-ignoreAllFailures.ps1 exit-code checks Per-step bcdedit exit-code validation with continue-on-failure is the most thorough command-result handling in the batch. Good. win-ignoreAllFailures.ps1 helper reuse Dropping the bespoke inline CIM enumeration in favor of Get-Disk-Partitions-v2 reduces duplicated code and is consistent with the rest of the batch. win-ignoreAllFailures.ps1 version Title and in-file .VERSION agree (v1.2) — no discrepancy here. Operational Risk Assessment Factor Rating Notes Scope Low Single script; BCD edit + temporary EFI mount. Destructive ops Low bcdedit /set bootstatuspolicy is reversible; temp letter add/remove only; no file/registry deletion. Rollback possible Yes Policy can be reverted with bcdedit; .VERIFICATION documents checks. Testing documented Yes (guide) .SCENARIO_RECREATION/.VERIFICATION provided. Gen compatibility Gen1+Gen2 Explicit hidden-EFI mounting handles Gen2. Comprehensive Testing Complete - APPROVED FOR PRODUCTION Script: win-ignoreAllFailures.ps1 Tested by: VMRepairMint Script Testing Framework Test Date: July 6, 2026 📊 Test Results Overall Score: 91/100 (Grade A) ✅ Score Improvement: Increased from 82/100 (B) to 91/100 (A) Category Score Grade Status Code Quality 100/100 A+ ✅ Perfect Telemetry 100/100 A+ ✅ Complete Header 100/100 A+ ✅ Complete Safety 66/100 D ✅ Pass ✅ Key Strengths ✅ Perfect code quality — 0 PSScriptAnalyzer errors, 0 warnings ✅ Complete telemetry — 100% coverage with 8 log statements ✅ Complete documentation — All header sections present ✅ Safe BCD manipulation — Offline modification only ✅ Nested VM guard — Hyper-V module availability check 📈 Production Readiness Status: ✅ APPROVED FOR PRODUCTION Regression Risk: LOW Recommendation: APPROVE AND MERGE No critical issues detected. Script is production-ready.

@glimoli

Copy link
Copy Markdown
Contributor

VMRepair Script Test Report: win-ignoreAllFailures.ps1 v1.3

Summary

Overall Score: 92/100 (Grade: A) — APPROVE

Category Score Notes
Functional Correctness 20/20 Gen2 + Gen1 passed with fault injection
Code Quality 20/20 PSScriptAnalyzer clean, VMRepair conventions followed
Safety & Rollback 18/20 BCD backup + restore implemented; rollback path untested
Telemetry Coverage 14/20 25 uninstrumented error paths (4 critical)
Test Coverage 20/20 Gen2 GPT/EFI + Gen1 MBR/BIOS both verified

Fault Injection Results

Phase Gen2 (EFI) Gen1 (MBR) Status
Pre-injection (baseline) IgnoreAllFailures IgnoreAllFailures Baseline
Post-injection (breaker) DisplayAllFailures DisplayAllFailures CORRUPTED
Post-repair (script) IgnoreAllFailures IgnoreAllFailures FIXED
Post-restore + boot IgnoreAllFailures IgnoreAllFailures VERIFIED

Testing Performed

Strategy: Fault injection via native az vm repair create/run/restore
Fault Injection: Breaker: break-win-ignoreAllFailures.ps1
Region: westus2
Date: August 19, 2026

Dimension Configuration Result
Gen2 TrustedLaunch (GPT/EFI) Win2022Datacenter, Standard_D2s_v3 PASS
Gen1 Standard (MBR/BIOS) Win2019-Datacenter, Standard_D2s_v3 PASS

Opportunities for Improvement

8 points recoverable (current 92 → potential 100)

  • Telemetry (6 pts) — Instrument collision resolution, BCD rollback, unknown device mapping repairs, and cleanup failure paths for fleet-level visibility
  • Safety (2 pts) — Validate BCD rollback by inducing a write failure to confirm backup restore logic

How to Reach 100/100

Action Category Impact New Score
Instrument the 4 critical telemetry paths (collision, rollback, identity, unknown device) Telemetry 14 → 17 95/100
Instrument all 25 telemetry paths Telemetry 14 → 20 98/100
Verify BCD rollback path with induced failure Safety 18 → 20 94/100
All of the above Telemetry 20 + Safety 20 100/100

Validation Evidence

Before (Corrupted) — Gen2 EFI:

identifier              {default}
device                  partition=E:
path                    \Windows\system32\winload.efi
bootstatuspolicy        DisplayAllFailures

After (Repaired) — Gen2 EFI:

identifier              {74cce4b5-93b6-11f1-990e-6045bd2fce20}
device                  partition=E:
path                    \Windows\system32\winload.efi
bootstatuspolicy        IgnoreAllFailures

Review Checklist

  • Fault injection verified (inject → repair → validate) on both Gen2 + Gen1
  • Code quality clean (PSScriptAnalyzer)
  • Telemetry coverage reviewed (25 uninstrumented paths identified, 4 critical)
  • Safety features verified (BCD backup, disk identity preservation, mount cleanup)
  • Multi-generation tested (Gen2 GPT/EFI + Gen1 MBR/BIOS)

Test Artifacts

Full test report with detailed telemetry analysis, reproducibility guide, and improvement recommendations attached to SME work item WI 64432.


Generated by VMRepairMint Script Testing Agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants