test-kitchen / kitchen-ec2

A Test Kitchen Driver for Amazon EC2
Other
221 stars 202 forks source link

Support for dedicated hosts #590

Closed thheinen closed 1 year ago

thheinen commented 2 years ago

:frowning_person: Problem Statement

Some organizations, licenses, or AMIs require the use of dedicated hosts, e.g. MSDN licenses.

Currently, the kitchen-ec2 driver does not include any functionality to allocate/deallocate hosts. You can use the tenancy: host setting, but that relies on pre-deployed dedicated hosts.

:grey_question: Possible Solution

Add this functionality to the kitchen driver, allocating a host for the specified instance_type and deallocating it after it is empty. As dedicated hosts are billed by the second, this is no different than billing for on-demand instances.

In some situations, a dedicated host might be pre-allocated (organization-provided) or need a specific time until being de-allocated (24 hours) - so both features should be made optional. That could be an additional config option or a corresponding environment variable.

:arrow_heading_up: Describe alternatives you've considered

:heavy_plus_sign: Additional context

This feature is a prerequisite for adding support for Mac instances as well.

thheinen commented 2 years ago

Full disclosure: I have an implementation for this basically done (need some cleanup).

thheinen commented 1 year ago

Released in v3.14.0