-
Notifications
You must be signed in to change notification settings - Fork 115
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
builder: allow specifying hostId for placement #397
Conversation
Hi @amaxine thank you for the contribution. I've add this change to our board so we can work to prioritize the review. So far it looks good I just want to validate your question around exclusivity for other attributes to provide a quality review. |
Hi @amaxine, I've walked through the AWS docs, and AFAICT, they do not explicitely state that the two are mutually exclusive. That being said, since host groups are an abstraction over dedicated hosts, it would make sense that if the group ARN is set, the host ID should not be, and vice versa. I did not see anything that points to a valid use-case in specifying both, and I haven't tested what happens with for example In any case, I think it would make sense for both to be mutually exclusive, and for the plugin to return an error if both are specified at once. Come to think of it, I would think it'd make sense to also check for the Tenancy at the same time, for consistency with the arguments specified (i.e. it should be Let me know if you need help with that, I can take a look if need be. Besides that I second @nywilken, the code looks good to me, once we add the logic to check for mutual-exclusiveness, this can be merged imho. |
Thank you for the feedback and the pointers on how to implement mutually exclusive options, and thank you also for picking up the work to finish my PR. Unfortunately in the context of the BSL relicense I have no interest in completing this work, but as I've signed the CLA I'm happy to see the feature get completed. |
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 adding the addition checks. This looks good to me.
@amaxine Thanks for opening up this change. If it’s any consolation the plugins will remain as MPL2. But I completely understand. Don’t hesitate to reach out if you run into any issues with the plugin. 💙 |
This PR adds support for specifying an exact dedicated host ID in the placement block. We were originally running this when
mac2.metal
instances weren't publicly available and AWS API behaviour around them was weird enough that Packer couldn't see them in responses that didn't query a specific ID.This addresses a specific issue we experience - since by default, the source will grab whatever the first available host is, we occasionally find ourselves with the problem of Packer "stealing" from the wrong pool because for various lifecycle reasons, another host was available. With this change, an end user can instead provide a specific host ID (e.g. via a variable, from the response of an external call to the AWS API creating a new dedicated host resource), ensuring that the correct host is used for a Packer build for resources that aren't possible to fully manage on demand - ideal for Mac type instances in AWS.
This should potentially be exclusive with
HostResourceGroupArn
but I'm not sure how to appropriately model that in a Packer plugin, or whether it's at all necessary.