@@ -45,6 +45,33 @@ const (
45
45
// to Image, the NutanixMachine will be created with the image mounted
46
46
// as a CD-ROM.
47
47
NutanixMachineBootstrapRefKindImage = "Image"
48
+
49
+ // NutanixMachineDiskModeStandard represents the standard disk mode.
50
+ NutanixMachineDiskModeStandard NutanixMachineDiskMode = "Standard"
51
+
52
+ // NutanixMachineDiskModeFlash represents the flash disk mode.
53
+ NutanixMachineDiskModeFlash NutanixMachineDiskMode = "Flash"
54
+
55
+ // NutanixMachineDiskDeviceTypeDisk represents the disk device type.
56
+ NutanixMachineDiskDeviceTypeDisk NutanixMachineDiskDeviceType = "Disk"
57
+
58
+ // NutanixMachineDiskDeviceTypeCDRom represents the CD-ROM device type.
59
+ NutanixMachineDiskDeviceTypeCDRom NutanixMachineDiskDeviceType = "CDRom"
60
+
61
+ // NutanixMachineDiskAdapterTypeSCSI represents the SCSI adapter type.
62
+ NutanixMachineDiskAdapterTypeSCSI NutanixMachineDiskAdapterType = "SCSI"
63
+
64
+ // NutanixMachineDiskAdapterTypeIDE represents the IDE adapter type.
65
+ NutanixMachineDiskAdapterTypeIDE NutanixMachineDiskAdapterType = "IDE"
66
+
67
+ // NutanixMachineDiskAdapterTypePCI represents the PCI adapter type.
68
+ NutanixMachineDiskAdapterTypePCI NutanixMachineDiskAdapterType = "PCI"
69
+
70
+ // NutanixMachineDiskAdapterTypeSATA represents the SATA adapter type.
71
+ NutanixMachineDiskAdapterTypeSATA NutanixMachineDiskAdapterType = "SATA"
72
+
73
+ // NutanixMachineDiskAdapterTypeSPAPR represents the SPAPR adapter type.
74
+ NutanixMachineDiskAdapterTypeSPAPR NutanixMachineDiskAdapterType = "SPAPR"
48
75
)
49
76
50
77
// NutanixImageLookup defines how to fetch images for the cluster
@@ -125,6 +152,11 @@ type NutanixMachineSpec struct {
125
152
// The minimum systemDiskSize is 20Gi bytes
126
153
// +kubebuilder:validation:Required
127
154
SystemDiskSize resource.Quantity `json:"systemDiskSize"`
155
+
156
+ // dataDisks hold the list of data disks to be attached to the VM
157
+ // +kubebuilder:validation:Optional
158
+ DataDisks []NutanixMachineVMDisk `json:"dataDisks,omitempty"`
159
+
128
160
// BootstrapRef is a reference to a bootstrap provider-specific resource
129
161
// that holds configuration details.
130
162
// +optional
@@ -134,6 +166,82 @@ type NutanixMachineSpec struct {
134
166
GPUs []NutanixGPU `json:"gpus,omitempty"`
135
167
}
136
168
169
+ // NutanixMachineVMDisk defines the disk configuration for a NutanixMachine
170
+ type NutanixMachineVMDisk struct {
171
+ // diskSize is the size (in Quantity format) of the disk attached to the VM.
172
+ // See https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Format for the Quantity format and example documentation.
173
+ // The minimum diskSize is 1GB.
174
+ // +kubebuilder:validation:Required
175
+ DiskSize resource.Quantity `json:"diskSize"`
176
+
177
+ // deviceProperties are the properties of the disk device.
178
+ // +optional
179
+ // +kubebuilder:validation:Optional
180
+ DeviceProperties * NutanixMachineVMDiskDeviceProperties `json:"deviceProperties,omitempty"`
181
+
182
+ // storageConfig are the storage configuration parameters of the VM disks.
183
+ // +optional
184
+ // +kubebuilder:validation:Optional
185
+ StorageConfig * NutanixMachineVMStorageConfig `json:"storageConfig,omitempty"`
186
+
187
+ // dataSource refers to a data source image for the VM disk.
188
+ // +optional
189
+ // +kubebuilder:validation:Optional
190
+ DataSource * NutanixResourceIdentifier `json:"dataSource,omitempty"`
191
+ }
192
+
193
+ // NutanixMachineVMDiskDeviceProperties defines the device properties for a NutanixMachineVMDisk
194
+ type NutanixMachineVMDiskDeviceProperties struct {
195
+ // deviceType specifies the disk device type.
196
+ // The valid values are "Disk" and "CDRom", and the default is "Disk".
197
+ // +kubebuilder:default=Disk
198
+ // +kubebuilder:validation:Required
199
+ DeviceType NutanixMachineDiskDeviceType `json:"deviceType"`
200
+
201
+ // adapterType is the adapter type of the disk address.
202
+ // If the deviceType is "Disk", the valid adapterType can be "SCSI", "IDE", "PCI", "SATA" or "SPAPR".
203
+ // If the deviceType is "CDRom", the valid adapterType can be "IDE" or "SATA".
204
+ // +kubebuilder:validation:Required
205
+ AdapterType NutanixMachineDiskAdapterType `json:"adapterType,omitempty"`
206
+
207
+ // deviceIndex is the index of the disk address. The valid values are non-negative integers, with the default value 0.
208
+ // For a Machine VM, the deviceIndex for the disks with the same deviceType.adapterType combination should
209
+ // start from 0 and increase consecutively afterwards. Note that for each Machine VM, the Disk.SCSI.0
210
+ // and CDRom.IDE.0 are reserved to be used by the VM's system. So for dataDisks of Disk.SCSI and CDRom.IDE,
211
+ // the deviceIndex should start from 1.
212
+ // +kubebuilder:default=0
213
+ // +kubebuilder:validation:Minimum=0
214
+ // +optional
215
+ // +kubebuilder:validation:Optional
216
+ DeviceIndex int32 `json:"deviceIndex,omitempty"`
217
+ }
218
+
219
+ // NutanixMachineVMStorageConfig defines the storage configuration for a NutanixMachineVMDisk
220
+ type NutanixMachineVMStorageConfig struct {
221
+ // diskMode specifies the disk mode.
222
+ // The valid values are Standard and Flash, and the default is Standard.
223
+ // +kubebuilder:default=Standard
224
+ // +kubebuilder:validation:Required
225
+ DiskMode NutanixMachineDiskMode `json:"diskMode"`
226
+
227
+ // storageContainer refers to the storage_container used by the VM disk.
228
+ // +optional
229
+ // +kubebuilder:validation:Optional
230
+ StorageContainer * NutanixResourceIdentifier `json:"storageContainer"`
231
+ }
232
+
233
+ // NutanixMachineDiskMode is an enumeration of different disk modes.
234
+ // +kubebuilder:validation:Enum=Standard;Flash
235
+ type NutanixMachineDiskMode string
236
+
237
+ // NutanixMachineDiskDeviceType is the VM disk device type.
238
+ // +kubebuilder:validation:Enum=Disk;CDRom
239
+ type NutanixMachineDiskDeviceType string
240
+
241
+ // NutanixMachineDiskAdapterType is an enumeration of different disk device adapter types.
242
+ // +kubebuilder:validation:Enum:=SCSI;IDE;PCI;SATA;SPAPR
243
+ type NutanixMachineDiskAdapterType string
244
+
137
245
// NutanixMachineStatus defines the observed state of NutanixMachine
138
246
type NutanixMachineStatus struct {
139
247
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
0 commit comments