@@ -13,6 +13,9 @@ type NutanixIdentifierType string
1313// NutanixGPUIdentifierType is an enumeration of different GPU identifier types.
1414type NutanixGPUIdentifierType string
1515
16+ // NutanixBootType is an enumeration of different boot types.
17+ type NutanixBootType string
18+
1619func (c NutanixIdentifierType ) String () string {
1720 return string (c )
1821}
@@ -35,6 +38,12 @@ const (
3538 // NutanixGPUIdentifierName is a GPU identifier identifying the object by Name.
3639 NutanixGPUIdentifierName NutanixGPUIdentifierType = "name"
3740
41+ // NutanixBootTypeLegacy is a resource identifier identifying the legacy boot type for virtual machines.
42+ NutanixBootTypeLegacy NutanixBootType = "legacy"
43+
44+ // NutanixBootTypeUEFI is a resource identifier identifying the UEFI boot type for virtual machines.
45+ NutanixBootTypeUEFI NutanixBootType = "uefi"
46+
3847 defaultNutanixOSFamily = Ubuntu
3948 defaultNutanixSystemDiskSizeGi = "40Gi"
4049 defaultNutanixMemorySizeGi = "4Gi"
@@ -123,6 +132,7 @@ func NewNutanixMachineConfigGenerate(name string, opts ...NutanixMachineConfigGe
123132 Cluster : NutanixResourceIdentifier {Type : NutanixIdentifierName , Name : func () * string { s := fmt .Sprintf (enterNameString , "Prism Element cluster" ); return & s }()},
124133 Subnet : NutanixResourceIdentifier {Type : NutanixIdentifierName , Name : func () * string { s := fmt .Sprintf (enterNameString , "subnet" ); return & s }()},
125134 SystemDiskSize : resource .MustParse (defaultNutanixSystemDiskSizeGi ),
135+ BootType : NutanixBootTypeLegacy ,
126136 },
127137 }
128138
@@ -190,6 +200,10 @@ func validateNutanixMachineConfig(c *NutanixMachineConfig) error {
190200 )
191201 }
192202
203+ if c .Spec .BootType != "" && c .Spec .BootType != NutanixBootTypeLegacy && c .Spec .BootType != NutanixBootTypeUEFI {
204+ return fmt .Errorf ("NutanixMachineConfig: unsupported boot type (%v); Please use one of the following: %s, %s" , c .Spec .BootType , NutanixBootTypeLegacy , NutanixBootTypeUEFI )
205+ }
206+
193207 if err := validateMachineConfigUsers (c .Name , NutanixMachineConfigKind , c .Spec .Users ); err != nil {
194208 return err
195209 }
0 commit comments