-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add 'args' as optional configuration parameter when creating a VM #245
Conversation
I tested this by deploying a VM that includes the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rhpijnacker,
Thanks for the PR! I left a few comments which err more on the nitpick side of things than anything else, the code itself looks good to me.
To be sure, have you tested those changes locally? Does it work as you would expect? Nevermind this, I just saw your second message, all clear here, I don't think there's a lot of tests for this plugin already (might be good to have some eventually) so I would think we'll rely on good will and manual testing for now.
builder/proxmox/common/config.go
Outdated
@@ -97,6 +97,10 @@ type Config struct { | |||
// `debian-12;template`. | |||
Tags string `mapstructure:"tags"` | |||
|
|||
// Arbitrary arguments passed to KVM. For example | |||
// ` -no-reboot -smbios type=0,vendor=FOO`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, is the space in front of no-reboot
voluntary or is it a typo? If it is intended, I would suggest documenting it clearly so users aren't surprised in case they don't add one and it fails unexpectedly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no reason for that space. Removed it.
builder/proxmox/common/config.go
Outdated
// Arbitrary arguments passed to KVM. For example | ||
// ` -no-reboot -smbios type=0,vendor=FOO`. | ||
// Note: this option is for experts only. | ||
Args string `mapstructure:"args"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bit nitpicky on my part, but just for clarity, since this is for extra raw args, and since this is for advanced use-cases only, I would suggest making the name more explicit here, something along the lines of qemu_extra_args
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Renamed it to qemu_additional_args
(to stay consistent with e.g. additional_iso_files
).
Renamed the internal structure-property to AdditionalArgs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: Succesfully tested it manually with the new name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reroll @rhpijnacker!
This looks good to me, I'll merge this PR now.
FYI: CI was complaining that the generated code differed, I presume you had amended the docs and hcl2spec files manually? I've pushed the change on your branch, on top of your commits, so we can merge this now. |
To create macOS VMs in Proxmox, the
args
parameter needs to be set to pass some additional values to the underlying KVM. This PR adds support for setting this in the packer source.This builds on https://github.com/Telmate/proxmox-api-go/pull/117/files, which already makes it possible to pass
Args
in theConfigQemu
struct.Closes #243