Allow specifying --variant on the clonehd command!
Would love to see an option to pass in additional options on clonehd... specifically looking for a --variant Fixed, but opening it up to allow any additional options would be awesome!
Failing that, any instructions for compiling this so I can put the change together myself?
Would love to see an option to pass in additional options on clonehd... specifically looking for a --variant Fixed, but opening it up to allow any additional options would be awesome!
Good suggestion. The VBoxManage command is hard-coded for now:
https://github.com/benwebber/packer-post-processor-vhd/blob/a3b8ea558acd39b9bb2ec971b0fa3f2441fbc02b/vhd/virtualbox.go#L77-L82
It should be possible to make that configurable, and use Go template strings to represent the path to VMDK and output path. Something like this:
{
"post-processors": [
{
"type": "vhd",
"only": ["virtualbox-iso"],
"vboxmanage_command": ["clonehd", "--format", "VHD", "--variant", "Fixed", "{{ vmdkPath }}", "{{ outputPath }}"]
}
]
}
I'm afraid I won't be able to implement that change, or something like it, for a little while.
Failing that, any instructions for compiling this so I can put the change together myself?
Yep, it's very easy:
- Install Go
- Clone this repo
- Add new arguments to the command above
- Run
make dist.
This project is basically complete, so I haven't touched it in a while. You might get some compilation errors. Happy to help you work through them.
Since I had a hard requirement for fixed size (when using VHD's), I grabbed the source, and was able to recompile with the hardcoded change in there. Just added an extra line into packer-post-process-vhd/vhd/virtualbox.go! Thanks for the suggestion, and the project!