@@ -118,7 +118,17 @@ type IonosCloudMachineSpec struct {
118118 //+kubebuilder:validation:Format=uuid
119119 DatacenterID string `json:"datacenterID"`
120120
121+ // TemplateID is The ID of the template for creating CUBE or GPU servers.
122+ // If a template has GPU cards assigned, then it can only be used to create GPU servers,
123+ // otherwise it can only be used for CUBE servers.
124+ // NumCores, MemoryMB, CPUFamily and the size parameter of the first volume (boot Disk) are ignored when this is set.
125+ // Available TemplateIDs can be listed using the cloud api.
126+ //+kubebuilder:validation:Format=uuid
127+ //+optional
128+ TemplateID string `json:"templateID,omitempty"`
129+
121130 // NumCores defines the number of cores for the VM.
131+ // Ignored when TemplateID is specified.
122132 //+kubebuilder:validation:Minimum=1
123133 //+kubebuilder:default=1
124134 //+optional
@@ -133,6 +143,7 @@ type IonosCloudMachineSpec struct {
133143 // MemoryMB is the memory size for the VM in MB.
134144 // Size must be specified in multiples of 256 MB with a minimum of 1024 MB
135145 // which is required as we are using hot-pluggable RAM by default.
146+ // Ignored when TemplateID is specified.
136147 //+kubebuilder:validation:MultipleOf=1024
137148 //+kubebuilder:validation:Minimum=2048
138149 //+kubebuilder:default=3072
@@ -144,6 +155,7 @@ type IonosCloudMachineSpec struct {
144155 //
145156 // If not specified, the cloud will select a suitable CPU family
146157 // based on the availability in the data center.
158+ // Ignored when TemplateID is specified.
147159 //+kubebuilder:example=AMD_OPTERON
148160 //+optional
149161 CPUFamily * string `json:"cpuFamily,omitempty"`
@@ -180,9 +192,10 @@ type IonosCloudMachineSpec struct {
180192 // +kubebuilder:validation:MinLength=1
181193 NetworkID * string `json:"networkID,omitempty"`
182194
183- // Type is the server type of the VM. Can be either ENTERPRISE or VCPU.
195+ // Type is the server type of the VM. Can be either ENTERPRISE, VCPU, CUBE or GPU.
196+ // Use the types CUBE or GPU together with TemplateID.
184197 //+kubebuilder:validation:XValidation:rule="self == oldSelf",message="type is immutable"
185- //+kubebuilder:validation:Enum=ENTERPRISE;VCPU
198+ //+kubebuilder:validation:Enum=ENTERPRISE;VCPU;CUBE;GPU
186199 //+kubebuilder:default=ENTERPRISE
187200 //+optional
188201 Type ServerType `json:"type,omitempty"`
@@ -221,7 +234,8 @@ type Volume struct {
221234 //+optional
222235 DiskType VolumeDiskType `json:"diskType,omitempty"`
223236
224- // SizeGB defines the size of the volume in GB
237+ // SizeGB defines the size of the volume in GB.
238+ // Ignored when TemplateID of IonosCloudMachineSpec is specified (for the boot volume).
225239 //+kubebuilder:validation:Minimum=10
226240 //+kubebuilder:default=20
227241 //+optional
0 commit comments