Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hyper-V] Add optional step to the hyperv-iso builder to run Convert-VHD when using differencing_disk and skip_export #15

Open
ghost opened this issue Apr 21, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 21, 2021

This issue was originally opened by @ebjornset as hashicorp/packer#5813. It was migrated here as a result of the Packer plugin split. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants