Skip to content

Update disk-passthrough.sh#125

Open
Lifell-Adm wants to merge 1 commit intoMacRimi:mainfrom
Lifell-Adm:main
Open

Update disk-passthrough.sh#125
Lifell-Adm wants to merge 1 commit intoMacRimi:mainfrom
Lifell-Adm:main

Conversation

@Lifell-Adm
Copy link

This update enhances the robustness and persistence of physical disk assignment to Proxmox VMs by implementing support for /dev/by-id paths.

Changes Made:

  • Added get_preferred_disk_path() function to find and select the most appropriate /dev/by-id symlink for each disk
  • Modified disk detection logic to check for existing assignments using both /dev/sdX and /dev/by-id paths
  • Updated disk assignment to use persistent /dev/by-id paths when available, falling back to /dev/sdX if not
  • Enhanced duplicate assignment checks to prevent conflicts with both path types
  • Updated script description and version to reflect the new functionality

Benefits:

  • Persistence: Disk assignments remain valid across system reboots, even if disk enumeration order changes
  • Robustness: Eliminates potential issues caused by /dev/sdX path changes
  • Backward Compatibility: Gracefully falls back to traditional paths when /dev/by-id is unavailable
  • Smart Selection: Prefers shorter, more readable /dev/by-id symlinks (model-based over UUID-based)

Files Modified:

  • scripts/storage/disk-passthrough.sh: Added /dev/by-id support throughout the script

Testing:

  • Verify disk assignment works with disks having /dev/by-id symlinks
  • Confirm fallback to /dev/sdX paths on systems without /dev/by-id
  • Test with multiple disks to ensure proper path selection
  • Validate that existing assignments are correctly detected regardless of path type

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.

1 participant

Comments