@@ -181,12 +181,6 @@ type ServerResourceSpec struct {
181181 // +optional
182182 Volumes []ServerVolumeSpec `json:"volumes,omitempty"`
183183
184- // serverGroupRef is a reference to a ServerGroup object. The server
185- // will be created in the server group.
186- // +optional
187- // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="serverGroupRef is immutable"
188- ServerGroupRef * KubernetesNameRef `json:"serverGroupRef,omitempty"`
189-
190184 // availabilityZone is the availability zone in which to create the server.
191185 // +kubebuilder:validation:MaxLength=255
192186 // +optional
@@ -217,6 +211,11 @@ type ServerResourceSpec struct {
217211 // +optional
218212 // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="configDrive is immutable"
219213 ConfigDrive * bool `json:"configDrive,omitempty"`
214+
215+ // schedulerHints provides hints to the Nova scheduler for server placement.
216+ // +optional
217+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="schedulerHints is immutable"
218+ SchedulerHints * ServerSchedulerHints `json:"schedulerHints,omitempty"`
220219}
221220
222221// ServerMetadata represents a key-value pair for server metadata.
@@ -234,8 +233,59 @@ type ServerMetadata struct {
234233 Value string `json:"value,omitempty"`
235234}
236235
237- // +kubebuilder:validation:MinProperties:=1
236+ // ServerSchedulerHints provides hints to the Nova scheduler for server placement.
237+ type ServerSchedulerHints struct {
238+ // serverGroupRef is a reference to a ServerGroup object. The server will be
239+ // scheduled on a host in the specified server group.
240+ // +optional
241+ ServerGroupRef * KubernetesNameRef `json:"serverGroupRef,omitempty"`
242+
243+ // differentHostServerRefs is a list of references to Server objects.
244+ // The server will be scheduled on a different host than all specified servers.
245+ // +listType=set
246+ // +kubebuilder:validation:MaxItems:=64
247+ // +optional
248+ DifferentHostServerRefs []KubernetesNameRef `json:"differentHostServerRefs,omitempty"`
249+
250+ // sameHostServerRefs is a list of references to Server objects.
251+ // The server will be scheduled on the same host as all specified servers.
252+ // +listType=set
253+ // +kubebuilder:validation:MaxItems:=64
254+ // +optional
255+ SameHostServerRefs []KubernetesNameRef `json:"sameHostServerRefs,omitempty"`
256+
257+ // query is a conditional statement that results in compute nodes
258+ // able to host the server.
259+ // +kubebuilder:validation:MaxLength:=1024
260+ // +optional
261+ Query string `json:"query,omitempty"`
262+
263+ // targetCell is a cell name where the server will be placed.
264+ // +kubebuilder:validation:MaxLength:=255
265+ // +optional
266+ TargetCell string `json:"targetCell,omitempty"`
267+
268+ // differentCell is a list of cell names where the server should not
269+ // be placed.
270+ // +listType=set
271+ // +kubebuilder:validation:MaxItems:=64
272+ // +kubebuilder:validation:items:MaxLength=1024
273+ // +optional
274+ DifferentCell []string `json:"differentCell,omitempty"`
275+
276+ // buildNearHostIP specifies a subnet of compute nodes to host the server.
277+ // The host IP should be provided in an CIDR format like 10.10.10.10/24.
278+ // +optional
279+ BuildNearHostIP * CIDR `json:"buildNearHostIP,omitempty"`
280+
281+ // additionalProperties is a map of arbitrary key/value pairs that are
282+ // not validated by Nova.
283+ // +optional
284+ AdditionalProperties map [string ]string `json:"additionalProperties,omitempty"`
285+ }
286+
238287// +kubebuilder:validation:MaxProperties:=1
288+ // +kubebuilder:validation:MinProperties:=1
239289type UserDataSpec struct {
240290 // secretRef is a reference to a Secret containing the user data for this server.
241291 // +optional
0 commit comments