@@ -213,6 +213,10 @@ type AWSMachineSpec struct {
213213 PlacementGroupPartition int64 `json:"placementGroupPartition,omitempty"`
214214
215215 // Tenancy indicates if instance should run on shared or single-tenant hardware.
216+ // When Tenancy=host, AWS will attempt to find a suitable host from:
217+ // - Preexisting allocated hosts that have auto-placement enabled
218+ // - A specific host ID, if configured
219+ // - Allocating a new dedicated host if DynamicHostAllocation is configured
216220 // +optional
217221 // +kubebuilder:validation:Enum:=default;dedicated;host
218222 Tenancy string `json:"tenancy,omitempty"`
@@ -235,17 +239,27 @@ type AWSMachineSpec struct {
235239 MarketType MarketType `json:"marketType,omitempty"`
236240
237241 // HostID specifies the Dedicated Host on which the instance must be started.
242+ // This field is mutually exclusive with DynamicHostAllocation.
243+ // +kubebuilder:validation:Pattern=`^h-[0-9a-f]{17}$`
238244 // +optional
239245 HostID * string `json:"hostID,omitempty"`
240246
241247 // HostAffinity specifies the dedicated host affinity setting for the instance.
242- // When hostAffinity is set to host, an instance started onto a specific host always restarts on the same host if stopped.
243- // When hostAffinity is set to default, and you stop and restart the instance, it can be restarted on any available host.
248+ // When HostAffinity is set to host, an instance started onto a specific host always restarts on the same host if stopped.
249+ // When HostAffinity is set to default, and you stop and restart the instance, it can be restarted on any available host.
244250 // When HostAffinity is defined, HostID is required.
245251 // +optional
246252 // +kubebuilder:validation:Enum:=default;host
253+ // +kubebuilder:default=default
247254 HostAffinity * string `json:"hostAffinity,omitempty"`
248255
256+ // DynamicHostAllocation enables automatic allocation of a single dedicated host.
257+ // This field is mutually exclusive with HostID and always allocates exactly one host.
258+ // Cost effectiveness of allocating a single instance on a dedicated host may vary
259+ // depending on the instance type and the region.
260+ // +optional
261+ DynamicHostAllocation * DynamicHostAllocationSpec `json:"dynamicHostAllocation,omitempty"`
262+
249263 // CapacityReservationPreference specifies the preference for use of Capacity Reservations by the instance. Valid values include:
250264 // "Open": The instance may make use of open Capacity Reservations that match its AZ and InstanceType
251265 // "None": The instance may not make use of any Capacity Reservations. This is to conserve open reservations for desired workloads
@@ -255,6 +269,14 @@ type AWSMachineSpec struct {
255269 CapacityReservationPreference CapacityReservationPreference `json:"capacityReservationPreference,omitempty"`
256270}
257271
272+ // DynamicHostAllocationSpec defines the configuration for dynamic dedicated host allocation.
273+ // This specification always allocates exactly one dedicated host per machine.
274+ type DynamicHostAllocationSpec struct {
275+ // Tags to apply to the allocated dedicated host.
276+ // +optional
277+ Tags map [string ]string `json:"tags,omitempty"`
278+ }
279+
258280// CloudInit defines options related to the bootstrapping systems where
259281// CloudInit is used.
260282type CloudInit struct {
@@ -432,6 +454,23 @@ type AWSMachineStatus struct {
432454 // Conditions defines current service state of the AWSMachine.
433455 // +optional
434456 Conditions clusterv1.Conditions `json:"conditions,omitempty"`
457+
458+ // DedicatedHostID tracks the dynamically allocated dedicated host ID.
459+ // This field is populated when DynamicHostAllocation is used.
460+ // +optional
461+ DedicatedHostID * string `json:"dedicatedHostID,omitempty"`
462+
463+ // HostReleaseAttempts tracks the number of attempts to release the dedicated host.
464+ // +optional
465+ HostReleaseAttempts * int32 `json:"hostReleaseAttempts,omitempty"`
466+
467+ // LastHostReleaseAttempt tracks the timestamp of the last attempt to release the dedicated host.
468+ // +optional
469+ LastHostReleaseAttempt * metav1.Time `json:"lastHostReleaseAttempt,omitempty"`
470+
471+ // HostReleaseFailedReason tracks the reason for the last host release failure.
472+ // +optional
473+ HostReleaseFailedReason * string `json:"hostReleaseFailedReason,omitempty"`
435474}
436475
437476// +kubebuilder:object:root=true
0 commit comments