Skip to content

fix: keep lowest-numbered cd-roms#582

Merged
kp2099 merged 2 commits intomainfrom
fix/reattach-cdrom
Dec 15, 2025
Merged

fix: keep lowest-numbered cd-roms#582
kp2099 merged 2 commits intomainfrom
fix/reattach-cdrom

Conversation

@tenthirtyam
Copy link
Copy Markdown
Collaborator

Description

Updates the logic for removing CD-ROM devices from a virtual machine to ensure a deterministic order of removal. Instead of removing the first n CD-ROMs, the code now removes the last n CD-ROMs, which can help avoid unexpected changes in device ordering. This prevents a "IDE slave with no master" error that occurs when lower-numbered IDE slots are empty while higher-numbered slots are occupied (e.g., having a device at IDE 0:1 with no device at IDE 0:0).

Resolved Issues

Closes #516

Rollback Plan

Revert commit.

Changes to Security Controls

None.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical bug in CD-ROM device removal logic that could cause "IDE slave with no master" errors in VMware virtual machines. The fix changes the removal order from removing the first n CD-ROMs to removing the last n CD-ROMs, thereby preserving lower-numbered device slots which is essential for IDE controller compatibility.

Key Changes:

  • Modified slice operation in RemoveNCdroms to remove CD-ROMs from the end of the device list instead of the beginning
  • Added inline comment explaining the deterministic removal order

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

When `RemoveNCdroms` is called, the function now removes the highest-numbered CD-ROM devices instead of the lowest-numbered ones. This prevents a "IDE slave with no master" error that occurs when lower-numbered IDE slots
are empty while higher-numbered slots are occupied (e.g., having a device at
IDE 0:1 with no device at IDE 0:0).

Signed-off-by: Ryan Johnson <rya@tenthirtyam.org>
@kp2099 kp2099 merged commit 32f2b1a into main Dec 15, 2025
14 checks passed
@kp2099 kp2099 deleted the fix/reattach-cdrom branch December 15, 2025 09:23
@github-actions
Copy link
Copy Markdown

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vsphere-iso: Failure to Power-On VM after reattach_cdroms removes excess CD/DVD drives

3 participants