@@ -158,12 +158,6 @@ type ServerResourceSpec struct {
158158 // +optional
159159 Volumes []ServerVolumeSpec `json:"volumes,omitempty"`
160160
161- // serverGroupRef is a reference to a ServerGroup object. The server
162- // will be created in the server group.
163- // +optional
164- // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="serverGroupRef is immutable"
165- ServerGroupRef * KubernetesNameRef `json:"serverGroupRef,omitempty"`
166-
167161 // availabilityZone is the availability zone in which to create the server.
168162 // +kubebuilder:validation:MaxLength=255
169163 // +optional
@@ -194,6 +188,11 @@ type ServerResourceSpec struct {
194188 // +optional
195189 // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="configDrive is immutable"
196190 ConfigDrive * bool `json:"configDrive,omitempty"`
191+
192+ // schedulerHints provides hints to the Nova scheduler for server placement.
193+ // +optional
194+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="schedulerHints is immutable"
195+ SchedulerHints * ServerSchedulerHints `json:"schedulerHints,omitempty"`
197196}
198197
199198// ServerMetadata represents a key-value pair for server metadata.
@@ -211,8 +210,60 @@ type ServerMetadata struct {
211210 Value string `json:"value,omitempty"`
212211}
213212
214- // +kubebuilder:validation:MinProperties:=1
213+ // ServerSchedulerHints provides hints to the Nova scheduler for server placement.
214+ type ServerSchedulerHints struct {
215+ // serverGroupRef is a reference to a ServerGroup object. The server will be
216+ // scheduled on a host in the specified server group.
217+ // +optional
218+ ServerGroupRef * KubernetesNameRef `json:"serverGroupRef,omitempty"`
219+
220+ // differentHostServerRefs is a list of references to Server objects.
221+ // The server will be scheduled on a different host than all specified servers.
222+ // +listType=set
223+ // +kubebuilder:validation:MaxItems:=64
224+ // +optional
225+ DifferentHostServerRefs []KubernetesNameRef `json:"differentHostServerRefs,omitempty"`
226+
227+ // sameHostServerRefs is a list of references to Server objects.
228+ // The server will be scheduled on the same host as all specified servers.
229+ // +listType=set
230+ // +kubebuilder:validation:MaxItems:=64
231+ // +optional
232+ SameHostServerRefs []KubernetesNameRef `json:"sameHostServerRefs,omitempty"`
233+
234+ // query is a conditional statement that results in compute nodes
235+ // able to host the server.
236+ // +kubebuilder:validation:MaxLength:=1024
237+ // +optional
238+ Query string `json:"query,omitempty"`
239+
240+ // targetCell is a cell name where the server will be placed.
241+ // +kubebuilder:validation:MaxLength:=255
242+ // +optional
243+ TargetCell string `json:"targetCell,omitempty"`
244+
245+ // differentCell is a list of cell names where the server should not
246+ // be placed.
247+ // +listType=set
248+ // +kubebuilder:validation:MaxItems:=64
249+ // +kubebuilder:validation:items:MaxLength=1024
250+ // +optional
251+ DifferentCell []string `json:"differentCell,omitempty"`
252+
253+ // buildNearHostIP specifies a subnet of compute nodes to host the server.
254+ // this should be provided in an ip/cider format like 10.10.10.10/24.
255+ // +kubebuilder:validation:MaxLength:=255
256+ // +optional
257+ BuildNearHostIP string `json:"buildNearHostIP,omitempty"`
258+
259+ // additionalProperties is a map of arbitrary key/value pairs that are
260+ // not validated by Nova.
261+ // +optional
262+ AdditionalProperties map [string ]string `json:"additionalProperties,omitempty"`
263+ }
264+
215265// +kubebuilder:validation:MaxProperties:=1
266+ // +kubebuilder:validation:MinProperties:=1
216267type UserDataSpec struct {
217268 // secretRef is a reference to a Secret containing the user data for this server.
218269 // +optional
0 commit comments