@@ -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,28 @@ 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}$`
244+ // +kubebuilder:validation:MaxLength=19
238245 // +optional
239246 HostID * string `json:"hostID,omitempty"`
240247
241248 // 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.
249+ // When HostAffinity is set to host, an instance started onto a specific host always restarts on the same host if stopped.
250+ // When HostAffinity is set to default, and you stop and restart the instance, it can be restarted on any available host.
244251 // When HostAffinity is defined, HostID is required.
245252 // +optional
246253 // +kubebuilder:validation:Enum:=default;host
254+ // +kubebuilder:default=host
247255 HostAffinity * string `json:"hostAffinity,omitempty"`
248256
257+ // DynamicHostAllocation enables automatic allocation of a single dedicated host.
258+ // This field is mutually exclusive with HostID and always allocates exactly one host.
259+ // Cost effectiveness of allocating a single instance on a dedicated host may vary
260+ // depending on the instance type and the region.
261+ // +optional
262+ DynamicHostAllocation * DynamicHostAllocationSpec `json:"dynamicHostAllocation,omitempty"`
263+
249264 // CapacityReservationPreference specifies the preference for use of Capacity Reservations by the instance. Valid values include:
250265 // "Open": The instance may make use of open Capacity Reservations that match its AZ and InstanceType
251266 // "None": The instance may not make use of any Capacity Reservations. This is to conserve open reservations for desired workloads
@@ -255,6 +270,14 @@ type AWSMachineSpec struct {
255270 CapacityReservationPreference CapacityReservationPreference `json:"capacityReservationPreference,omitempty"`
256271}
257272
273+ // DynamicHostAllocationSpec defines the configuration for dynamic dedicated host allocation.
274+ // This specification always allocates exactly one dedicated host per machine.
275+ type DynamicHostAllocationSpec struct {
276+ // Tags to apply to the allocated dedicated host.
277+ // +optional
278+ Tags map [string ]string `json:"tags,omitempty"`
279+ }
280+
258281// CloudInit defines options related to the bootstrapping systems where
259282// CloudInit is used.
260283type CloudInit struct {
@@ -432,6 +455,23 @@ type AWSMachineStatus struct {
432455 // Conditions defines current service state of the AWSMachine.
433456 // +optional
434457 Conditions clusterv1.Conditions `json:"conditions,omitempty"`
458+
459+ // DedicatedHostID tracks the dynamically allocated dedicated host ID.
460+ // This field is populated when DynamicHostAllocation is used.
461+ // +optional
462+ DedicatedHostID * string `json:"dedicatedHostID,omitempty"`
463+
464+ // HostReleaseAttempts tracks the number of attempts to release the dedicated host.
465+ // +optional
466+ HostReleaseAttempts * int32 `json:"hostReleaseAttempts,omitempty"`
467+
468+ // LastHostReleaseAttempt tracks the timestamp of the last attempt to release the dedicated host.
469+ // +optional
470+ LastHostReleaseAttempt * metav1.Time `json:"lastHostReleaseAttempt,omitempty"`
471+
472+ // HostReleaseFailedReason tracks the reason for the last host release failure.
473+ // +optional
474+ HostReleaseFailedReason * string `json:"hostReleaseFailedReason,omitempty"`
435475}
436476
437477// +kubebuilder:object:root=true
0 commit comments