Conversation
ddc3db5 to
00c018f
Compare
|
Ready for review, @kp2099! |
|
@tenthirtyam, it looks like there are merge conflicts here since I merged the Usb version PR before this one. Could you please resolve them? |
00c018f to
cf7293b
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new tools mode system for VMware virtual machines, adding explicit control over how VMware Tools ISO files are provided to VMs. The key change is the introduction of a tools_mode configuration parameter that supports three modes: upload (uploads ISO), attach (attaches ISO as CD-ROM), and disable (no ISO provided).
Key changes:
- Added new
tools_modeconfiguration with validation and mode-specific behavior - Implemented CD-ROM attachment functionality for the new "attach" mode
- Enhanced build steps to support both upload and attach workflows with proper cleanup
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| docs-partials/builder/vmware/common/ToolsConfig-not-required.mdx | Updated documentation to reflect new tools_mode configuration and parameter reorganization |
| builder/vmware/common/tools_config.go | Added tools_mode validation, mode-specific logic, and comprehensive parameter validation |
| builder/vmware/common/step_attach_tools_cdrom.go | New step implementation for attaching VMware Tools ISO as CD-ROM device |
| builder/vmware/common/cdrom_utils.go | New utility functions for CD-ROM device slot management and attachment/detachment |
| builder/vmware/common/step_clean_vmx.go | Enhanced VMX cleanup to properly handle tools CD-ROM device removal |
| builder/vmware/iso/builder.go | Integration of new tools attach step in build pipeline |
| builder/vmware/vmx/builder.go | Integration of new tools attach step in build pipeline |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
docs-partials/builder/vmware/common/ToolsConfig-not-required.mdx
Outdated
Show resolved
Hide resolved
cf7293b to
4d8e718
Compare
Adds the option to attach VMware Tools ISO as a CD-ROM device. Adds `tools_mode` configuration for choosing between `upload`, `attach`, or `disable` modes. Signed-off-by: Ryan Johnson <rya@tenthirtyam.org>
4d8e718 to
37e883d
Compare
|
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. |
Description
Caution
This is a breaking change and will be shipped in v2.
This pull request introduces a new mechanism for providing VMware Tools to virtual machines, adding support for explicit modes (
upload,attach, anddisable) and refactoring the configuration and implementation accordingly. It also adds robust logic for attaching VMware Tools ISO as a CD-ROM device, including slot detection and device management, and updates documentation to reflect these changes.tools_modeconfiguration supporting three modes:upload(uploads ISO),attach(attaches ISO as CD-ROM), anddisable(no ISO provided). This change is reflected in both documentation files (.web-docs/components/builder/iso/README.mdand.web-docs/components/builder/vmx/README.md) and in code constants (builder/vmware/common/driver.go). [1] [2] [3] [4]cdrom_utils.goto find the next available CD-ROM slot, attach, and detach CD-ROM devices in VMX configuration data, supporting IDE, SATA, and SCSI adapters.StepAttachToolsCDROM, a new build step that attaches the VMware Tools ISO as a CD-ROM device based on configuration, handling device slot selection, error cases, and state management.tools_modeand clarify the usage and restrictions of related configuration options. [1] [2]Valid Configurations
1. Upload Mode with Flavor
2. Upload Mode with Flavor and Default Path
3. Upload Mode with Custom ISO File
4. Attach Mode with Local ISO
5. Disabled Tools
6. Upload Mode with Template Path
Invalid Configurations
1. Missing tools_mode (when using tools config)
Error:
'tools_mode' must be explicitly specified when using any tools configuration2. Invalid tools_mode value
Error:
invalid 'tools_mode' specified: invalid_mode; must be one of upload, attach, disable3. Invalid tools_upload_flavor
Error:
invalid 'tools_upload_flavor' specified: invalid_os; must be one of darwin, linux, windows4. Conflicting upload configuration
Error:
'tools_upload_flavor' and 'tools_source_path' cannot both be specified - use one or the other5. Upload mode without source
Error:
'tools_mode="upload"' requires either 'tools_upload_flavor' or 'tools_source_path'6. Attach mode without source path
Error:
'tools_source_path' is required when 'tools_mode="attach"'7. Upload path with attach mode
Error:
'tools_upload_path' can only be used with 'tools_mode="upload"', not 'tools_mode="attach"'8. Non-existent source path
Error:
tools source path does not exist: /nonexistent/path/tools.iso9. Relative path (not absolute)
Error:
tools source path must be absolute, got relative path: relative/path/tools.iso10. Directory instead of file
Error:
tools source path must be a file, not a directory: /Applications/VMware Fusion.appWarnings
1. Ignored configuration with disabled mode
Warnings:
'tools_upload_flavor' is ignored when 'tools_mode="disable"''tools_upload_path' is ignored when 'tools_mode="disable"''tools_source_path' is ignored when 'tools_mode="disable"'Resolved Issues
Closes #281
Rollback Plan
Revert commit.
Changes to Security Controls
None.