hashicorp / hashicorp/packer-plugin-hyperv
[Hyper-V] Add optional step to the hyperv-iso builder to run Convert-VHD when using differencing_disk and skip_export
- Dominant language
- Go
- Stars
- 27
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
_This issue was originally opened by @ebjornset as hashicorp/packer#5813. It was migrated here as a result of the [Packer plugin split](https://github.com/hashicorp/packer/issues/8610#issuecomment-770034737). The original body of the issue is below._
The new feature with differencing_disk and skip_export in hashicorp/packer#5631 is awesome for saving space and time when building Hyper-V VHD(X).
It has one minor downside, it only produces differencing disks, so you'll need to manage at least two VHD(X) files to use the build result.
My suggestion is to add one step to the hyperv-iso builder that runs Convert-VHD after the virtual machine is shut down and the disk is compacted.
This feature should be configured with a option, e.g. "output_vhdtype", with the possible values Fixed, Dynamic and Default.
Default should skip this step so the current VHD(X) file is the final output from the builder.
Fixed and Dynamic should perform the Convert-VHD step with the configured value as the -VHDType parameter.
The converted VHD(X) file should replace the original VHD(X) file after the Convert-VHD command is completed, so existing templates and build processes can use the new feature without further changes.
Contributor guide
Assessment
This issue has not been assessed yet.