fix: align controller names for VBoxManage#178
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request updates the VirtualBox builder’s hardcoded storage controller names to match the controller names commonly present in imported OVF/OVA images (e.g., Ubuntu cloud images), preventing VBoxManage storageattach from failing due to mismatched controller names.
Changes:
- Renames storage controllers used by the ISO builder disk-creation step (IDE/SATA/SCSI/NVMe/VirtIO).
- Updates ISO-attachment logic to use the new controller names.
- Updates device-removal logic and tests to reflect the new floppy/ISO controller names.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| builder/virtualbox/iso/step_create_disk.go | Renames created controller names (IDE/SATA/SCSI/NVMe/VirtIO) and adjusts disk attach to match. |
| builder/virtualbox/common/step_remove_devices.go | Uses updated floppy controller name when detaching/removing. |
| builder/virtualbox/common/step_remove_devices_test.go | Updates assertions/fixtures to expect the new controller names. |
| builder/virtualbox/common/step_attach_isos.go | Updates controller names used for attaching boot/cd_files/guest additions ISOs. |
| builder/virtualbox/common/step_attach_floppy.go | Uses updated floppy controller name when creating/attaching/cleaning up. |
Comments suppressed due to low confidence (1)
builder/virtualbox/common/step_attach_isos.go:122
- Hardcoding the controller name to "IDE"/"SATA"/"VirtioSCSI" can still fail for imported OVFs/VMs that use the previous/default VirtualBox controller names (e.g. "IDE Controller", "SATA Controller", or "VirtIO Controller"). Since this step is shared by the OVF builder, a regression here can reintroduce the same attach failure for other images. Consider retrying the
storageattachwith legacy controller names when the first attempt fails, and make sure the chosen controller name is also used for the corresponding unmount command.
controllerName = "VirtioSCSI"
port = 15
device = 0
}
ui.Message("Mounting cd_files ISO...")
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @taraxacum45e9a , Thanks for looking into this! |
Update storage controller naming to match the strings used by VBoxManage. The previous names included a redundant "Controller" suffix, and "VirtIO Controller" has been corrected to "VirtioSCSI" to align with VirtualBox device identification. * Replace "IDE Controller" with "IDE" * Replace "SATA Controller" with "SATA" * Replace "SCSI Controller" with "SCSI" * Replace "Floppy Controller" with "Floppy" * Replace "NVMe Controller" with "NVMe" * Replace "VirtIO Controller" with "VirtioSCSI" Fixes: hashicorp#56 Fixes: hashicorp#108 Signed-off-by: Shen Jiamin <shen_jiamin@comp.nus.edu.sg>
ee87528 to
04a615a
Compare
|
Hi @anurag5sh Thanks for looking into this For For I don't have any experience on |
Description
This pull request updates the storage controller naming conventions within the VirtualBox plugin to align with the specific strings expected by
VBoxManage.Specifically, this change:
Resolved Issues
Closes #56
Closes #108
Changes to Security Controls
No changes to security controls are included in this PR.