diff --git a/api/v1beta1/ocimachine_types.go b/api/v1beta1/ocimachine_types.go index 86905164..e714bf15 100644 --- a/api/v1beta1/ocimachine_types.go +++ b/api/v1beta1/ocimachine_types.go @@ -48,12 +48,44 @@ type OCIMachineSpec struct { // Shape of the instance. Shape string `json:"shape,omitempty"` + IpxeScript *string `json:"ipxeScript,omitempty"` + + // CapacityReservationId defines the OCID of the compute capacity reservation this instance is launched under. + // You can opt out of all default reservations by specifying an empty string as input for this field. + // For more information, see Capacity Reservations (https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/reserve-capacity.htm#default). + CapacityReservationId *string `json:"capacityReservationId,omitempty"` + // The shape configuration of rhe instance, applicable for flex instances. ShapeConfig ShapeConfig `json:"shapeConfig,omitempty"` - // PrimaryNetworkInterface is required to specify subnet. + // NetworkDetails defines the configuration options for the network NetworkDetails NetworkDetails `json:"networkDetails,omitempty"` + // LaunchOptions defines the options for tuning the compatibility and performance of VM shapes + LaunchOptions *LaunchOptions `json:"launchOptions,omitempty"` + + // InstanceOptions defines the instance options + InstanceOptions *InstanceOptions `json:"instanceOptions,omitempty"` + + // LaunchInstanceAvailabilityConfig defines the options for VM migration during infrastructure maintenance events and for defining + // the availability of a VM instance after a maintenance event that impacts the underlying hardware. + AvailabilityConfig *LaunchInstanceAvailabilityConfig `json:"availabilityConfig,omitempty"` + + // PreemptibleInstanceConfig Configuration options for preemptible instances. + PreemptibleInstanceConfig *PreemptibleInstanceConfig `json:"preemptibleInstanceConfig,omitempty"` + + // LaunchInstanceAgentConfig defines the options for the Oracle Cloud Agent software running on the instance. + AgentConfig *LaunchInstanceAgentConfig `json:"agentConfig,omitempty"` + + // InstanceSourceViaImageConfig defines the options for booting up instances via images + InstanceSourceViaImageDetails *InstanceSourceViaImageConfig `json:"instanceSourceViaImageConfig,omitempty"` + + // InstanceSourceViaImageConfig defines the platform config parameters + PlatformConfig *PlatformConfig `json:"platformConfig,omitempty"` + + // DedicatedVmHostId defines the OCID of the dedicated VM host. + DedicatedVmHostId *string `json:"dedicatedVmHostId,omitempty"` + // Provider ID of the instance, this will be set by Cluster API provider itself, // users should not set this parameter. // +optional @@ -92,6 +124,7 @@ type OCIMachineSpec struct { // defined in the OCICluster Spec. Optional, only if multiple NSGs of a type // is defined, else the first element is used. // +optional + // Deprecated, please use NetworkDetails.NSGNames NSGName string `json:"nsgName,omitempty"` } diff --git a/api/v1beta1/types.go b/api/v1beta1/types.go index bb22290d..84973a7b 100644 --- a/api/v1beta1/types.go +++ b/api/v1beta1/types.go @@ -34,10 +34,529 @@ var OCIManagedClusterSubnetRoles = []Role{PodRole, ControlPlaneEndpointRole, Wor // NetworkDetails defines the configuration options for the network type NetworkDetails struct { - SubnetId *string `json:"subnetId,omitempty"` - AssignPublicIp bool `json:"assignPublicIp,omitempty"` - SubnetName string `json:"subnetName,omitempty"` - NSGId *string `json:"nsgId,omitempty"` + // SubnetId defines the ID of the subnet to use. + // Deprecated, use SubnetName parameter + SubnetId *string `json:"subnetId,omitempty"` + + // AssignPublicIp defines whether the instance should have a public IP address + AssignPublicIp bool `json:"assignPublicIp,omitempty"` + + // SubnetName defines the subnet name to use for the VNIC + SubnetName string `json:"subnetName,omitempty"` + + // Deprecated, use NsgNames parameter to define the NSGs + NSGId *string `json:"nsgId,omitempty"` + + // SkipSourceDestCheck defines whether the source/destination check is disabled on the VNIC. + SkipSourceDestCheck *bool `json:"skipSourceDestCheck,omitempty"` + + // NsgNames defines a list of the nsg names of the network security groups (NSGs) to add the VNIC to. + NsgNames []string `json:"nsgNames,omitempty"` + + // HostnameLabel defines the hostname for the VNIC's primary private IP. Used for DNS. + HostnameLabel *string `json:"hostnameLabel,omitempty"` + + // DisplayName defines a user-friendly name. Does not have to be unique, and it's changeable. + // Avoid entering confidential information. + DisplayName *string `json:"displayName,omitempty"` + + // AssignPrivateDnsRecord defines whether the VNIC should be assigned a DNS record. + AssignPrivateDnsRecord *bool `json:"assignPrivateDnsRecord,omitempty"` +} + +// LaunchOptionsBootVolumeTypeEnum Enum with underlying type: string +type LaunchOptionsBootVolumeTypeEnum string + +// Set of constants representing the allowable values for LaunchOptionsBootVolumeTypeEnum +const ( + LaunchOptionsBootVolumeTypeIscsi LaunchOptionsBootVolumeTypeEnum = "ISCSI" + LaunchOptionsBootVolumeTypeScsi LaunchOptionsBootVolumeTypeEnum = "SCSI" + LaunchOptionsBootVolumeTypeIde LaunchOptionsBootVolumeTypeEnum = "IDE" + LaunchOptionsBootVolumeTypeVfio LaunchOptionsBootVolumeTypeEnum = "VFIO" + LaunchOptionsBootVolumeTypeParavirtualized LaunchOptionsBootVolumeTypeEnum = "PARAVIRTUALIZED" +) + +// LaunchOptionsFirmwareEnum Enum with underlying type: string +type LaunchOptionsFirmwareEnum string + +// Set of constants representing the allowable values for LaunchOptionsFirmwareEnum +const ( + LaunchOptionsFirmwareBios LaunchOptionsFirmwareEnum = "BIOS" + LaunchOptionsFirmwareUefi64 LaunchOptionsFirmwareEnum = "UEFI_64" +) + +// LaunchOptionsNetworkTypeEnum Enum with underlying type: string +type LaunchOptionsNetworkTypeEnum string + +// Set of constants representing the allowable values for LaunchOptionsNetworkTypeEnum +const ( + LaunchOptionsNetworkTypeE1000 LaunchOptionsNetworkTypeEnum = "E1000" + LaunchOptionsNetworkTypeVfio LaunchOptionsNetworkTypeEnum = "VFIO" + LaunchOptionsNetworkTypeParavirtualized LaunchOptionsNetworkTypeEnum = "PARAVIRTUALIZED" +) + +// LaunchOptionsRemoteDataVolumeTypeEnum Enum with underlying type: string +type LaunchOptionsRemoteDataVolumeTypeEnum string + +// Set of constants representing the allowable values for LaunchOptionsRemoteDataVolumeTypeEnum +const ( + LaunchOptionsRemoteDataVolumeTypeIscsi LaunchOptionsRemoteDataVolumeTypeEnum = "ISCSI" + LaunchOptionsRemoteDataVolumeTypeScsi LaunchOptionsRemoteDataVolumeTypeEnum = "SCSI" + LaunchOptionsRemoteDataVolumeTypeIde LaunchOptionsRemoteDataVolumeTypeEnum = "IDE" + LaunchOptionsRemoteDataVolumeTypeVfio LaunchOptionsRemoteDataVolumeTypeEnum = "VFIO" + LaunchOptionsRemoteDataVolumeTypeParavirtualized LaunchOptionsRemoteDataVolumeTypeEnum = "PARAVIRTUALIZED" +) + +// LaunchOptions Options for tuning the compatibility and performance of VM shapes. The values that you specify override any +// default values. +type LaunchOptions struct { + + // BootVolumeType defines Emulation type for the boot volume. + // * `ISCSI` - ISCSI attached block storage device. + // * `SCSI` - Emulated SCSI disk. + // * `IDE` - Emulated IDE disk. + // * `VFIO` - Direct attached Virtual Function storage. This is the default option for local data + // volumes on platform images. + // * `PARAVIRTUALIZED` - Paravirtualized disk. This is the default for boot volumes and remote block + // storage volumes on platform images. + BootVolumeType LaunchOptionsBootVolumeTypeEnum `json:"bootVolumeType,omitempty"` + + // Firmware defines the firmware used to boot VM. Select the option that matches your operating system. + // * `BIOS` - Boot VM using BIOS style firmware. This is compatible with both 32 bit and 64 bit operating + // systems that boot using MBR style bootloaders. + // * `UEFI_64` - Boot VM using UEFI style firmware compatible with 64 bit operating systems. This is the + // default for platform images. + Firmware LaunchOptionsFirmwareEnum `json:"firmware,omitempty"` + + // NetworkType defines the emulation type for the physical network interface card (NIC). + // * `E1000` - Emulated Gigabit ethernet controller. Compatible with Linux e1000 network driver. + // * `VFIO` - Direct attached Virtual Function network controller. This is the networking type + // when you launch an instance using hardware-assisted (SR-IOV) networking. + // * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using VirtIO drivers. + NetworkType LaunchOptionsNetworkTypeEnum `json:"networkType,omitempty"` + + // RemoteDataVolumeType defines the emulation type for volume. + // * `ISCSI` - ISCSI attached block storage device. + // * `SCSI` - Emulated SCSI disk. + // * `IDE` - Emulated IDE disk. + // * `VFIO` - Direct attached Virtual Function storage. This is the default option for local data + // volumes on platform images. + // * `PARAVIRTUALIZED` - Paravirtualized disk. This is the default for boot volumes and remote block + // storage volumes on platform images. + RemoteDataVolumeType LaunchOptionsRemoteDataVolumeTypeEnum `json:"remoteDataVolumeType,omitempty"` + + // IsConsistentVolumeNamingEnabled defines whether to enable consistent volume naming feature. Defaults to false. + IsConsistentVolumeNamingEnabled *bool `json:"isConsistentVolumeNamingEnabled,omitempty"` +} + +// InstanceSourceViaImageConfig The configuration options for booting up instances via images +type InstanceSourceViaImageConfig struct { + // KmsKeyId defines the OCID of the Key Management key to assign as the master encryption key for the boot volume. + KmsKeyId *string `json:"kmsKeyId,omitempty"` + + // BootVolumeVpusPerGB defines the number of volume performance units (VPUs) that will be applied to this volume per GB, + // representing the Block Volume service's elastic performance options. + // See Block Volume Performance Levels (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/blockvolumeperformance.htm#perf_levels) for more information. + // Allowed values: + // * `10`: Represents Balanced option. + // * `20`: Represents Higher Performance option. + // * `30`-`120`: Represents the Ultra High Performance option. + // For volumes with the auto-tuned performance feature enabled, this is set to the default (minimum) VPUs/GB. + BootVolumeVpusPerGB *int64 `json:"bootVolumeVpusPerGB,omitempty"` +} + +// LaunchInstanceAvailabilityConfigDetailsRecoveryActionEnum Enum with underlying type: string +type PlatformConfigTypeEnum string + +// Set of constants representing the allowable values for LaunchInstanceAvailabilityConfigDetailsRecoveryActionEnum +const ( + PlatformConfigTypeAmdRomeBmGpu PlatformConfigTypeEnum = "AMD_ROME_BM_GPU" + PlatformConfigTypeAmdRomeBm PlatformConfigTypeEnum = "AMD_ROME_BM" + PlatformConfigTypeIntelIcelakeBm PlatformConfigTypeEnum = "INTEL_ICELAKE_BM" + PlatformConfigTypeAmdvm PlatformConfigTypeEnum = "AMD_VM" + PlatformConfigTypeIntelVm PlatformConfigTypeEnum = "INTEL_VM" + PlatformConfigTypeIntelSkylakeBm PlatformConfigTypeEnum = "INTEL_SKYLAKE_BM" + PlatformConfigTypeAmdMilanBm PlatformConfigTypeEnum = "AMD_MILAN_BM" +) + +// PlatformConfig defines the platform config parameters +type PlatformConfig struct { + // The type of platform configuration. Valid values are + // * `AMD_ROME_BM_GPU` + // * `AMD_ROME_BM` + // * `INTEL_ICELAKE_BM` + // * `AMD_VM` + // * `INTEL_VM` + // * `INTEL_SKYLAKE_BM` + // * `AMD_MILAN_BM` + // Based on the enum, exactly one of the specific configuration types must be set + PlatformConfigType PlatformConfigTypeEnum `json:"PlatformConfigType,omitempty"` + + // AmdMilanBmPlatformConfig describe AMD Milan BM platform configuration + AmdMilanBmPlatformConfig AmdMilanBmPlatformConfig `json:"amdMilanBmPlatformConfig,omitempty"` + + // AmdMilanBmPlatformConfig describe AMD Rome BM platform configuration + AmdRomeBmPlatformConfig AmdRomeBmPlatformConfig `json:"amdRomeBmPlatformConfig,omitempty"` + + // AmdMilanBmPlatformConfig describe Intel Skylke BM platform configuration + IntelSkylakeBmPlatformConfig IntelSkylakeBmPlatformConfig `json:"intelSkylakeBmPlatformConfig,omitempty"` + + // AmdMilanBmPlatformConfig describe Intel Skylke BM platform configuration + IntelIcelakeBmPlatformConfig IntelIcelakeBmPlatformConfig `json:"intelIcelakeBmPlatformConfig,omitempty"` + + // AmdMilanBmPlatformConfig describe AMD Rome BM platform configuration + AmdRomeBmGpuPlatformConfig AmdRomeBmGpuPlatformConfig `json:"amdRomeBmGpuPlatformConfig,omitempty"` + + // AmdMilanBmPlatformConfig describe Intel VM platform configuration + IntelVmPlatformConfig IntelVmPlatformConfig `json:"intelVmPlatformConfig,omitempty"` + + // AmdMilanBmPlatformConfig describe AMD VM platform configuration + AmdVmPlatformConfig AmdVmPlatformConfig `json:"amdVmPlatformConfig,omitempty"` +} + +// AmdMilanBmPlatformConfigNumaNodesPerSocketEnum Enum with underlying type: string +type AmdMilanBmPlatformConfigNumaNodesPerSocketEnum string + +// Set of constants representing the allowable values for AmdMilanBmPlatformConfigNumaNodesPerSocketEnum +const ( + AmdMilanBmPlatformConfigNumaNodesPerSocketNps0 AmdMilanBmPlatformConfigNumaNodesPerSocketEnum = "NPS0" + AmdMilanBmPlatformConfigNumaNodesPerSocketNps1 AmdMilanBmPlatformConfigNumaNodesPerSocketEnum = "NPS1" + AmdMilanBmPlatformConfigNumaNodesPerSocketNps2 AmdMilanBmPlatformConfigNumaNodesPerSocketEnum = "NPS2" + AmdMilanBmPlatformConfigNumaNodesPerSocketNps4 AmdMilanBmPlatformConfigNumaNodesPerSocketEnum = "NPS4" +) + +// AmdMilanBmPlatformConfig The platform configuration used when launching a bare metal instance with one of the following shapes: BM.Standard.E4.128 +// or BM.DenseIO.E4.128 (the AMD Milan platform). +type AmdMilanBmPlatformConfig struct { + // Whether Secure Boot is enabled on the instance. + IsSecureBootEnabled *bool `json:"isSecureBootEnabled,omitempty"` + + // Whether the Trusted Platform Module (TPM) is enabled on the instance. + IsTrustedPlatformModuleEnabled *bool `json:"isTrustedPlatformModuleEnabled,omitempty"` + + // Whether the Measured Boot feature is enabled on the instance. + IsMeasuredBootEnabled *bool `json:"isMeasuredBootEnabled,omitempty"` + + // Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + // called simultaneous multithreading (SMT) or Intel Hyper-Threading. + // Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + // independent threads of execution, to better use the resources and increase the efficiency + // of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + // can provide higher or more predictable performance for some workloads. + IsSymmetricMultiThreadingEnabled *bool `json:"isSymmetricMultiThreadingEnabled,omitempty"` + + // Whether the Access Control Service is enabled on the instance. When enabled, + // the platform can enforce PCIe device isolation, required for VFIO device pass-through. + IsAccessControlServiceEnabled *bool `json:"isAccessControlServiceEnabled,omitempty"` + + // Whether virtualization instructions are available. For example, Secure Virtual Machine for AMD shapes + // or VT-x for Intel shapes. + AreVirtualInstructionsEnabled *bool `json:"areVirtualInstructionsEnabled,omitempty"` + + // Whether the input-output memory management unit is enabled. + IsInputOutputMemoryManagementUnitEnabled *bool `json:"isInputOutputMemoryManagementUnitEnabled,omitempty"` + + // The percentage of cores enabled. Value must be a multiple of 25%. If the requested percentage + // results in a fractional number of cores, the system rounds up the number of cores across processors + // and provisions an instance with a whole number of cores. + // If the applications that you run on the instance use a core-based licensing model and need fewer cores + // than the full size of the shape, you can disable cores to reduce your licensing costs. The instance + // itself is billed for the full shape, regardless of whether all cores are enabled. + PercentageOfCoresEnabled *int `json:"percentageOfCoresEnabled,omitempty"` + + // The number of NUMA nodes per socket (NPS). + NumaNodesPerSocket AmdMilanBmPlatformConfigNumaNodesPerSocketEnum `json:"numaNodesPerSocket,omitempty"` +} + +// AmdRomeBmPlatformConfigNumaNodesPerSocketEnum Enum with underlying type: string +type AmdRomeBmPlatformConfigNumaNodesPerSocketEnum string + +// Set of constants representing the allowable values for AmdRomeBmPlatformConfigNumaNodesPerSocketEnum +const ( + AmdRomeBmPlatformConfigNumaNodesPerSocketNps0 AmdRomeBmPlatformConfigNumaNodesPerSocketEnum = "NPS0" + AmdRomeBmPlatformConfigNumaNodesPerSocketNps1 AmdRomeBmPlatformConfigNumaNodesPerSocketEnum = "NPS1" + AmdRomeBmPlatformConfigNumaNodesPerSocketNps2 AmdRomeBmPlatformConfigNumaNodesPerSocketEnum = "NPS2" + AmdRomeBmPlatformConfigNumaNodesPerSocketNps4 AmdRomeBmPlatformConfigNumaNodesPerSocketEnum = "NPS4" +) + +// AmdRomeBmPlatformConfig The platform configuration of a bare metal instance that uses the BM.Standard.E3.128 shape (the AMD Rome platform). +type AmdRomeBmPlatformConfig struct { + // Whether Secure Boot is enabled on the instance. + IsSecureBootEnabled *bool `json:"isSecureBootEnabled,omitempty"` + + // Whether the Trusted Platform Module (TPM) is enabled on the instance. + IsTrustedPlatformModuleEnabled *bool `json:"isTrustedPlatformModuleEnabled,omitempty"` + + // Whether the Measured Boot feature is enabled on the instance. + IsMeasuredBootEnabled *bool `json:"isMeasuredBootEnabled,omitempty"` + + // Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + // called simultaneous multithreading (SMT) or Intel Hyper-Threading. + // Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + // independent threads of execution, to better use the resources and increase the efficiency + // of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + // can provide higher or more predictable performance for some workloads. + IsSymmetricMultiThreadingEnabled *bool `json:"isSymmetricMultiThreadingEnabled,omitempty"` + + // Whether the Access Control Service is enabled on the instance. When enabled, + // the platform can enforce PCIe device isolation, required for VFIO device pass-through. + IsAccessControlServiceEnabled *bool `json:"isAccessControlServiceEnabled,omitempty"` + + // Whether virtualization instructions are available. For example, Secure Virtual Machine for AMD shapes + // or VT-x for Intel shapes. + AreVirtualInstructionsEnabled *bool `json:"areVirtualInstructionsEnabled,omitempty"` + + // Whether the input-output memory management unit is enabled. + IsInputOutputMemoryManagementUnitEnabled *bool `json:"isInputOutputMemoryManagementUnitEnabled,omitempty"` + + // The percentage of cores enabled. Value must be a multiple of 25%. If the requested percentage + // results in a fractional number of cores, the system rounds up the number of cores across processors + // and provisions an instance with a whole number of cores. + // If the applications that you run on the instance use a core-based licensing model and need fewer cores + // than the full size of the shape, you can disable cores to reduce your licensing costs. The instance + // itself is billed for the full shape, regardless of whether all cores are enabled. + PercentageOfCoresEnabled *int `json:"percentageOfCoresEnabled,omitempty"` + + // The number of NUMA nodes per socket (NPS). + NumaNodesPerSocket AmdRomeBmPlatformConfigNumaNodesPerSocketEnum `json:"numaNodesPerSocket,omitempty"` +} + +// IntelSkylakeBmPlatformConfig The platform configuration of a bare metal instance that uses one of the following shapes: +// BM.Standard2.52, BM.GPU2.2, BM.GPU3.8, or BM.DenseIO2.52 (the Intel Skylake platform). +type IntelSkylakeBmPlatformConfig struct { + // Whether Secure Boot is enabled on the instance. + IsSecureBootEnabled *bool `json:"isSecureBootEnabled,omitempty"` + + // Whether the Trusted Platform Module (TPM) is enabled on the instance. + IsTrustedPlatformModuleEnabled *bool `json:"isTrustedPlatformModuleEnabled,omitempty"` + + // Whether the Measured Boot feature is enabled on the instance. + IsMeasuredBootEnabled *bool `json:"isMeasuredBootEnabled,omitempty"` +} + +// AmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum Enum with underlying type: string +type AmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum string + +// Set of constants representing the allowable values for AmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum +const ( + AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps0 AmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum = "NPS0" + AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps1 AmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum = "NPS1" + AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps2 AmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum = "NPS2" + AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps4 AmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum = "NPS4" +) + +// AmdRomeBmGpuPlatformConfig The platform configuration of a bare metal GPU instance that uses the BM.GPU4.8 shape +// (the AMD Rome platform). +type AmdRomeBmGpuPlatformConfig struct { + // Whether Secure Boot is enabled on the instance. + IsSecureBootEnabled *bool `json:"isSecureBootEnabled,omitempty"` + + // Whether the Trusted Platform Module (TPM) is enabled on the instance. + IsTrustedPlatformModuleEnabled *bool `json:"isTrustedPlatformModuleEnabled,omitempty"` + + // Whether the Measured Boot feature is enabled on the instance. + IsMeasuredBootEnabled *bool `json:"isMeasuredBootEnabled,omitempty"` + + // Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + // called simultaneous multithreading (SMT) or Intel Hyper-Threading. + // Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + // independent threads of execution, to better use the resources and increase the efficiency + // of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + // can provide higher or more predictable performance for some workloads. + IsSymmetricMultiThreadingEnabled *bool `json:"isSymmetricMultiThreadingEnabled,omitempty"` + + // Whether the Access Control Service is enabled on the instance. When enabled, + // the platform can enforce PCIe device isolation, required for VFIO device pass-through. + IsAccessControlServiceEnabled *bool `json:"isAccessControlServiceEnabled,omitempty"` + + // Whether virtualization instructions are available. For example, Secure Virtual Machine for AMD shapes + // or VT-x for Intel shapes. + AreVirtualInstructionsEnabled *bool `json:"areVirtualInstructionsEnabled,omitempty"` + + // Whether the input-output memory management unit is enabled. + IsInputOutputMemoryManagementUnitEnabled *bool `json:"isInputOutputMemoryManagementUnitEnabled,omitempty"` + + // The number of NUMA nodes per socket (NPS). + NumaNodesPerSocket AmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum `json:"numaNodesPerSocket,omitempty"` +} + +// IntelIcelakeBmPlatformConfigNumaNodesPerSocketEnum Enum with underlying type: string +type IntelIcelakeBmPlatformConfigNumaNodesPerSocketEnum string + +// Set of constants representing the allowable values for IntelIcelakeBmPlatformConfigNumaNodesPerSocketEnum +const ( + IntelIcelakeBmPlatformConfigNumaNodesPerSocketNps1 IntelIcelakeBmPlatformConfigNumaNodesPerSocketEnum = "NPS1" + IntelIcelakeBmPlatformConfigNumaNodesPerSocketNps2 IntelIcelakeBmPlatformConfigNumaNodesPerSocketEnum = "NPS2" +) + +// IntelIcelakeBmPlatformConfig The platform configuration of a bare metal instance that uses the BM.Standard3.64 shape or the +// BM.Optimized3.36 shape (the Intel Ice Lake platform). +type IntelIcelakeBmPlatformConfig struct { + // Whether Secure Boot is enabled on the instance. + IsSecureBootEnabled *bool `json:"isSecureBootEnabled,omitempty"` + + // Whether the Trusted Platform Module (TPM) is enabled on the instance. + IsTrustedPlatformModuleEnabled *bool `json:"isTrustedPlatformModuleEnabled,omitempty"` + + // Whether the Measured Boot feature is enabled on the instance. + IsMeasuredBootEnabled *bool `json:"isMeasuredBootEnabled,omitempty"` + + // Whether symmetric multithreading is enabled on the instance. Symmetric multithreading is also + // called simultaneous multithreading (SMT) or Intel Hyper-Threading. + // Intel and AMD processors have two hardware execution threads per core (OCPU). SMT permits multiple + // independent threads of execution, to better use the resources and increase the efficiency + // of the CPU. When multithreading is disabled, only one thread is permitted to run on each core, which + // can provide higher or more predictable performance for some workloads. + IsSymmetricMultiThreadingEnabled *bool `json:"isSymmetricMultiThreadingEnabled,omitempty"` + + // Whether the input-output memory management unit is enabled. + IsInputOutputMemoryManagementUnitEnabled *bool `json:"isInputOutputMemoryManagementUnitEnabled,omitempty"` + + // The percentage of cores enabled. Value must be a multiple of 25%. If the requested percentage + // results in a fractional number of cores, the system rounds up the number of cores across processors + // and provisions an instance with a whole number of cores. + // If the applications that you run on the instance use a core-based licensing model and need fewer cores + // than the full size of the shape, you can disable cores to reduce your licensing costs. The instance + // itself is billed for the full shape, regardless of whether all cores are enabled. + PercentageOfCoresEnabled *int `json:"percentageOfCoresEnabled,omitempty"` + + // The number of NUMA nodes per socket (NPS). + NumaNodesPerSocket IntelIcelakeBmPlatformConfigNumaNodesPerSocketEnum `json:"numaNodesPerSocket,omitempty"` +} + +// IntelVmPlatformConfig The platform configuration of a virtual machine instance that uses the Intel platform. +type IntelVmPlatformConfig struct { + // Whether Secure Boot is enabled on the instance. + IsSecureBootEnabled *bool `json:"isSecureBootEnabled,omitempty"` + + // Whether the Trusted Platform Module (TPM) is enabled on the instance. + IsTrustedPlatformModuleEnabled *bool `json:"isTrustedPlatformModuleEnabled,omitempty"` + + // Whether the Measured Boot feature is enabled on the instance. + IsMeasuredBootEnabled *bool `json:"isMeasuredBootEnabled,omitempty"` +} + +// AmdVmPlatformConfig The platform configuration of a virtual machine instance that uses the AMD platform. +type AmdVmPlatformConfig struct { + // Whether Secure Boot is enabled on the instance. + IsSecureBootEnabled *bool `json:"isSecureBootEnabled,omitempty"` + + // Whether the Trusted Platform Module (TPM) is enabled on the instance. + IsTrustedPlatformModuleEnabled *bool `json:"isTrustedPlatformModuleEnabled,omitempty"` + + // Whether the Measured Boot feature is enabled on the instance. + IsMeasuredBootEnabled *bool `json:"isMeasuredBootEnabled,omitempty"` +} + +// InstanceOptions Optional mutable instance options +type InstanceOptions struct { + + // Whether to disable the legacy (/v1) instance metadata service endpoints. + // Customers who have migrated to /v2 should set this to true for added security. + // Default is false. + AreLegacyImdsEndpointsDisabled *bool `json:"areLegacyImdsEndpointsDisabled,omitempty"` +} + +// LaunchInstanceAvailabilityConfigDetailsRecoveryActionEnum Enum with underlying type: string +type LaunchInstanceAvailabilityConfigDetailsRecoveryActionEnum string + +// Set of constants representing the allowable values for LaunchInstanceAvailabilityConfigDetailsRecoveryActionEnum +const ( + LaunchInstanceAvailabilityConfigDetailsRecoveryActionRestoreInstance LaunchInstanceAvailabilityConfigDetailsRecoveryActionEnum = "RESTORE_INSTANCE" + LaunchInstanceAvailabilityConfigDetailsRecoveryActionStopInstance LaunchInstanceAvailabilityConfigDetailsRecoveryActionEnum = "STOP_INSTANCE" +) + +// LaunchInstanceAvailabilityConfig Options for VM migration during infrastructure maintenance events and for defining +// the availability of a VM instance after a maintenance event that impacts the underlying hardware. +type LaunchInstanceAvailabilityConfig struct { + + // IsLiveMigrationPreferred defines whether to live migrate supported VM instances to a healthy physical VM host without + // disrupting running instances during infrastructure maintenance events. If null, Oracle + // chooses the best option for migrating the VM during infrastructure maintenance events. + IsLiveMigrationPreferred *bool `json:"isLiveMigrationPreferred,omitempty"` + + //RecoveryAction defines the lifecycle state for an instance when it is recovered after infrastructure maintenance. + // * `RESTORE_INSTANCE` - The instance is restored to the lifecycle state it was in before the maintenance event. + // If the instance was running, it is automatically rebooted. This is the default action when a value is not set. + // * `STOP_INSTANCE` - The instance is recovered in the stopped state. + RecoveryAction LaunchInstanceAvailabilityConfigDetailsRecoveryActionEnum `json:"recoveryAction,omitempty"` +} + +// PreemptibleInstanceConfig Configuration options for preemptible instances. +type PreemptibleInstanceConfig struct { + TerminatePreemptionAction *TerminatePreemptionAction `json:"terminatePreemptionAction,omitempty"` +} + +// TerminatePreemptionAction Terminates the preemptible instance when it is interrupted for eviction. +type TerminatePreemptionAction struct { + + // PreserveBootVolume defines whether to preserve the boot volume that was used to launch the preemptible instance when the instance is terminated. Defaults to false if not specified. + PreserveBootVolume *bool `json:"preserveBootVolume,omitempty"` +} + +// LaunchInstanceAgentConfig Configuration options for the Oracle Cloud Agent software running on the instance. +type LaunchInstanceAgentConfig struct { + + // IsMonitoringDisabled defines whether Oracle Cloud Agent can gather performance metrics and monitor the instance using the + // monitoring plugins. Default value is false (monitoring plugins are enabled). + // These are the monitoring plugins: Compute Instance Monitoring + // and Custom Logs Monitoring. + // The monitoring plugins are controlled by this parameter and by the per-plugin + // configuration in the `pluginsConfig` object. + // - If `isMonitoringDisabled` is true, all of the monitoring plugins are disabled, regardless of + // the per-plugin configuration. + // - If `isMonitoringDisabled` is false, all of the monitoring plugins are enabled. You + // can optionally disable individual monitoring plugins by providing a value in the `pluginsConfig` + // object. + IsMonitoringDisabled *bool `json:"isMonitoringDisabled,omitempty"` + + // IsManagementDisabled defines whether Oracle Cloud Agent can run all the available management plugins. + // Default value is false (management plugins are enabled). + // These are the management plugins: OS Management Service Agent and Compute Instance + // Run Command. + // The management plugins are controlled by this parameter and by the per-plugin + // configuration in the `pluginsConfig` object. + // - If `isManagementDisabled` is true, all of the management plugins are disabled, regardless of + // the per-plugin configuration. + // - If `isManagementDisabled` is false, all of the management plugins are enabled. You + // can optionally disable individual management plugins by providing a value in the `pluginsConfig` + // object. + IsManagementDisabled *bool `json:"isManagementDisabled,omitempty"` + + // AreAllPluginsDisabled defines rhether Oracle Cloud Agent can run all the available plugins. + // This includes the management and monitoring plugins. + // To get a list of available plugins, use the + // ListInstanceagentAvailablePlugins + // operation in the Oracle Cloud Agent API. For more information about the available plugins, see + // Managing Plugins with Oracle Cloud Agent (https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/manage-plugins.htm). + AreAllPluginsDisabled *bool `json:"areAllPluginsDisabled,omitempty"` + + // PluginsConfig defines the configuration of plugins associated with this instance. + PluginsConfig []InstanceAgentPluginConfig `json:"pluginsConfigs,omitempty"` +} + +// InstanceAgentPluginConfigDetailsDesiredStateEnum Enum with underlying type: string +type InstanceAgentPluginConfigDetailsDesiredStateEnum string + +// Set of constants representing the allowable values for InstanceAgentPluginConfigDetailsDesiredStateEnum +const ( + InstanceAgentPluginConfigDetailsDesiredStateEnabled InstanceAgentPluginConfigDetailsDesiredStateEnum = "ENABLED" + InstanceAgentPluginConfigDetailsDesiredStateDisabled InstanceAgentPluginConfigDetailsDesiredStateEnum = "DISABLED" +) + +// InstanceAgentPluginConfig defines the configuration of plugins associated with this instance. +type InstanceAgentPluginConfig struct { + + // Name defines the name of the plugin. To get a list of available plugins, use the + // ListInstanceagentAvailablePlugins + // operation in the Oracle Cloud Agent API. For more information about the available plugins, see + // Managing Plugins with Oracle Cloud Agent (https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/manage-plugins.htm). + Name *string `json:"name,omitempty"` + + // DesiredState defines whether the plugin should be enabled or disabled. + // To enable the monitoring and management plugins, the `isMonitoringDisabled` and + // `isManagementDisabled` attributes must also be set to false. + DesiredState InstanceAgentPluginConfigDetailsDesiredStateEnum `json:"desiredState,omitempty"` } // ShapeConfig defines the configuration options for the compute instance shape @@ -56,6 +575,9 @@ type ShapeConfig struct { // - `BASELINE_1_2` - baseline usage is 1/2 of an OCPU. // - `BASELINE_1_1` - baseline usage is an entire OCPU. This represents a non-burstable instance. BaselineOcpuUtilization string `json:"baselineOcpuUtilization,omitempty"` + + // Nvmes defines the number of NVMe drives to be used for storage. A single drive has 6.8 TB available. + Nvmes *int `json:"nvmes,omitempty"` } // EgressSecurityRule A rule for allowing outbound IP packets. diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index bdae014b..e45fc53f 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -27,6 +27,196 @@ import ( "sigs.k8s.io/cluster-api/errors" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AmdMilanBmPlatformConfig) DeepCopyInto(out *AmdMilanBmPlatformConfig) { + *out = *in + if in.IsSecureBootEnabled != nil { + in, out := &in.IsSecureBootEnabled, &out.IsSecureBootEnabled + *out = new(bool) + **out = **in + } + if in.IsTrustedPlatformModuleEnabled != nil { + in, out := &in.IsTrustedPlatformModuleEnabled, &out.IsTrustedPlatformModuleEnabled + *out = new(bool) + **out = **in + } + if in.IsMeasuredBootEnabled != nil { + in, out := &in.IsMeasuredBootEnabled, &out.IsMeasuredBootEnabled + *out = new(bool) + **out = **in + } + if in.IsSymmetricMultiThreadingEnabled != nil { + in, out := &in.IsSymmetricMultiThreadingEnabled, &out.IsSymmetricMultiThreadingEnabled + *out = new(bool) + **out = **in + } + if in.IsAccessControlServiceEnabled != nil { + in, out := &in.IsAccessControlServiceEnabled, &out.IsAccessControlServiceEnabled + *out = new(bool) + **out = **in + } + if in.AreVirtualInstructionsEnabled != nil { + in, out := &in.AreVirtualInstructionsEnabled, &out.AreVirtualInstructionsEnabled + *out = new(bool) + **out = **in + } + if in.IsInputOutputMemoryManagementUnitEnabled != nil { + in, out := &in.IsInputOutputMemoryManagementUnitEnabled, &out.IsInputOutputMemoryManagementUnitEnabled + *out = new(bool) + **out = **in + } + if in.PercentageOfCoresEnabled != nil { + in, out := &in.PercentageOfCoresEnabled, &out.PercentageOfCoresEnabled + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AmdMilanBmPlatformConfig. +func (in *AmdMilanBmPlatformConfig) DeepCopy() *AmdMilanBmPlatformConfig { + if in == nil { + return nil + } + out := new(AmdMilanBmPlatformConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AmdRomeBmGpuPlatformConfig) DeepCopyInto(out *AmdRomeBmGpuPlatformConfig) { + *out = *in + if in.IsSecureBootEnabled != nil { + in, out := &in.IsSecureBootEnabled, &out.IsSecureBootEnabled + *out = new(bool) + **out = **in + } + if in.IsTrustedPlatformModuleEnabled != nil { + in, out := &in.IsTrustedPlatformModuleEnabled, &out.IsTrustedPlatformModuleEnabled + *out = new(bool) + **out = **in + } + if in.IsMeasuredBootEnabled != nil { + in, out := &in.IsMeasuredBootEnabled, &out.IsMeasuredBootEnabled + *out = new(bool) + **out = **in + } + if in.IsSymmetricMultiThreadingEnabled != nil { + in, out := &in.IsSymmetricMultiThreadingEnabled, &out.IsSymmetricMultiThreadingEnabled + *out = new(bool) + **out = **in + } + if in.IsAccessControlServiceEnabled != nil { + in, out := &in.IsAccessControlServiceEnabled, &out.IsAccessControlServiceEnabled + *out = new(bool) + **out = **in + } + if in.AreVirtualInstructionsEnabled != nil { + in, out := &in.AreVirtualInstructionsEnabled, &out.AreVirtualInstructionsEnabled + *out = new(bool) + **out = **in + } + if in.IsInputOutputMemoryManagementUnitEnabled != nil { + in, out := &in.IsInputOutputMemoryManagementUnitEnabled, &out.IsInputOutputMemoryManagementUnitEnabled + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AmdRomeBmGpuPlatformConfig. +func (in *AmdRomeBmGpuPlatformConfig) DeepCopy() *AmdRomeBmGpuPlatformConfig { + if in == nil { + return nil + } + out := new(AmdRomeBmGpuPlatformConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AmdRomeBmPlatformConfig) DeepCopyInto(out *AmdRomeBmPlatformConfig) { + *out = *in + if in.IsSecureBootEnabled != nil { + in, out := &in.IsSecureBootEnabled, &out.IsSecureBootEnabled + *out = new(bool) + **out = **in + } + if in.IsTrustedPlatformModuleEnabled != nil { + in, out := &in.IsTrustedPlatformModuleEnabled, &out.IsTrustedPlatformModuleEnabled + *out = new(bool) + **out = **in + } + if in.IsMeasuredBootEnabled != nil { + in, out := &in.IsMeasuredBootEnabled, &out.IsMeasuredBootEnabled + *out = new(bool) + **out = **in + } + if in.IsSymmetricMultiThreadingEnabled != nil { + in, out := &in.IsSymmetricMultiThreadingEnabled, &out.IsSymmetricMultiThreadingEnabled + *out = new(bool) + **out = **in + } + if in.IsAccessControlServiceEnabled != nil { + in, out := &in.IsAccessControlServiceEnabled, &out.IsAccessControlServiceEnabled + *out = new(bool) + **out = **in + } + if in.AreVirtualInstructionsEnabled != nil { + in, out := &in.AreVirtualInstructionsEnabled, &out.AreVirtualInstructionsEnabled + *out = new(bool) + **out = **in + } + if in.IsInputOutputMemoryManagementUnitEnabled != nil { + in, out := &in.IsInputOutputMemoryManagementUnitEnabled, &out.IsInputOutputMemoryManagementUnitEnabled + *out = new(bool) + **out = **in + } + if in.PercentageOfCoresEnabled != nil { + in, out := &in.PercentageOfCoresEnabled, &out.PercentageOfCoresEnabled + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AmdRomeBmPlatformConfig. +func (in *AmdRomeBmPlatformConfig) DeepCopy() *AmdRomeBmPlatformConfig { + if in == nil { + return nil + } + out := new(AmdRomeBmPlatformConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AmdVmPlatformConfig) DeepCopyInto(out *AmdVmPlatformConfig) { + *out = *in + if in.IsSecureBootEnabled != nil { + in, out := &in.IsSecureBootEnabled, &out.IsSecureBootEnabled + *out = new(bool) + **out = **in + } + if in.IsTrustedPlatformModuleEnabled != nil { + in, out := &in.IsTrustedPlatformModuleEnabled, &out.IsTrustedPlatformModuleEnabled + *out = new(bool) + **out = **in + } + if in.IsMeasuredBootEnabled != nil { + in, out := &in.IsMeasuredBootEnabled, &out.IsMeasuredBootEnabled + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AmdVmPlatformConfig. +func (in *AmdVmPlatformConfig) DeepCopy() *AmdVmPlatformConfig { + if in == nil { + return nil + } + out := new(AmdVmPlatformConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DRG) DeepCopyInto(out *DRG) { *out = *in @@ -219,6 +409,253 @@ func (in *IngressSecurityRuleForNSG) DeepCopy() *IngressSecurityRuleForNSG { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceAgentPluginConfig) DeepCopyInto(out *InstanceAgentPluginConfig) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceAgentPluginConfig. +func (in *InstanceAgentPluginConfig) DeepCopy() *InstanceAgentPluginConfig { + if in == nil { + return nil + } + out := new(InstanceAgentPluginConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceOptions) DeepCopyInto(out *InstanceOptions) { + *out = *in + if in.AreLegacyImdsEndpointsDisabled != nil { + in, out := &in.AreLegacyImdsEndpointsDisabled, &out.AreLegacyImdsEndpointsDisabled + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceOptions. +func (in *InstanceOptions) DeepCopy() *InstanceOptions { + if in == nil { + return nil + } + out := new(InstanceOptions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceSourceViaImageConfig) DeepCopyInto(out *InstanceSourceViaImageConfig) { + *out = *in + if in.KmsKeyId != nil { + in, out := &in.KmsKeyId, &out.KmsKeyId + *out = new(string) + **out = **in + } + if in.BootVolumeVpusPerGB != nil { + in, out := &in.BootVolumeVpusPerGB, &out.BootVolumeVpusPerGB + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSourceViaImageConfig. +func (in *InstanceSourceViaImageConfig) DeepCopy() *InstanceSourceViaImageConfig { + if in == nil { + return nil + } + out := new(InstanceSourceViaImageConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IntelIcelakeBmPlatformConfig) DeepCopyInto(out *IntelIcelakeBmPlatformConfig) { + *out = *in + if in.IsSecureBootEnabled != nil { + in, out := &in.IsSecureBootEnabled, &out.IsSecureBootEnabled + *out = new(bool) + **out = **in + } + if in.IsTrustedPlatformModuleEnabled != nil { + in, out := &in.IsTrustedPlatformModuleEnabled, &out.IsTrustedPlatformModuleEnabled + *out = new(bool) + **out = **in + } + if in.IsMeasuredBootEnabled != nil { + in, out := &in.IsMeasuredBootEnabled, &out.IsMeasuredBootEnabled + *out = new(bool) + **out = **in + } + if in.IsSymmetricMultiThreadingEnabled != nil { + in, out := &in.IsSymmetricMultiThreadingEnabled, &out.IsSymmetricMultiThreadingEnabled + *out = new(bool) + **out = **in + } + if in.IsInputOutputMemoryManagementUnitEnabled != nil { + in, out := &in.IsInputOutputMemoryManagementUnitEnabled, &out.IsInputOutputMemoryManagementUnitEnabled + *out = new(bool) + **out = **in + } + if in.PercentageOfCoresEnabled != nil { + in, out := &in.PercentageOfCoresEnabled, &out.PercentageOfCoresEnabled + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntelIcelakeBmPlatformConfig. +func (in *IntelIcelakeBmPlatformConfig) DeepCopy() *IntelIcelakeBmPlatformConfig { + if in == nil { + return nil + } + out := new(IntelIcelakeBmPlatformConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IntelSkylakeBmPlatformConfig) DeepCopyInto(out *IntelSkylakeBmPlatformConfig) { + *out = *in + if in.IsSecureBootEnabled != nil { + in, out := &in.IsSecureBootEnabled, &out.IsSecureBootEnabled + *out = new(bool) + **out = **in + } + if in.IsTrustedPlatformModuleEnabled != nil { + in, out := &in.IsTrustedPlatformModuleEnabled, &out.IsTrustedPlatformModuleEnabled + *out = new(bool) + **out = **in + } + if in.IsMeasuredBootEnabled != nil { + in, out := &in.IsMeasuredBootEnabled, &out.IsMeasuredBootEnabled + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntelSkylakeBmPlatformConfig. +func (in *IntelSkylakeBmPlatformConfig) DeepCopy() *IntelSkylakeBmPlatformConfig { + if in == nil { + return nil + } + out := new(IntelSkylakeBmPlatformConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IntelVmPlatformConfig) DeepCopyInto(out *IntelVmPlatformConfig) { + *out = *in + if in.IsSecureBootEnabled != nil { + in, out := &in.IsSecureBootEnabled, &out.IsSecureBootEnabled + *out = new(bool) + **out = **in + } + if in.IsTrustedPlatformModuleEnabled != nil { + in, out := &in.IsTrustedPlatformModuleEnabled, &out.IsTrustedPlatformModuleEnabled + *out = new(bool) + **out = **in + } + if in.IsMeasuredBootEnabled != nil { + in, out := &in.IsMeasuredBootEnabled, &out.IsMeasuredBootEnabled + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntelVmPlatformConfig. +func (in *IntelVmPlatformConfig) DeepCopy() *IntelVmPlatformConfig { + if in == nil { + return nil + } + out := new(IntelVmPlatformConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LaunchInstanceAgentConfig) DeepCopyInto(out *LaunchInstanceAgentConfig) { + *out = *in + if in.IsMonitoringDisabled != nil { + in, out := &in.IsMonitoringDisabled, &out.IsMonitoringDisabled + *out = new(bool) + **out = **in + } + if in.IsManagementDisabled != nil { + in, out := &in.IsManagementDisabled, &out.IsManagementDisabled + *out = new(bool) + **out = **in + } + if in.AreAllPluginsDisabled != nil { + in, out := &in.AreAllPluginsDisabled, &out.AreAllPluginsDisabled + *out = new(bool) + **out = **in + } + if in.PluginsConfig != nil { + in, out := &in.PluginsConfig, &out.PluginsConfig + *out = make([]InstanceAgentPluginConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LaunchInstanceAgentConfig. +func (in *LaunchInstanceAgentConfig) DeepCopy() *LaunchInstanceAgentConfig { + if in == nil { + return nil + } + out := new(LaunchInstanceAgentConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LaunchInstanceAvailabilityConfig) DeepCopyInto(out *LaunchInstanceAvailabilityConfig) { + *out = *in + if in.IsLiveMigrationPreferred != nil { + in, out := &in.IsLiveMigrationPreferred, &out.IsLiveMigrationPreferred + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LaunchInstanceAvailabilityConfig. +func (in *LaunchInstanceAvailabilityConfig) DeepCopy() *LaunchInstanceAvailabilityConfig { + if in == nil { + return nil + } + out := new(LaunchInstanceAvailabilityConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LaunchOptions) DeepCopyInto(out *LaunchOptions) { + *out = *in + if in.IsConsistentVolumeNamingEnabled != nil { + in, out := &in.IsConsistentVolumeNamingEnabled, &out.IsConsistentVolumeNamingEnabled + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LaunchOptions. +func (in *LaunchOptions) DeepCopy() *LaunchOptions { + if in == nil { + return nil + } + out := new(LaunchOptions) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LoadBalancer) DeepCopyInto(out *LoadBalancer) { *out = *in @@ -286,6 +723,31 @@ func (in *NetworkDetails) DeepCopyInto(out *NetworkDetails) { *out = new(string) **out = **in } + if in.SkipSourceDestCheck != nil { + in, out := &in.SkipSourceDestCheck, &out.SkipSourceDestCheck + *out = new(bool) + **out = **in + } + if in.NsgNames != nil { + in, out := &in.NsgNames, &out.NsgNames + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.HostnameLabel != nil { + in, out := &in.HostnameLabel, &out.HostnameLabel + *out = new(string) + **out = **in + } + if in.DisplayName != nil { + in, out := &in.DisplayName, &out.DisplayName + *out = new(string) + **out = **in + } + if in.AssignPrivateDnsRecord != nil { + in, out := &in.AssignPrivateDnsRecord, &out.AssignPrivateDnsRecord + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkDetails. @@ -633,8 +1095,58 @@ func (in *OCIMachineSpec) DeepCopyInto(out *OCIMachineSpec) { *out = new(string) **out = **in } - out.ShapeConfig = in.ShapeConfig + if in.IpxeScript != nil { + in, out := &in.IpxeScript, &out.IpxeScript + *out = new(string) + **out = **in + } + if in.CapacityReservationId != nil { + in, out := &in.CapacityReservationId, &out.CapacityReservationId + *out = new(string) + **out = **in + } + in.ShapeConfig.DeepCopyInto(&out.ShapeConfig) in.NetworkDetails.DeepCopyInto(&out.NetworkDetails) + if in.LaunchOptions != nil { + in, out := &in.LaunchOptions, &out.LaunchOptions + *out = new(LaunchOptions) + (*in).DeepCopyInto(*out) + } + if in.InstanceOptions != nil { + in, out := &in.InstanceOptions, &out.InstanceOptions + *out = new(InstanceOptions) + (*in).DeepCopyInto(*out) + } + if in.AvailabilityConfig != nil { + in, out := &in.AvailabilityConfig, &out.AvailabilityConfig + *out = new(LaunchInstanceAvailabilityConfig) + (*in).DeepCopyInto(*out) + } + if in.PreemptibleInstanceConfig != nil { + in, out := &in.PreemptibleInstanceConfig, &out.PreemptibleInstanceConfig + *out = new(PreemptibleInstanceConfig) + (*in).DeepCopyInto(*out) + } + if in.AgentConfig != nil { + in, out := &in.AgentConfig, &out.AgentConfig + *out = new(LaunchInstanceAgentConfig) + (*in).DeepCopyInto(*out) + } + if in.InstanceSourceViaImageDetails != nil { + in, out := &in.InstanceSourceViaImageDetails, &out.InstanceSourceViaImageDetails + *out = new(InstanceSourceViaImageConfig) + (*in).DeepCopyInto(*out) + } + if in.PlatformConfig != nil { + in, out := &in.PlatformConfig, &out.PlatformConfig + *out = new(PlatformConfig) + (*in).DeepCopyInto(*out) + } + if in.DedicatedVmHostId != nil { + in, out := &in.DedicatedVmHostId, &out.DedicatedVmHostId + *out = new(string) + **out = **in + } if in.ProviderID != nil { in, out := &in.ProviderID, &out.ProviderID *out = new(string) @@ -825,6 +1337,28 @@ func (in *PeerRouteRule) DeepCopy() *PeerRouteRule { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PlatformConfig) DeepCopyInto(out *PlatformConfig) { + *out = *in + in.AmdMilanBmPlatformConfig.DeepCopyInto(&out.AmdMilanBmPlatformConfig) + in.AmdRomeBmPlatformConfig.DeepCopyInto(&out.AmdRomeBmPlatformConfig) + in.IntelSkylakeBmPlatformConfig.DeepCopyInto(&out.IntelSkylakeBmPlatformConfig) + in.IntelIcelakeBmPlatformConfig.DeepCopyInto(&out.IntelIcelakeBmPlatformConfig) + in.AmdRomeBmGpuPlatformConfig.DeepCopyInto(&out.AmdRomeBmGpuPlatformConfig) + in.IntelVmPlatformConfig.DeepCopyInto(&out.IntelVmPlatformConfig) + in.AmdVmPlatformConfig.DeepCopyInto(&out.AmdVmPlatformConfig) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlatformConfig. +func (in *PlatformConfig) DeepCopy() *PlatformConfig { + if in == nil { + return nil + } + out := new(PlatformConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PortRange) DeepCopyInto(out *PortRange) { *out = *in @@ -850,6 +1384,26 @@ func (in *PortRange) DeepCopy() *PortRange { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PreemptibleInstanceConfig) DeepCopyInto(out *PreemptibleInstanceConfig) { + *out = *in + if in.TerminatePreemptionAction != nil { + in, out := &in.TerminatePreemptionAction, &out.TerminatePreemptionAction + *out = new(TerminatePreemptionAction) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreemptibleInstanceConfig. +func (in *PreemptibleInstanceConfig) DeepCopy() *PreemptibleInstanceConfig { + if in == nil { + return nil + } + out := new(PreemptibleInstanceConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RemotePeeringConnection) DeepCopyInto(out *RemotePeeringConnection) { *out = *in @@ -917,6 +1471,11 @@ func (in *SecurityList) DeepCopy() *SecurityList { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ShapeConfig) DeepCopyInto(out *ShapeConfig) { *out = *in + if in.Nvmes != nil { + in, out := &in.Nvmes, &out.Nvmes + *out = new(int) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShapeConfig. @@ -979,6 +1538,26 @@ func (in *TcpOptions) DeepCopy() *TcpOptions { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TerminatePreemptionAction) DeepCopyInto(out *TerminatePreemptionAction) { + *out = *in + if in.PreserveBootVolume != nil { + in, out := &in.PreserveBootVolume, &out.PreserveBootVolume + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TerminatePreemptionAction. +func (in *TerminatePreemptionAction) DeepCopy() *TerminatePreemptionAction { + if in == nil { + return nil + } + out := new(TerminatePreemptionAction) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UdpOptions) DeepCopyInto(out *UdpOptions) { *out = *in diff --git a/cloud/scope/machine.go b/cloud/scope/machine.go index 61264dd8..332b07a1 100644 --- a/cloud/scope/machine.go +++ b/cloud/scope/machine.go @@ -167,6 +167,10 @@ func (m *MachineScope) GetOrCreateMachine(ctx context.Context) (*core.Instance, sourceDetails.BootVolumeSizeInGBs = common.Int64(int64(bootVolumeSizeInGBs)) } } + if m.OCIMachine.Spec.InstanceSourceViaImageDetails != nil { + sourceDetails.KmsKeyId = m.OCIMachine.Spec.InstanceSourceViaImageDetails.KmsKeyId + sourceDetails.BootVolumeVpusPerGB = m.OCIMachine.Spec.InstanceSourceViaImageDetails.BootVolumeVpusPerGB + } subnetId := m.OCIMachine.Spec.NetworkDetails.SubnetId if subnetId == nil { @@ -177,12 +181,15 @@ func (m *MachineScope) GetOrCreateMachine(ctx context.Context) (*core.Instance, } } - nsgId := m.OCIMachine.Spec.NetworkDetails.NSGId - if nsgId == nil { + var nsgIds []string + if m.OCIMachine.Spec.NetworkDetails.NSGId != nil { + nsgIds = []string{*m.OCIMachine.Spec.NetworkDetails.NSGId} + } + if len(nsgIds) == 0 { if m.IsControlPlane() { - nsgId = m.getGetControlPlaneMachineNSG() + nsgIds = m.getGetControlPlaneMachineNSGs() } else { - nsgId = m.getWorkerMachineNSG() + nsgIds = m.getWorkerMachineNSGs() } } @@ -229,8 +236,14 @@ func (m *MachineScope) GetOrCreateMachine(ctx context.Context) (*core.Instance, launchDetails := core.LaunchInstanceDetails{DisplayName: common.String(m.OCIMachine.Name), SourceDetails: sourceDetails, CreateVnicDetails: &core.CreateVnicDetails{ - SubnetId: subnetId, - AssignPublicIp: common.Bool(m.OCIMachine.Spec.NetworkDetails.AssignPublicIp), + SubnetId: subnetId, + AssignPublicIp: common.Bool(m.OCIMachine.Spec.NetworkDetails.AssignPublicIp), + FreeformTags: tags, + DefinedTags: definedTags, + HostnameLabel: m.OCIMachine.Spec.NetworkDetails.HostnameLabel, + SkipSourceDestCheck: m.OCIMachine.Spec.NetworkDetails.SkipSourceDestCheck, + AssignPrivateDnsRecord: m.OCIMachine.Spec.NetworkDetails.AssignPrivateDnsRecord, + DisplayName: m.OCIMachine.Spec.NetworkDetails.DisplayName, }, Metadata: metadata, Shape: common.String(m.OCIMachine.Spec.Shape), @@ -239,6 +252,8 @@ func (m *MachineScope) GetOrCreateMachine(ctx context.Context) (*core.Instance, IsPvEncryptionInTransitEnabled: common.Bool(m.OCIMachine.Spec.IsPvEncryptionInTransitEnabled), FreeformTags: tags, DefinedTags: definedTags, + // ExtendedMetadata: m.OCIMachine.Spec.ExtendedMetadata, + DedicatedVmHostId: m.OCIMachine.Spec.DedicatedVmHostId, } // Compute API does not behave well if the shape config is empty for fixed shapes // hence set it only if it non empty @@ -248,9 +263,16 @@ func (m *MachineScope) GetOrCreateMachine(ctx context.Context) (*core.Instance, if faultDomain != "" { launchDetails.FaultDomain = common.String(faultDomain) } - if nsgId != nil { - launchDetails.CreateVnicDetails.NsgIds = []string{*nsgId} + launchDetails.CreateVnicDetails.NsgIds = nsgIds + if m.OCIMachine.Spec.CapacityReservationId != nil { + launchDetails.CapacityReservationId = m.OCIMachine.Spec.CapacityReservationId } + launchDetails.AgentConfig = m.getAgentConfig() + launchDetails.LaunchOptions = m.getLaunchOptions() + launchDetails.InstanceOptions = m.getInstanceOptions() + launchDetails.AvailabilityConfig = m.getAvailabilityConfig() + launchDetails.PreemptibleInstanceConfig = m.getPreemptibleInstanceConfig() + launchDetails.PlatformConfig = m.getPlatformConfig() req := core.LaunchInstanceRequest{LaunchInstanceDetails: launchDetails, OpcRetryToken: ociutil.GetOPCRetryToken(string(m.OCIMachine.UID))} resp, err := m.ComputeClient.LaunchInstance(ctx, req) @@ -588,13 +610,14 @@ func (m *MachineScope) getGetControlPlaneMachineSubnet() *string { return nil } -func (m *MachineScope) getGetControlPlaneMachineNSG() *string { +func (m *MachineScope) getGetControlPlaneMachineNSGs() []string { + nsgs := make([]string, 0) for _, nsg := range m.OCICluster.Spec.NetworkSpec.Vcn.NetworkSecurityGroups { if nsg.Role == infrastructurev1beta1.ControlPlaneRole { - return nsg.ID + nsgs = append(nsgs, *nsg.ID) } } - return nil + return nsgs } func (m *MachineScope) getWorkerMachineSubnet() *string { @@ -613,18 +636,196 @@ func (m *MachineScope) getWorkerMachineSubnet() *string { return nil } -func (m *MachineScope) getWorkerMachineNSG() *string { - for _, nsg := range m.OCICluster.Spec.NetworkSpec.Vcn.NetworkSecurityGroups { - if nsg.Role == infrastructurev1beta1.WorkerRole { - // if an NSG name is defined, use the correct NSG - if m.OCIMachine.Spec.NSGName != "" { - if m.OCIMachine.Spec.NSGName == nsg.Name { - return nsg.ID +func (m *MachineScope) getWorkerMachineNSGs() []string { + if len(m.OCIMachine.Spec.NetworkDetails.NsgNames) > 0 { + nsgs := make([]string, 0) + for _, nsgName := range m.OCIMachine.Spec.NetworkDetails.NsgNames { + for _, nsg := range m.OCICluster.Spec.NetworkSpec.Vcn.NetworkSecurityGroups { + if nsg.Name == nsgName { + nsgs = append(nsgs, *nsg.ID) } - } else { - return nsg.ID } } + return nsgs + } else { + nsgs := make([]string, 0) + for _, nsg := range m.OCICluster.Spec.NetworkSpec.Vcn.NetworkSecurityGroups { + if nsg.Role == infrastructurev1beta1.WorkerRole { + // if an NSG name is defined, use the correct NSG + if m.OCIMachine.Spec.NSGName != "" { + if m.OCIMachine.Spec.NSGName == nsg.Name { + nsgs = append(nsgs, *nsg.ID) + } + } else { + nsgs = append(nsgs, *nsg.ID) + } + } + } + return nsgs + } +} + +func (m *MachineScope) getAgentConfig() *core.LaunchInstanceAgentConfigDetails { + agentConfigSpec := m.OCIMachine.Spec.AgentConfig + if agentConfigSpec != nil { + agentConfig := &core.LaunchInstanceAgentConfigDetails{ + IsMonitoringDisabled: agentConfigSpec.IsMonitoringDisabled, + IsManagementDisabled: agentConfigSpec.IsManagementDisabled, + AreAllPluginsDisabled: agentConfigSpec.AreAllPluginsDisabled, + } + if len(agentConfigSpec.PluginsConfig) > 0 { + pluginConfigList := make([]core.InstanceAgentPluginConfigDetails, len(agentConfigSpec.PluginsConfig)) + for i, pluginConfigSpec := range agentConfigSpec.PluginsConfig { + pluginConfigRequest := core.InstanceAgentPluginConfigDetails{ + Name: pluginConfigSpec.Name, + } + desiredState, _ := core.GetMappingInstanceAgentPluginConfigDetailsDesiredStateEnum(string(pluginConfigSpec.DesiredState)) + pluginConfigRequest.DesiredState = desiredState + pluginConfigList[i] = pluginConfigRequest + } + agentConfig.PluginsConfig = pluginConfigList + } + return agentConfig + } + return nil +} + +func (m *MachineScope) getLaunchOptions() *core.LaunchOptions { + launcOptionsSpec := m.OCIMachine.Spec.LaunchOptions + if launcOptionsSpec != nil { + launchOptions := &core.LaunchOptions{ + IsConsistentVolumeNamingEnabled: launcOptionsSpec.IsConsistentVolumeNamingEnabled, + } + if launcOptionsSpec.BootVolumeType != "" { + bootVolume, _ := core.GetMappingLaunchOptionsBootVolumeTypeEnum(string(launcOptionsSpec.BootVolumeType)) + launchOptions.BootVolumeType = bootVolume + } + if launcOptionsSpec.Firmware != "" { + firmware, _ := core.GetMappingLaunchOptionsFirmwareEnum(string(launcOptionsSpec.Firmware)) + launchOptions.Firmware = firmware + } + if launcOptionsSpec.NetworkType != "" { + networkType, _ := core.GetMappingLaunchOptionsNetworkTypeEnum(string(launcOptionsSpec.NetworkType)) + launchOptions.NetworkType = networkType + } + if launcOptionsSpec.RemoteDataVolumeType != "" { + remoteVolumeType, _ := core.GetMappingLaunchOptionsRemoteDataVolumeTypeEnum(string(launcOptionsSpec.RemoteDataVolumeType)) + launchOptions.RemoteDataVolumeType = remoteVolumeType + } + return launchOptions + } + return nil +} + +func (m *MachineScope) getInstanceOptions() *core.InstanceOptions { + instanceOptionsSpec := m.OCIMachine.Spec.InstanceOptions + if instanceOptionsSpec != nil { + return &core.InstanceOptions{ + AreLegacyImdsEndpointsDisabled: instanceOptionsSpec.AreLegacyImdsEndpointsDisabled, + } + } + return nil +} + +func (m *MachineScope) getAvailabilityConfig() *core.LaunchInstanceAvailabilityConfigDetails { + avalabilityConfigSpec := m.OCIMachine.Spec.AvailabilityConfig + if avalabilityConfigSpec != nil { + recoveryAction, _ := core.GetMappingLaunchInstanceAvailabilityConfigDetailsRecoveryActionEnum(string(avalabilityConfigSpec.RecoveryAction)) + return &core.LaunchInstanceAvailabilityConfigDetails{ + IsLiveMigrationPreferred: avalabilityConfigSpec.IsLiveMigrationPreferred, + RecoveryAction: recoveryAction, + } + } + return nil +} + +func (m *MachineScope) getPreemptibleInstanceConfig() *core.PreemptibleInstanceConfigDetails { + preEmptibleInstanceConfigSpec := m.OCIMachine.Spec.PreemptibleInstanceConfig + if preEmptibleInstanceConfigSpec != nil { + preemptibleInstanceConfig := &core.PreemptibleInstanceConfigDetails{} + if preEmptibleInstanceConfigSpec.TerminatePreemptionAction != nil { + preemptibleInstanceConfig.PreemptionAction = core.TerminatePreemptionAction{ + PreserveBootVolume: preEmptibleInstanceConfigSpec.TerminatePreemptionAction.PreserveBootVolume, + } + } + return preemptibleInstanceConfig + } + return nil +} + +func (m *MachineScope) getPlatformConfig() core.PlatformConfig { + platformConfig := m.OCIMachine.Spec.PlatformConfig + if platformConfig != nil { + switch platformConfig.PlatformConfigType { + case infrastructurev1beta1.PlatformConfigTypeAmdRomeBmGpu: + numaNodesPerSocket, _ := core.GetMappingAmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum(string(platformConfig.AmdRomeBmGpuPlatformConfig.NumaNodesPerSocket)) + return core.AmdRomeBmGpuPlatformConfig{ + IsSecureBootEnabled: platformConfig.AmdRomeBmGpuPlatformConfig.IsSecureBootEnabled, + IsTrustedPlatformModuleEnabled: platformConfig.AmdRomeBmGpuPlatformConfig.IsTrustedPlatformModuleEnabled, + IsMeasuredBootEnabled: platformConfig.AmdRomeBmGpuPlatformConfig.IsMeasuredBootEnabled, + IsSymmetricMultiThreadingEnabled: platformConfig.AmdRomeBmGpuPlatformConfig.IsSymmetricMultiThreadingEnabled, + IsAccessControlServiceEnabled: platformConfig.AmdRomeBmGpuPlatformConfig.IsAccessControlServiceEnabled, + AreVirtualInstructionsEnabled: platformConfig.AmdRomeBmGpuPlatformConfig.AreVirtualInstructionsEnabled, + IsInputOutputMemoryManagementUnitEnabled: platformConfig.AmdRomeBmGpuPlatformConfig.IsInputOutputMemoryManagementUnitEnabled, + NumaNodesPerSocket: numaNodesPerSocket, + } + case infrastructurev1beta1.PlatformConfigTypeAmdRomeBm: + numaNodesPerSocket, _ := core.GetMappingAmdRomeBmPlatformConfigNumaNodesPerSocketEnum(string(platformConfig.AmdRomeBmPlatformConfig.NumaNodesPerSocket)) + return core.AmdRomeBmPlatformConfig{ + IsSecureBootEnabled: platformConfig.AmdRomeBmPlatformConfig.IsSecureBootEnabled, + IsTrustedPlatformModuleEnabled: platformConfig.AmdRomeBmPlatformConfig.IsTrustedPlatformModuleEnabled, + IsMeasuredBootEnabled: platformConfig.AmdRomeBmPlatformConfig.IsMeasuredBootEnabled, + IsSymmetricMultiThreadingEnabled: platformConfig.AmdRomeBmPlatformConfig.IsSymmetricMultiThreadingEnabled, + IsAccessControlServiceEnabled: platformConfig.AmdRomeBmPlatformConfig.IsAccessControlServiceEnabled, + AreVirtualInstructionsEnabled: platformConfig.AmdRomeBmPlatformConfig.AreVirtualInstructionsEnabled, + IsInputOutputMemoryManagementUnitEnabled: platformConfig.AmdRomeBmPlatformConfig.IsInputOutputMemoryManagementUnitEnabled, + PercentageOfCoresEnabled: platformConfig.AmdRomeBmPlatformConfig.PercentageOfCoresEnabled, + NumaNodesPerSocket: numaNodesPerSocket, + } + case infrastructurev1beta1.PlatformConfigTypeIntelIcelakeBm: + numaNodesPerSocket, _ := core.GetMappingIntelIcelakeBmPlatformConfigNumaNodesPerSocketEnum(string(platformConfig.IntelIcelakeBmPlatformConfig.NumaNodesPerSocket)) + return core.IntelIcelakeBmPlatformConfig{ + IsSecureBootEnabled: platformConfig.IntelIcelakeBmPlatformConfig.IsSecureBootEnabled, + IsTrustedPlatformModuleEnabled: platformConfig.IntelIcelakeBmPlatformConfig.IsTrustedPlatformModuleEnabled, + IsMeasuredBootEnabled: platformConfig.IntelIcelakeBmPlatformConfig.IsMeasuredBootEnabled, + IsSymmetricMultiThreadingEnabled: platformConfig.IntelIcelakeBmPlatformConfig.IsSymmetricMultiThreadingEnabled, + PercentageOfCoresEnabled: platformConfig.IntelIcelakeBmPlatformConfig.PercentageOfCoresEnabled, + IsInputOutputMemoryManagementUnitEnabled: platformConfig.IntelIcelakeBmPlatformConfig.IsInputOutputMemoryManagementUnitEnabled, + NumaNodesPerSocket: numaNodesPerSocket, + } + case infrastructurev1beta1.PlatformConfigTypeAmdvm: + return core.AmdVmPlatformConfig{ + IsSecureBootEnabled: platformConfig.AmdVmPlatformConfig.IsSecureBootEnabled, + IsTrustedPlatformModuleEnabled: platformConfig.AmdVmPlatformConfig.IsTrustedPlatformModuleEnabled, + IsMeasuredBootEnabled: platformConfig.AmdVmPlatformConfig.IsMeasuredBootEnabled, + } + case infrastructurev1beta1.PlatformConfigTypeIntelVm: + return core.IntelVmPlatformConfig{ + IsSecureBootEnabled: platformConfig.IntelVmPlatformConfig.IsSecureBootEnabled, + IsTrustedPlatformModuleEnabled: platformConfig.IntelVmPlatformConfig.IsTrustedPlatformModuleEnabled, + IsMeasuredBootEnabled: platformConfig.IntelVmPlatformConfig.IsMeasuredBootEnabled, + } + case infrastructurev1beta1.PlatformConfigTypeIntelSkylakeBm: + return core.IntelSkylakeBmPlatformConfig{ + IsSecureBootEnabled: platformConfig.IntelSkylakeBmPlatformConfig.IsSecureBootEnabled, + IsTrustedPlatformModuleEnabled: platformConfig.IntelSkylakeBmPlatformConfig.IsTrustedPlatformModuleEnabled, + IsMeasuredBootEnabled: platformConfig.IntelSkylakeBmPlatformConfig.IsMeasuredBootEnabled, + } + case infrastructurev1beta1.PlatformConfigTypeAmdMilanBm: + numaNodesPerSocket, _ := core.GetMappingAmdMilanBmPlatformConfigNumaNodesPerSocketEnum(string(platformConfig.AmdMilanBmPlatformConfig.NumaNodesPerSocket)) + return core.AmdMilanBmPlatformConfig{ + IsSecureBootEnabled: platformConfig.AmdMilanBmPlatformConfig.IsSecureBootEnabled, + IsTrustedPlatformModuleEnabled: platformConfig.AmdMilanBmPlatformConfig.IsTrustedPlatformModuleEnabled, + IsMeasuredBootEnabled: platformConfig.AmdMilanBmPlatformConfig.IsMeasuredBootEnabled, + IsSymmetricMultiThreadingEnabled: platformConfig.AmdMilanBmPlatformConfig.IsSymmetricMultiThreadingEnabled, + IsAccessControlServiceEnabled: platformConfig.AmdMilanBmPlatformConfig.IsAccessControlServiceEnabled, + AreVirtualInstructionsEnabled: platformConfig.AmdMilanBmPlatformConfig.AreVirtualInstructionsEnabled, + IsInputOutputMemoryManagementUnitEnabled: platformConfig.AmdMilanBmPlatformConfig.IsInputOutputMemoryManagementUnitEnabled, + PercentageOfCoresEnabled: platformConfig.AmdMilanBmPlatformConfig.PercentageOfCoresEnabled, + NumaNodesPerSocket: numaNodesPerSocket, + } + default: + } } return nil } diff --git a/cloud/scope/machine_test.go b/cloud/scope/machine_test.go index 3720bfae..c6324284 100644 --- a/cloud/scope/machine_test.go +++ b/cloud/scope/machine_test.go @@ -20,6 +20,7 @@ import ( "context" "encoding/base64" "fmt" + "reflect" "testing" "github.com/oracle/cluster-api-provider-oci/cloud/services/networkloadbalancer/mock_nlb" @@ -317,19 +318,43 @@ func TestInstanceReconciliation(t *testing.T) { errorExpected: false, testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { setupAllParams(ms) + ms.OCIMachine.Spec.CapacityReservationId = common.String("cap-id") + ms.OCIMachine.Spec.DedicatedVmHostId = common.String("dedicated-host-id") + ms.OCIMachine.Spec.NetworkDetails.HostnameLabel = common.String("hostname-label") + ms.OCIMachine.Spec.NetworkDetails.SkipSourceDestCheck = common.Bool(true) + ms.OCIMachine.Spec.NetworkDetails.AssignPrivateDnsRecord = common.Bool(true) + ms.OCIMachine.Spec.NetworkDetails.DisplayName = common.String("display-name") + ms.OCIMachine.Spec.InstanceSourceViaImageDetails = &infrastructurev1beta1.InstanceSourceViaImageConfig{ + KmsKeyId: common.String("kms-key-id"), + BootVolumeVpusPerGB: common.Int64(32), + } computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ DisplayName: common.String("name"), CompartmentId: common.String("test"), })).Return(core.ListInstancesResponse{}, nil) launchDetails := core.LaunchInstanceDetails{DisplayName: common.String("name"), + CapacityReservationId: common.String("cap-id"), + DedicatedVmHostId: common.String("dedicated-host-id"), SourceDetails: core.InstanceSourceViaImageDetails{ ImageId: common.String("image"), BootVolumeSizeInGBs: common.Int64(120), + KmsKeyId: common.String("kms-key-id"), + BootVolumeVpusPerGB: common.Int64(32), }, CreateVnicDetails: &core.CreateVnicDetails{ SubnetId: common.String("nodesubnet"), AssignPublicIp: common.Bool(false), + DefinedTags: map[string]map[string]interface{}{}, + FreeformTags: map[string]string{ + ociutil.CreatedBy: ociutil.OCIClusterAPIProvider, + ociutil.ClusterResourceIdentifier: "resource_uid", + }, + NsgIds: make([]string, 0), + HostnameLabel: common.String("hostname-label"), + SkipSourceDestCheck: common.Bool(true), + AssignPrivateDnsRecord: common.Bool(true), + DisplayName: common.String("display-name"), }, Metadata: map[string]string{ "user_data": base64.StdEncoding.EncodeToString([]byte("test")), @@ -373,6 +398,12 @@ func TestInstanceReconciliation(t *testing.T) { CreateVnicDetails: &core.CreateVnicDetails{ SubnetId: common.String("nodesubnet"), AssignPublicIp: common.Bool(false), + DefinedTags: map[string]map[string]interface{}{}, + FreeformTags: map[string]string{ + ociutil.CreatedBy: ociutil.OCIClusterAPIProvider, + ociutil.ClusterResourceIdentifier: "resource_uid", + }, + NsgIds: make([]string, 0), }, Metadata: map[string]string{ "user_data": base64.StdEncoding.EncodeToString([]byte("test")), @@ -414,6 +445,12 @@ func TestInstanceReconciliation(t *testing.T) { CreateVnicDetails: &core.CreateVnicDetails{ SubnetId: common.String("nodesubnet"), AssignPublicIp: common.Bool(false), + DefinedTags: map[string]map[string]interface{}{}, + FreeformTags: map[string]string{ + ociutil.CreatedBy: ociutil.OCIClusterAPIProvider, + ociutil.ClusterResourceIdentifier: "resource_uid", + }, + NsgIds: make([]string, 0), }, Metadata: map[string]string{ "user_data": base64.StdEncoding.EncodeToString([]byte("test")), @@ -462,6 +499,12 @@ func TestInstanceReconciliation(t *testing.T) { CreateVnicDetails: &core.CreateVnicDetails{ SubnetId: common.String("test-subnet-1"), AssignPublicIp: common.Bool(false), + DefinedTags: map[string]map[string]interface{}{}, + FreeformTags: map[string]string{ + ociutil.CreatedBy: ociutil.OCIClusterAPIProvider, + ociutil.ClusterResourceIdentifier: "resource_uid", + }, + NsgIds: make([]string, 0), }, Metadata: map[string]string{ "user_data": base64.StdEncoding.EncodeToString([]byte("test")), @@ -513,7 +556,12 @@ func TestInstanceReconciliation(t *testing.T) { CreateVnicDetails: &core.CreateVnicDetails{ SubnetId: common.String("nodesubnet"), AssignPublicIp: common.Bool(false), - NsgIds: []string{"test-nsg-1"}, + DefinedTags: map[string]map[string]interface{}{}, + FreeformTags: map[string]string{ + ociutil.CreatedBy: ociutil.OCIClusterAPIProvider, + ociutil.ClusterResourceIdentifier: "resource_uid", + }, + NsgIds: []string{"test-nsg-1", "test-nsg-2"}, }, Metadata: map[string]string{ "user_data": base64.StdEncoding.EncodeToString([]byte("test")), @@ -566,7 +614,12 @@ func TestInstanceReconciliation(t *testing.T) { CreateVnicDetails: &core.CreateVnicDetails{ SubnetId: common.String("nodesubnet"), AssignPublicIp: common.Bool(false), - NsgIds: []string{"test-nsg-2"}, + DefinedTags: map[string]map[string]interface{}{}, + FreeformTags: map[string]string{ + ociutil.CreatedBy: ociutil.OCIClusterAPIProvider, + ociutil.ClusterResourceIdentifier: "resource_uid", + }, + NsgIds: []string{"test-nsg-2"}, }, Metadata: map[string]string{ "user_data": base64.StdEncoding.EncodeToString([]byte("test")), @@ -591,6 +644,355 @@ func TestInstanceReconciliation(t *testing.T) { OpcRetryToken: ociutil.GetOPCRetryToken("machineuid")})).Return(core.LaunchInstanceResponse{}, nil) }, }, + { + name: "check platform config amd vm", + errorExpected: false, + testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) + ms.OCIMachine.Spec.PlatformConfig = &infrastructurev1beta1.PlatformConfig{ + PlatformConfigType: infrastructurev1beta1.PlatformConfigTypeAmdvm, + AmdVmPlatformConfig: infrastructurev1beta1.AmdVmPlatformConfig{ + IsMeasuredBootEnabled: common.Bool(false), + IsTrustedPlatformModuleEnabled: common.Bool(true), + IsSecureBootEnabled: common.Bool(true), + }, + } + computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ + DisplayName: common.String("name"), + CompartmentId: common.String("test"), + })).Return(core.ListInstancesResponse{}, nil) + computeClient.EXPECT().LaunchInstance(gomock.Any(), Eq(func(request interface{}) error { + return platformConfigMatcher(request, core.AmdVmPlatformConfig{ + IsMeasuredBootEnabled: common.Bool(false), + IsTrustedPlatformModuleEnabled: common.Bool(true), + IsSecureBootEnabled: common.Bool(true), + }) + })).Return(core.LaunchInstanceResponse{}, nil) + }, + }, + { + name: "check platform config intel vm", + errorExpected: false, + testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) + ms.OCIMachine.Spec.PlatformConfig = &infrastructurev1beta1.PlatformConfig{ + PlatformConfigType: infrastructurev1beta1.PlatformConfigTypeIntelVm, + IntelVmPlatformConfig: infrastructurev1beta1.IntelVmPlatformConfig{ + IsMeasuredBootEnabled: common.Bool(false), + IsTrustedPlatformModuleEnabled: common.Bool(true), + IsSecureBootEnabled: common.Bool(true), + }, + } + computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ + DisplayName: common.String("name"), + CompartmentId: common.String("test"), + })).Return(core.ListInstancesResponse{}, nil) + computeClient.EXPECT().LaunchInstance(gomock.Any(), Eq(func(request interface{}) error { + return platformConfigMatcher(request, core.IntelVmPlatformConfig{ + IsMeasuredBootEnabled: common.Bool(false), + IsTrustedPlatformModuleEnabled: common.Bool(true), + IsSecureBootEnabled: common.Bool(true), + }) + })).Return(core.LaunchInstanceResponse{}, nil) + }, + }, + { + name: "check platform config amd rome bm", + errorExpected: false, + testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) + ms.OCIMachine.Spec.PlatformConfig = &infrastructurev1beta1.PlatformConfig{ + PlatformConfigType: infrastructurev1beta1.PlatformConfigTypeAmdRomeBm, + AmdRomeBmPlatformConfig: infrastructurev1beta1.AmdRomeBmPlatformConfig{ + IsMeasuredBootEnabled: common.Bool(false), + IsTrustedPlatformModuleEnabled: common.Bool(true), + IsSecureBootEnabled: common.Bool(true), + IsSymmetricMultiThreadingEnabled: common.Bool(false), + IsAccessControlServiceEnabled: common.Bool(true), + AreVirtualInstructionsEnabled: common.Bool(false), + IsInputOutputMemoryManagementUnitEnabled: common.Bool(false), + PercentageOfCoresEnabled: common.Int(50), + NumaNodesPerSocket: infrastructurev1beta1.AmdRomeBmPlatformConfigNumaNodesPerSocketNps4, + }, + } + computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ + DisplayName: common.String("name"), + CompartmentId: common.String("test"), + })).Return(core.ListInstancesResponse{}, nil) + computeClient.EXPECT().LaunchInstance(gomock.Any(), Eq(func(request interface{}) error { + return platformConfigMatcher(request, core.AmdRomeBmPlatformConfig{ + IsMeasuredBootEnabled: common.Bool(false), + IsTrustedPlatformModuleEnabled: common.Bool(true), + IsSecureBootEnabled: common.Bool(true), + IsSymmetricMultiThreadingEnabled: common.Bool(false), + IsAccessControlServiceEnabled: common.Bool(true), + AreVirtualInstructionsEnabled: common.Bool(false), + IsInputOutputMemoryManagementUnitEnabled: common.Bool(false), + PercentageOfCoresEnabled: common.Int(50), + NumaNodesPerSocket: core.AmdRomeBmPlatformConfigNumaNodesPerSocketNps4, + }) + })).Return(core.LaunchInstanceResponse{}, nil) + }, + }, + { + name: "check platform config amd rome gpu bm", + errorExpected: false, + testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) + ms.OCIMachine.Spec.PlatformConfig = &infrastructurev1beta1.PlatformConfig{ + PlatformConfigType: infrastructurev1beta1.PlatformConfigTypeAmdRomeBmGpu, + AmdRomeBmGpuPlatformConfig: infrastructurev1beta1.AmdRomeBmGpuPlatformConfig{ + IsMeasuredBootEnabled: common.Bool(false), + IsTrustedPlatformModuleEnabled: common.Bool(true), + IsSecureBootEnabled: common.Bool(true), + IsSymmetricMultiThreadingEnabled: common.Bool(false), + IsAccessControlServiceEnabled: common.Bool(true), + AreVirtualInstructionsEnabled: common.Bool(false), + IsInputOutputMemoryManagementUnitEnabled: common.Bool(false), + NumaNodesPerSocket: infrastructurev1beta1.AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps2, + }, + } + computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ + DisplayName: common.String("name"), + CompartmentId: common.String("test"), + })).Return(core.ListInstancesResponse{}, nil) + computeClient.EXPECT().LaunchInstance(gomock.Any(), Eq(func(request interface{}) error { + return platformConfigMatcher(request, core.AmdRomeBmGpuPlatformConfig{ + IsMeasuredBootEnabled: common.Bool(false), + IsTrustedPlatformModuleEnabled: common.Bool(true), + IsSecureBootEnabled: common.Bool(true), + IsSymmetricMultiThreadingEnabled: common.Bool(false), + IsAccessControlServiceEnabled: common.Bool(true), + AreVirtualInstructionsEnabled: common.Bool(false), + IsInputOutputMemoryManagementUnitEnabled: common.Bool(false), + NumaNodesPerSocket: core.AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps2, + }) + })).Return(core.LaunchInstanceResponse{}, nil) + }, + }, + { + name: "check platform config intel icelake bm", + errorExpected: false, + testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) + ms.OCIMachine.Spec.PlatformConfig = &infrastructurev1beta1.PlatformConfig{ + PlatformConfigType: infrastructurev1beta1.PlatformConfigTypeIntelIcelakeBm, + IntelIcelakeBmPlatformConfig: infrastructurev1beta1.IntelIcelakeBmPlatformConfig{ + IsMeasuredBootEnabled: common.Bool(false), + IsTrustedPlatformModuleEnabled: common.Bool(true), + IsSecureBootEnabled: common.Bool(true), + IsSymmetricMultiThreadingEnabled: common.Bool(false), + IsInputOutputMemoryManagementUnitEnabled: common.Bool(false), + PercentageOfCoresEnabled: common.Int(56), + NumaNodesPerSocket: infrastructurev1beta1.IntelIcelakeBmPlatformConfigNumaNodesPerSocketNps1, + }, + } + computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ + DisplayName: common.String("name"), + CompartmentId: common.String("test"), + })).Return(core.ListInstancesResponse{}, nil) + computeClient.EXPECT().LaunchInstance(gomock.Any(), Eq(func(request interface{}) error { + return platformConfigMatcher(request, core.IntelIcelakeBmPlatformConfig{ + IsMeasuredBootEnabled: common.Bool(false), + IsTrustedPlatformModuleEnabled: common.Bool(true), + IsSecureBootEnabled: common.Bool(true), + IsSymmetricMultiThreadingEnabled: common.Bool(false), + IsInputOutputMemoryManagementUnitEnabled: common.Bool(false), + PercentageOfCoresEnabled: common.Int(56), + NumaNodesPerSocket: core.IntelIcelakeBmPlatformConfigNumaNodesPerSocketNps1, + }) + })).Return(core.LaunchInstanceResponse{}, nil) + }, + }, + { + name: "check platform config intel skylake bm", + errorExpected: false, + testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) + ms.OCIMachine.Spec.PlatformConfig = &infrastructurev1beta1.PlatformConfig{ + PlatformConfigType: infrastructurev1beta1.PlatformConfigTypeIntelSkylakeBm, + IntelSkylakeBmPlatformConfig: infrastructurev1beta1.IntelSkylakeBmPlatformConfig{ + IsMeasuredBootEnabled: common.Bool(false), + IsTrustedPlatformModuleEnabled: common.Bool(true), + IsSecureBootEnabled: common.Bool(true), + }, + } + computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ + DisplayName: common.String("name"), + CompartmentId: common.String("test"), + })).Return(core.ListInstancesResponse{}, nil) + computeClient.EXPECT().LaunchInstance(gomock.Any(), Eq(func(request interface{}) error { + return platformConfigMatcher(request, core.IntelSkylakeBmPlatformConfig{ + IsMeasuredBootEnabled: common.Bool(false), + IsTrustedPlatformModuleEnabled: common.Bool(true), + IsSecureBootEnabled: common.Bool(true), + }) + })).Return(core.LaunchInstanceResponse{}, nil) + }, + }, + { + name: "check platform config amd milan bm", + errorExpected: false, + testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) + ms.OCIMachine.Spec.PlatformConfig = &infrastructurev1beta1.PlatformConfig{ + PlatformConfigType: infrastructurev1beta1.PlatformConfigTypeAmdMilanBm, + AmdMilanBmPlatformConfig: infrastructurev1beta1.AmdMilanBmPlatformConfig{ + IsMeasuredBootEnabled: common.Bool(false), + IsTrustedPlatformModuleEnabled: common.Bool(true), + IsSecureBootEnabled: common.Bool(true), + IsAccessControlServiceEnabled: common.Bool(true), + IsSymmetricMultiThreadingEnabled: common.Bool(false), + IsInputOutputMemoryManagementUnitEnabled: common.Bool(false), + AreVirtualInstructionsEnabled: common.Bool(true), + PercentageOfCoresEnabled: common.Int(56), + NumaNodesPerSocket: infrastructurev1beta1.AmdMilanBmPlatformConfigNumaNodesPerSocketNps1, + }, + } + computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ + DisplayName: common.String("name"), + CompartmentId: common.String("test"), + })).Return(core.ListInstancesResponse{}, nil) + computeClient.EXPECT().LaunchInstance(gomock.Any(), Eq(func(request interface{}) error { + return platformConfigMatcher(request, core.AmdMilanBmPlatformConfig{ + IsMeasuredBootEnabled: common.Bool(false), + IsTrustedPlatformModuleEnabled: common.Bool(true), + IsSecureBootEnabled: common.Bool(true), + IsAccessControlServiceEnabled: common.Bool(true), + IsSymmetricMultiThreadingEnabled: common.Bool(false), + IsInputOutputMemoryManagementUnitEnabled: common.Bool(false), + AreVirtualInstructionsEnabled: common.Bool(true), + PercentageOfCoresEnabled: common.Int(56), + NumaNodesPerSocket: core.AmdMilanBmPlatformConfigNumaNodesPerSocketNps1, + }) + })).Return(core.LaunchInstanceResponse{}, nil) + }, + }, + { + name: "agent config", + errorExpected: false, + testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) + ms.OCIMachine.Spec.AgentConfig = &infrastructurev1beta1.LaunchInstanceAgentConfig{ + IsMonitoringDisabled: common.Bool(false), + IsManagementDisabled: common.Bool(true), + AreAllPluginsDisabled: common.Bool(true), + PluginsConfig: []infrastructurev1beta1.InstanceAgentPluginConfig{ + { + Name: common.String("test-plugin"), + DesiredState: infrastructurev1beta1.InstanceAgentPluginConfigDetailsDesiredStateEnabled, + }, + }, + } + computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ + DisplayName: common.String("name"), + CompartmentId: common.String("test"), + })).Return(core.ListInstancesResponse{}, nil) + computeClient.EXPECT().LaunchInstance(gomock.Any(), Eq(func(request interface{}) error { + return agentConfigMatcher(request, &core.LaunchInstanceAgentConfigDetails{ + IsMonitoringDisabled: common.Bool(false), + IsManagementDisabled: common.Bool(true), + AreAllPluginsDisabled: common.Bool(true), + PluginsConfig: []core.InstanceAgentPluginConfigDetails{ + { + Name: common.String("test-plugin"), + DesiredState: core.InstanceAgentPluginConfigDetailsDesiredStateEnabled, + }, + }, + }) + })).Return(core.LaunchInstanceResponse{}, nil) + }, + }, + { + name: "launch options", + errorExpected: false, + testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) + ms.OCIMachine.Spec.LaunchOptions = &infrastructurev1beta1.LaunchOptions{ + BootVolumeType: infrastructurev1beta1.LaunchOptionsBootVolumeTypeIde, + Firmware: infrastructurev1beta1.LaunchOptionsFirmwareUefi64, + NetworkType: infrastructurev1beta1.LaunchOptionsNetworkTypeVfio, + RemoteDataVolumeType: infrastructurev1beta1.LaunchOptionsRemoteDataVolumeTypeIde, + IsConsistentVolumeNamingEnabled: common.Bool(true), + } + computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ + DisplayName: common.String("name"), + CompartmentId: common.String("test"), + })).Return(core.ListInstancesResponse{}, nil) + computeClient.EXPECT().LaunchInstance(gomock.Any(), Eq(func(request interface{}) error { + return launchOptionsMatcher(request, &core.LaunchOptions{ + BootVolumeType: core.LaunchOptionsBootVolumeTypeIde, + Firmware: core.LaunchOptionsFirmwareUefi64, + NetworkType: core.LaunchOptionsNetworkTypeVfio, + RemoteDataVolumeType: core.LaunchOptionsRemoteDataVolumeTypeIde, + IsConsistentVolumeNamingEnabled: common.Bool(true), + }) + })).Return(core.LaunchInstanceResponse{}, nil) + }, + }, + { + name: "instance options", + errorExpected: false, + testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) + ms.OCIMachine.Spec.InstanceOptions = &infrastructurev1beta1.InstanceOptions{ + AreLegacyImdsEndpointsDisabled: common.Bool(true), + } + computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ + DisplayName: common.String("name"), + CompartmentId: common.String("test"), + })).Return(core.ListInstancesResponse{}, nil) + computeClient.EXPECT().LaunchInstance(gomock.Any(), Eq(func(request interface{}) error { + return instanceOptionsMatcher(request, &core.InstanceOptions{ + AreLegacyImdsEndpointsDisabled: common.Bool(true), + }) + })).Return(core.LaunchInstanceResponse{}, nil) + }, + }, + { + name: "availability config", + errorExpected: false, + testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) + ms.OCIMachine.Spec.AvailabilityConfig = &infrastructurev1beta1.LaunchInstanceAvailabilityConfig{ + IsLiveMigrationPreferred: common.Bool(true), + RecoveryAction: infrastructurev1beta1.LaunchInstanceAvailabilityConfigDetailsRecoveryActionRestoreInstance, + } + computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ + DisplayName: common.String("name"), + CompartmentId: common.String("test"), + })).Return(core.ListInstancesResponse{}, nil) + computeClient.EXPECT().LaunchInstance(gomock.Any(), Eq(func(request interface{}) error { + return avalabilityConfigMatcher(request, &core.LaunchInstanceAvailabilityConfigDetails{ + IsLiveMigrationPreferred: common.Bool(true), + RecoveryAction: core.LaunchInstanceAvailabilityConfigDetailsRecoveryActionRestoreInstance, + }) + })).Return(core.LaunchInstanceResponse{}, nil) + }, + }, + { + name: "preemtible config", + errorExpected: false, + testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) + ms.OCIMachine.Spec.PreemptibleInstanceConfig = &infrastructurev1beta1.PreemptibleInstanceConfig{ + TerminatePreemptionAction: &infrastructurev1beta1.TerminatePreemptionAction{ + PreserveBootVolume: common.Bool(true), + }, + } + computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ + DisplayName: common.String("name"), + CompartmentId: common.String("test"), + })).Return(core.ListInstancesResponse{}, nil) + computeClient.EXPECT().LaunchInstance(gomock.Any(), Eq(func(request interface{}) error { + return preemtibleConfigMatcher(request, &core.PreemptibleInstanceConfigDetails{ + PreemptionAction: core.TerminatePreemptionAction{ + PreserveBootVolume: common.Bool(true), + }, + }) + })).Return(core.LaunchInstanceResponse{}, nil) + }, + }, } for _, tc := range tests { @@ -636,6 +1038,71 @@ func instanceCompartmentIDMatcher(request interface{}, matchStr string) error { return nil } +func platformConfigMatcher(actual interface{}, expected core.PlatformConfig) error { + r, ok := actual.(core.LaunchInstanceRequest) + if !ok { + return errors.New("expecting LaunchInstanceRequest type") + } + if !reflect.DeepEqual(r.PlatformConfig, expected) { + return errors.New(fmt.Sprintf("expecting %v, actual %v", expected, r.PlatformConfig)) + } + return nil +} +func agentConfigMatcher(actual interface{}, expected *core.LaunchInstanceAgentConfigDetails) error { + r, ok := actual.(core.LaunchInstanceRequest) + if !ok { + return errors.New("expecting LaunchInstanceRequest type") + } + if !reflect.DeepEqual(r.AgentConfig, expected) { + return errors.New(fmt.Sprintf("expecting %v, actual %v", expected, r.AgentConfig)) + } + return nil +} + +func launchOptionsMatcher(actual interface{}, expected *core.LaunchOptions) error { + r, ok := actual.(core.LaunchInstanceRequest) + if !ok { + return errors.New("expecting LaunchInstanceRequest type") + } + if !reflect.DeepEqual(r.LaunchOptions, expected) { + return errors.New(fmt.Sprintf("expecting %v, actual %v", expected, r.LaunchOptions)) + } + return nil +} + +func instanceOptionsMatcher(actual interface{}, expected *core.InstanceOptions) error { + r, ok := actual.(core.LaunchInstanceRequest) + if !ok { + return errors.New("expecting LaunchInstanceRequest type") + } + if !reflect.DeepEqual(r.InstanceOptions, expected) { + return errors.New(fmt.Sprintf("expecting %v, actual %v", expected, r.InstanceOptions)) + } + return nil +} + +func avalabilityConfigMatcher(actual interface{}, expected *core.LaunchInstanceAvailabilityConfigDetails) error { + r, ok := actual.(core.LaunchInstanceRequest) + if !ok { + return errors.New("expecting LaunchInstanceRequest type") + } + if !reflect.DeepEqual(r.AvailabilityConfig, expected) { + return errors.New(fmt.Sprintf("expecting %v, actual %v", expected, r.AvailabilityConfig)) + } + return nil +} + +func preemtibleConfigMatcher(actual interface{}, expected *core.PreemptibleInstanceConfigDetails) error { + r, ok := actual.(core.LaunchInstanceRequest) + if !ok { + return errors.New("expecting LaunchInstanceRequest type") + } + if !reflect.DeepEqual(r.PreemptibleInstanceConfig, expected) { + return errors.New(fmt.Sprintf("expecting %v, actual %v", expected, r.PreemptibleInstanceConfig)) + } + return nil +} + func TestLBReconciliationCreation(t *testing.T) { var ( ms *MachineScope diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachines.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachines.yaml index b96de517..9fa88c87 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachines.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachines.yaml @@ -38,13 +38,110 @@ spec: read the API https://docs.oracle.com/en-us/iaas/api/#/en/iaas/20160918/Instance/LaunchInstance for more information about the parameters below properties: + agentConfig: + description: LaunchInstanceAgentConfig defines the options for the + Oracle Cloud Agent software running on the instance. + properties: + areAllPluginsDisabled: + description: AreAllPluginsDisabled defines rhether Oracle Cloud + Agent can run all the available plugins. This includes the management + and monitoring plugins. To get a list of available plugins, + use the ListInstanceagentAvailablePlugins operation in the Oracle + Cloud Agent API. For more information about the available plugins, + see Managing Plugins with Oracle Cloud Agent (https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/manage-plugins.htm). + type: boolean + isManagementDisabled: + description: 'IsManagementDisabled defines whether Oracle Cloud + Agent can run all the available management plugins. Default + value is false (management plugins are enabled). These are the + management plugins: OS Management Service Agent and Compute + Instance Run Command. The management plugins are controlled + by this parameter and by the per-plugin configuration in the + `pluginsConfig` object. - If `isManagementDisabled` is true, + all of the management plugins are disabled, regardless of the + per-plugin configuration. - If `isManagementDisabled` is false, + all of the management plugins are enabled. You can optionally + disable individual management plugins by providing a value in + the `pluginsConfig` object.' + type: boolean + isMonitoringDisabled: + description: 'IsMonitoringDisabled defines whether Oracle Cloud + Agent can gather performance metrics and monitor the instance + using the monitoring plugins. Default value is false (monitoring + plugins are enabled). These are the monitoring plugins: Compute + Instance Monitoring and Custom Logs Monitoring. The monitoring + plugins are controlled by this parameter and by the per-plugin + configuration in the `pluginsConfig` object. - If `isMonitoringDisabled` + is true, all of the monitoring plugins are disabled, regardless + of the per-plugin configuration. - If `isMonitoringDisabled` + is false, all of the monitoring plugins are enabled. You can + optionally disable individual monitoring plugins by providing + a value in the `pluginsConfig` object.' + type: boolean + pluginsConfigs: + description: PluginsConfig defines the configuration of plugins + associated with this instance. + items: + description: InstanceAgentPluginConfig defines the configuration + of plugins associated with this instance. + properties: + desiredState: + description: DesiredState defines whether the plugin should + be enabled or disabled. To enable the monitoring and management + plugins, the `isMonitoringDisabled` and `isManagementDisabled` + attributes must also be set to false. + type: string + name: + description: Name defines the name of the plugin. To get + a list of available plugins, use the ListInstanceagentAvailablePlugins + operation in the Oracle Cloud Agent API. For more information + about the available plugins, see Managing Plugins with + Oracle Cloud Agent (https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/manage-plugins.htm). + type: string + type: object + type: array + type: object + availabilityConfig: + description: LaunchInstanceAvailabilityConfig defines the options + for VM migration during infrastructure maintenance events and for + defining the availability of a VM instance after a maintenance event + that impacts the underlying hardware. + properties: + isLiveMigrationPreferred: + description: IsLiveMigrationPreferred defines whether to live + migrate supported VM instances to a healthy physical VM host + without disrupting running instances during infrastructure maintenance + events. If null, Oracle chooses the best option for migrating + the VM during infrastructure maintenance events. + type: boolean + recoveryAction: + description: RecoveryAction defines the lifecycle state for an + instance when it is recovered after infrastructure maintenance. + * `RESTORE_INSTANCE` - The instance is restored to the lifecycle + state it was in before the maintenance event. If the instance + was running, it is automatically rebooted. This is the default + action when a value is not set. * `STOP_INSTANCE` - The instance + is recovered in the stopped state. + type: string + type: object bootVolumeSizeInGBs: description: The size of boot volume. Please see https://docs.oracle.com/en-us/iaas/Content/Block/Tasks/extendingbootpartition.htm to extend the boot volume size. type: string + capacityReservationId: + description: CapacityReservationId defines the OCID of the compute + capacity reservation this instance is launched under. You can opt + out of all default reservations by specifying an empty string as + input for this field. For more information, see Capacity Reservations + (https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/reserve-capacity.htm#default). + type: string compartmentId: description: Compartment to launch the instance in. type: string + dedicatedVmHostId: + description: DedicatedVmHostId defines the OCID of the dedicated VM + host. + type: string definedTags: additionalProperties: additionalProperties: @@ -66,10 +163,86 @@ spec: instanceId: description: OCID of launched compute instance. type: string + instanceOptions: + description: InstanceOptions defines the instance options + properties: + areLegacyImdsEndpointsDisabled: + description: Whether to disable the legacy (/v1) instance metadata + service endpoints. Customers who have migrated to /v2 should + set this to true for added security. Default is false. + type: boolean + type: object + instanceSourceViaImageConfig: + description: InstanceSourceViaImageConfig defines the options for + booting up instances via images + properties: + bootVolumeVpusPerGB: + description: 'BootVolumeVpusPerGB defines the number of volume + performance units (VPUs) that will be applied to this volume + per GB, representing the Block Volume service''s elastic performance + options. See Block Volume Performance Levels (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/blockvolumeperformance.htm#perf_levels) + for more information. Allowed values: * `10`: Represents Balanced + option. * `20`: Represents Higher Performance option. * + `30`-`120`: Represents the Ultra High Performance option. For + volumes with the auto-tuned performance feature enabled, this + is set to the default (minimum) VPUs/GB.' + format: int64 + type: integer + kmsKeyId: + description: KmsKeyId defines the OCID of the Key Management key + to assign as the master encryption key for the boot volume. + type: string + type: object + ipxeScript: + type: string isPvEncryptionInTransitEnabled: default: true description: Is in transit encryption of volumes required. type: boolean + launchOptions: + description: LaunchOptions defines the options for tuning the compatibility + and performance of VM shapes + properties: + bootVolumeType: + description: BootVolumeType defines Emulation type for the boot + volume. * `ISCSI` - ISCSI attached block storage device. * `SCSI` + - Emulated SCSI disk. * `IDE` - Emulated IDE disk. * `VFIO` + - Direct attached Virtual Function storage. This is the default + option for local data volumes on platform images. * `PARAVIRTUALIZED` + - Paravirtualized disk. This is the default for boot volumes + and remote block storage volumes on platform images. + type: string + firmware: + description: Firmware defines the firmware used to boot VM. Select + the option that matches your operating system. * `BIOS` - Boot + VM using BIOS style firmware. This is compatible with both 32 + bit and 64 bit operating systems that boot using MBR style bootloaders. + * `UEFI_64` - Boot VM using UEFI style firmware compatible with + 64 bit operating systems. This is the default for platform images. + type: string + isConsistentVolumeNamingEnabled: + description: IsConsistentVolumeNamingEnabled defines whether to + enable consistent volume naming feature. Defaults to false. + type: boolean + networkType: + description: NetworkType defines the emulation type for the physical + network interface card (NIC). * `E1000` - Emulated Gigabit ethernet + controller. Compatible with Linux e1000 network driver. * `VFIO` + - Direct attached Virtual Function network controller. This + is the networking type when you launch an instance using hardware-assisted + (SR-IOV) networking. * `PARAVIRTUALIZED` - VM instances launch + with paravirtualized devices using VirtIO drivers. + type: string + remoteDataVolumeType: + description: RemoteDataVolumeType defines the emulation type for + volume. * `ISCSI` - ISCSI attached block storage device. * `SCSI` + - Emulated SCSI disk. * `IDE` - Emulated IDE disk. * `VFIO` + - Direct attached Virtual Function storage. This is the default + option for local data volumes on platform images. * `PARAVIRTUALIZED` + - Paravirtualized disk. This is the default for boot volumes + and remote block storage volumes on platform images. + type: string + type: object metadata: additionalProperties: type: string @@ -77,22 +250,333 @@ spec: as the SSH public key required to connect to the instance. type: object networkDetails: - description: PrimaryNetworkInterface is required to specify subnet. + description: NetworkDetails defines the configuration options for + the network properties: + assignPrivateDnsRecord: + description: AssignPrivateDnsRecord defines whether the VNIC should + be assigned a DNS record. + type: boolean assignPublicIp: + description: AssignPublicIp defines whether the instance should + have a public IP address type: boolean + displayName: + description: DisplayName defines a user-friendly name. Does not + have to be unique, and it's changeable. Avoid entering confidential + information. + type: string + hostnameLabel: + description: HostnameLabel defines the hostname for the VNIC's + primary private IP. Used for DNS. + type: string nsgId: + description: "Deprecated, use \tNsgNames parameter to define the + NSGs" type: string + nsgNames: + description: NsgNames defines a list of the nsg names of the network + security groups (NSGs) to add the VNIC to. + items: + type: string + type: array + skipSourceDestCheck: + description: SkipSourceDestCheck defines whether the source/destination + check is disabled on the VNIC. + type: boolean subnetId: + description: SubnetId defines the ID of the subnet to use. Deprecated, + use SubnetName parameter type: string subnetName: + description: SubnetName defines the subnet name to use for the + VNIC type: string type: object nsgName: description: The name of NSG to use. The name here refers to the NSGs defined in the OCICluster Spec. Optional, only if multiple NSGs - of a type is defined, else the first element is used. + of a type is defined, else the first element is used. Deprecated, + please use NetworkDetails.NSGNames type: string + platformConfig: + description: InstanceSourceViaImageConfig defines the platform config + parameters + properties: + PlatformConfigType: + description: The type of platform configuration. Valid values + are * `AMD_ROME_BM_GPU` * `AMD_ROME_BM` * `INTEL_ICELAKE_BM` + * `AMD_VM` * `INTEL_VM` * `INTEL_SKYLAKE_BM` * `AMD_MILAN_BM` + Based on the enum, exactly one of the specific configuration + types must be set + type: string + amdMilanBmPlatformConfig: + description: AmdMilanBmPlatformConfig describe AMD Milan BM platform + configuration + properties: + areVirtualInstructionsEnabled: + description: Whether virtualization instructions are available. + For example, Secure Virtual Machine for AMD shapes or VT-x + for Intel shapes. + type: boolean + isAccessControlServiceEnabled: + description: Whether the Access Control Service is enabled + on the instance. When enabled, the platform can enforce + PCIe device isolation, required for VFIO device pass-through. + type: boolean + isInputOutputMemoryManagementUnitEnabled: + description: Whether the input-output memory management unit + is enabled. + type: boolean + isMeasuredBootEnabled: + description: Whether the Measured Boot feature is enabled + on the instance. + type: boolean + isSecureBootEnabled: + description: Whether Secure Boot is enabled on the instance. + type: boolean + isSymmetricMultiThreadingEnabled: + description: Whether symmetric multithreading is enabled on + the instance. Symmetric multithreading is also called simultaneous + multithreading (SMT) or Intel Hyper-Threading. Intel and + AMD processors have two hardware execution threads per core + (OCPU). SMT permits multiple independent threads of execution, + to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread + is permitted to run on each core, which can provide higher + or more predictable performance for some workloads. + type: boolean + isTrustedPlatformModuleEnabled: + description: Whether the Trusted Platform Module (TPM) is + enabled on the instance. + type: boolean + numaNodesPerSocket: + description: The number of NUMA nodes per socket (NPS). + type: string + percentageOfCoresEnabled: + description: The percentage of cores enabled. Value must be + a multiple of 25%. If the requested percentage results in + a fractional number of cores, the system rounds up the number + of cores across processors and provisions an instance with + a whole number of cores. If the applications that you run + on the instance use a core-based licensing model and need + fewer cores than the full size of the shape, you can disable + cores to reduce your licensing costs. The instance itself + is billed for the full shape, regardless of whether all + cores are enabled. + type: integer + type: object + amdRomeBmGpuPlatformConfig: + description: AmdMilanBmPlatformConfig describe AMD Rome BM platform + configuration + properties: + areVirtualInstructionsEnabled: + description: Whether virtualization instructions are available. + For example, Secure Virtual Machine for AMD shapes or VT-x + for Intel shapes. + type: boolean + isAccessControlServiceEnabled: + description: Whether the Access Control Service is enabled + on the instance. When enabled, the platform can enforce + PCIe device isolation, required for VFIO device pass-through. + type: boolean + isInputOutputMemoryManagementUnitEnabled: + description: Whether the input-output memory management unit + is enabled. + type: boolean + isMeasuredBootEnabled: + description: Whether the Measured Boot feature is enabled + on the instance. + type: boolean + isSecureBootEnabled: + description: Whether Secure Boot is enabled on the instance. + type: boolean + isSymmetricMultiThreadingEnabled: + description: Whether symmetric multithreading is enabled on + the instance. Symmetric multithreading is also called simultaneous + multithreading (SMT) or Intel Hyper-Threading. Intel and + AMD processors have two hardware execution threads per core + (OCPU). SMT permits multiple independent threads of execution, + to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread + is permitted to run on each core, which can provide higher + or more predictable performance for some workloads. + type: boolean + isTrustedPlatformModuleEnabled: + description: Whether the Trusted Platform Module (TPM) is + enabled on the instance. + type: boolean + numaNodesPerSocket: + description: The number of NUMA nodes per socket (NPS). + type: string + type: object + amdRomeBmPlatformConfig: + description: AmdMilanBmPlatformConfig describe AMD Rome BM platform + configuration + properties: + areVirtualInstructionsEnabled: + description: Whether virtualization instructions are available. + For example, Secure Virtual Machine for AMD shapes or VT-x + for Intel shapes. + type: boolean + isAccessControlServiceEnabled: + description: Whether the Access Control Service is enabled + on the instance. When enabled, the platform can enforce + PCIe device isolation, required for VFIO device pass-through. + type: boolean + isInputOutputMemoryManagementUnitEnabled: + description: Whether the input-output memory management unit + is enabled. + type: boolean + isMeasuredBootEnabled: + description: Whether the Measured Boot feature is enabled + on the instance. + type: boolean + isSecureBootEnabled: + description: Whether Secure Boot is enabled on the instance. + type: boolean + isSymmetricMultiThreadingEnabled: + description: Whether symmetric multithreading is enabled on + the instance. Symmetric multithreading is also called simultaneous + multithreading (SMT) or Intel Hyper-Threading. Intel and + AMD processors have two hardware execution threads per core + (OCPU). SMT permits multiple independent threads of execution, + to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread + is permitted to run on each core, which can provide higher + or more predictable performance for some workloads. + type: boolean + isTrustedPlatformModuleEnabled: + description: Whether the Trusted Platform Module (TPM) is + enabled on the instance. + type: boolean + numaNodesPerSocket: + description: The number of NUMA nodes per socket (NPS). + type: string + percentageOfCoresEnabled: + description: The percentage of cores enabled. Value must be + a multiple of 25%. If the requested percentage results in + a fractional number of cores, the system rounds up the number + of cores across processors and provisions an instance with + a whole number of cores. If the applications that you run + on the instance use a core-based licensing model and need + fewer cores than the full size of the shape, you can disable + cores to reduce your licensing costs. The instance itself + is billed for the full shape, regardless of whether all + cores are enabled. + type: integer + type: object + amdVmPlatformConfig: + description: AmdMilanBmPlatformConfig describe AMD VM platform + configuration + properties: + isMeasuredBootEnabled: + description: Whether the Measured Boot feature is enabled + on the instance. + type: boolean + isSecureBootEnabled: + description: Whether Secure Boot is enabled on the instance. + type: boolean + isTrustedPlatformModuleEnabled: + description: Whether the Trusted Platform Module (TPM) is + enabled on the instance. + type: boolean + type: object + intelIcelakeBmPlatformConfig: + description: AmdMilanBmPlatformConfig describe Intel Skylke BM + platform configuration + properties: + isInputOutputMemoryManagementUnitEnabled: + description: Whether the input-output memory management unit + is enabled. + type: boolean + isMeasuredBootEnabled: + description: Whether the Measured Boot feature is enabled + on the instance. + type: boolean + isSecureBootEnabled: + description: Whether Secure Boot is enabled on the instance. + type: boolean + isSymmetricMultiThreadingEnabled: + description: Whether symmetric multithreading is enabled on + the instance. Symmetric multithreading is also called simultaneous + multithreading (SMT) or Intel Hyper-Threading. Intel and + AMD processors have two hardware execution threads per core + (OCPU). SMT permits multiple independent threads of execution, + to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only one thread + is permitted to run on each core, which can provide higher + or more predictable performance for some workloads. + type: boolean + isTrustedPlatformModuleEnabled: + description: Whether the Trusted Platform Module (TPM) is + enabled on the instance. + type: boolean + numaNodesPerSocket: + description: The number of NUMA nodes per socket (NPS). + type: string + percentageOfCoresEnabled: + description: The percentage of cores enabled. Value must be + a multiple of 25%. If the requested percentage results in + a fractional number of cores, the system rounds up the number + of cores across processors and provisions an instance with + a whole number of cores. If the applications that you run + on the instance use a core-based licensing model and need + fewer cores than the full size of the shape, you can disable + cores to reduce your licensing costs. The instance itself + is billed for the full shape, regardless of whether all + cores are enabled. + type: integer + type: object + intelSkylakeBmPlatformConfig: + description: AmdMilanBmPlatformConfig describe Intel Skylke BM + platform configuration + properties: + isMeasuredBootEnabled: + description: Whether the Measured Boot feature is enabled + on the instance. + type: boolean + isSecureBootEnabled: + description: Whether Secure Boot is enabled on the instance. + type: boolean + isTrustedPlatformModuleEnabled: + description: Whether the Trusted Platform Module (TPM) is + enabled on the instance. + type: boolean + type: object + intelVmPlatformConfig: + description: AmdMilanBmPlatformConfig describe Intel VM platform + configuration + properties: + isMeasuredBootEnabled: + description: Whether the Measured Boot feature is enabled + on the instance. + type: boolean + isSecureBootEnabled: + description: Whether Secure Boot is enabled on the instance. + type: boolean + isTrustedPlatformModuleEnabled: + description: Whether the Trusted Platform Module (TPM) is + enabled on the instance. + type: boolean + type: object + type: object + preemptibleInstanceConfig: + description: PreemptibleInstanceConfig Configuration options for preemptible + instances. + properties: + terminatePreemptionAction: + description: TerminatePreemptionAction Terminates the preemptible + instance when it is interrupted for eviction. + properties: + preserveBootVolume: + description: PreserveBootVolume defines whether to preserve + the boot volume that was used to launch the preemptible + instance when the instance is terminated. Defaults to false + if not specified. + type: boolean + type: object + type: object providerID: description: Provider ID of the instance, this will be set by Cluster API provider itself, users should not set this parameter. @@ -117,6 +601,10 @@ spec: description: The total amount of memory available to the instance, in gigabytes. type: string + nvmes: + description: Nvmes defines the number of NVMe drives to be used + for storage. A single drive has 6.8 TB available. + type: integer ocpus: description: The total number of OCPUs available to the instance. type: string diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinetemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinetemplates.yaml index e02ef8b8..1f3f2f07 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinetemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinetemplates.yaml @@ -47,13 +47,116 @@ spec: description: Spec is the specification of the desired behavior of the machine. properties: + agentConfig: + description: LaunchInstanceAgentConfig defines the options + for the Oracle Cloud Agent software running on the instance. + properties: + areAllPluginsDisabled: + description: AreAllPluginsDisabled defines rhether Oracle + Cloud Agent can run all the available plugins. This + includes the management and monitoring plugins. To get + a list of available plugins, use the ListInstanceagentAvailablePlugins + operation in the Oracle Cloud Agent API. For more information + about the available plugins, see Managing Plugins with + Oracle Cloud Agent (https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/manage-plugins.htm). + type: boolean + isManagementDisabled: + description: 'IsManagementDisabled defines whether Oracle + Cloud Agent can run all the available management plugins. + Default value is false (management plugins are enabled). + These are the management plugins: OS Management Service + Agent and Compute Instance Run Command. The management + plugins are controlled by this parameter and by the + per-plugin configuration in the `pluginsConfig` object. + - If `isManagementDisabled` is true, all of the management + plugins are disabled, regardless of the per-plugin configuration. + - If `isManagementDisabled` is false, all of the management + plugins are enabled. You can optionally disable individual + management plugins by providing a value in the `pluginsConfig` + object.' + type: boolean + isMonitoringDisabled: + description: 'IsMonitoringDisabled defines whether Oracle + Cloud Agent can gather performance metrics and monitor + the instance using the monitoring plugins. Default value + is false (monitoring plugins are enabled). These are + the monitoring plugins: Compute Instance Monitoring + and Custom Logs Monitoring. The monitoring plugins are + controlled by this parameter and by the per-plugin configuration + in the `pluginsConfig` object. - If `isMonitoringDisabled` + is true, all of the monitoring plugins are disabled, + regardless of the per-plugin configuration. - If `isMonitoringDisabled` + is false, all of the monitoring plugins are enabled. + You can optionally disable individual monitoring plugins + by providing a value in the `pluginsConfig` object.' + type: boolean + pluginsConfigs: + description: PluginsConfig defines the configuration of + plugins associated with this instance. + items: + description: InstanceAgentPluginConfig defines the configuration + of plugins associated with this instance. + properties: + desiredState: + description: DesiredState defines whether the plugin + should be enabled or disabled. To enable the monitoring + and management plugins, the `isMonitoringDisabled` + and `isManagementDisabled` attributes must also + be set to false. + type: string + name: + description: Name defines the name of the plugin. + To get a list of available plugins, use the ListInstanceagentAvailablePlugins + operation in the Oracle Cloud Agent API. For more + information about the available plugins, see Managing + Plugins with Oracle Cloud Agent (https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/manage-plugins.htm). + type: string + type: object + type: array + type: object + availabilityConfig: + description: LaunchInstanceAvailabilityConfig defines the + options for VM migration during infrastructure maintenance + events and for defining the availability of a VM instance + after a maintenance event that impacts the underlying hardware. + properties: + isLiveMigrationPreferred: + description: IsLiveMigrationPreferred defines whether + to live migrate supported VM instances to a healthy + physical VM host without disrupting running instances + during infrastructure maintenance events. If null, Oracle + chooses the best option for migrating the VM during + infrastructure maintenance events. + type: boolean + recoveryAction: + description: RecoveryAction defines the lifecycle state + for an instance when it is recovered after infrastructure + maintenance. * `RESTORE_INSTANCE` - The instance is + restored to the lifecycle state it was in before the + maintenance event. If the instance was running, it is + automatically rebooted. This is the default action when + a value is not set. * `STOP_INSTANCE` - The instance + is recovered in the stopped state. + type: string + type: object bootVolumeSizeInGBs: description: The size of boot volume. Please see https://docs.oracle.com/en-us/iaas/Content/Block/Tasks/extendingbootpartition.htm to extend the boot volume size. type: string + capacityReservationId: + description: CapacityReservationId defines the OCID of the + compute capacity reservation this instance is launched under. + You can opt out of all default reservations by specifying + an empty string as input for this field. For more information, + see Capacity Reservations (https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/reserve-capacity.htm#default). + type: string compartmentId: description: Compartment to launch the instance in. type: string + dedicatedVmHostId: + description: DedicatedVmHostId defines the OCID of the dedicated + VM host. + type: string definedTags: additionalProperties: additionalProperties: @@ -75,10 +178,96 @@ spec: instanceId: description: OCID of launched compute instance. type: string + instanceOptions: + description: InstanceOptions defines the instance options + properties: + areLegacyImdsEndpointsDisabled: + description: Whether to disable the legacy (/v1) instance + metadata service endpoints. Customers who have migrated + to /v2 should set this to true for added security. Default + is false. + type: boolean + type: object + instanceSourceViaImageConfig: + description: InstanceSourceViaImageConfig defines the options + for booting up instances via images + properties: + bootVolumeVpusPerGB: + description: 'BootVolumeVpusPerGB defines the number of + volume performance units (VPUs) that will be applied + to this volume per GB, representing the Block Volume + service''s elastic performance options. See Block Volume + Performance Levels (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/blockvolumeperformance.htm#perf_levels) + for more information. Allowed values: * `10`: Represents + Balanced option. * `20`: Represents Higher Performance + option. * `30`-`120`: Represents the Ultra High Performance + option. For volumes with the auto-tuned performance + feature enabled, this is set to the default (minimum) + VPUs/GB.' + format: int64 + type: integer + kmsKeyId: + description: KmsKeyId defines the OCID of the Key Management + key to assign as the master encryption key for the boot + volume. + type: string + type: object + ipxeScript: + type: string isPvEncryptionInTransitEnabled: default: true description: Is in transit encryption of volumes required. type: boolean + launchOptions: + description: LaunchOptions defines the options for tuning + the compatibility and performance of VM shapes + properties: + bootVolumeType: + description: BootVolumeType defines Emulation type for + the boot volume. * `ISCSI` - ISCSI attached block storage + device. * `SCSI` - Emulated SCSI disk. * `IDE` - Emulated + IDE disk. * `VFIO` - Direct attached Virtual Function + storage. This is the default option for local data volumes + on platform images. * `PARAVIRTUALIZED` - Paravirtualized + disk. This is the default for boot volumes and remote + block storage volumes on platform images. + type: string + firmware: + description: Firmware defines the firmware used to boot + VM. Select the option that matches your operating system. + * `BIOS` - Boot VM using BIOS style firmware. This is + compatible with both 32 bit and 64 bit operating systems + that boot using MBR style bootloaders. * `UEFI_64` - + Boot VM using UEFI style firmware compatible with 64 + bit operating systems. This is the default for platform + images. + type: string + isConsistentVolumeNamingEnabled: + description: IsConsistentVolumeNamingEnabled defines whether + to enable consistent volume naming feature. Defaults + to false. + type: boolean + networkType: + description: NetworkType defines the emulation type for + the physical network interface card (NIC). * `E1000` + - Emulated Gigabit ethernet controller. Compatible with + Linux e1000 network driver. * `VFIO` - Direct attached + Virtual Function network controller. This is the networking + type when you launch an instance using hardware-assisted + (SR-IOV) networking. * `PARAVIRTUALIZED` - VM instances + launch with paravirtualized devices using VirtIO drivers. + type: string + remoteDataVolumeType: + description: RemoteDataVolumeType defines the emulation + type for volume. * `ISCSI` - ISCSI attached block storage + device. * `SCSI` - Emulated SCSI disk. * `IDE` - Emulated + IDE disk. * `VFIO` - Direct attached Virtual Function + storage. This is the default option for local data volumes + on platform images. * `PARAVIRTUALIZED` - Paravirtualized + disk. This is the default for boot volumes and remote + block storage volumes on platform images. + type: string + type: object metadata: additionalProperties: type: string @@ -86,24 +275,355 @@ spec: such as the SSH public key required to connect to the instance. type: object networkDetails: - description: PrimaryNetworkInterface is required to specify - subnet. + description: NetworkDetails defines the configuration options + for the network properties: + assignPrivateDnsRecord: + description: AssignPrivateDnsRecord defines whether the + VNIC should be assigned a DNS record. + type: boolean assignPublicIp: + description: AssignPublicIp defines whether the instance + should have a public IP address type: boolean + displayName: + description: DisplayName defines a user-friendly name. + Does not have to be unique, and it's changeable. Avoid + entering confidential information. + type: string + hostnameLabel: + description: HostnameLabel defines the hostname for the + VNIC's primary private IP. Used for DNS. + type: string nsgId: + description: "Deprecated, use \tNsgNames parameter to + define the NSGs" type: string + nsgNames: + description: NsgNames defines a list of the nsg names + of the network security groups (NSGs) to add the VNIC + to. + items: + type: string + type: array + skipSourceDestCheck: + description: SkipSourceDestCheck defines whether the source/destination + check is disabled on the VNIC. + type: boolean subnetId: + description: SubnetId defines the ID of the subnet to + use. Deprecated, use SubnetName parameter type: string subnetName: + description: SubnetName defines the subnet name to use + for the VNIC type: string type: object nsgName: description: The name of NSG to use. The name here refers to the NSGs defined in the OCICluster Spec. Optional, only if multiple NSGs of a type is defined, else the first element - is used. + is used. Deprecated, please use NetworkDetails.NSGNames type: string + platformConfig: + description: InstanceSourceViaImageConfig defines the platform + config parameters + properties: + PlatformConfigType: + description: The type of platform configuration. Valid + values are * `AMD_ROME_BM_GPU` * `AMD_ROME_BM` * `INTEL_ICELAKE_BM` + * `AMD_VM` * `INTEL_VM` * `INTEL_SKYLAKE_BM` * `AMD_MILAN_BM` + Based on the enum, exactly one of the specific configuration + types must be set + type: string + amdMilanBmPlatformConfig: + description: AmdMilanBmPlatformConfig describe AMD Milan + BM platform configuration + properties: + areVirtualInstructionsEnabled: + description: Whether virtualization instructions are + available. For example, Secure Virtual Machine for + AMD shapes or VT-x for Intel shapes. + type: boolean + isAccessControlServiceEnabled: + description: Whether the Access Control Service is + enabled on the instance. When enabled, the platform + can enforce PCIe device isolation, required for + VFIO device pass-through. + type: boolean + isInputOutputMemoryManagementUnitEnabled: + description: Whether the input-output memory management + unit is enabled. + type: boolean + isMeasuredBootEnabled: + description: Whether the Measured Boot feature is + enabled on the instance. + type: boolean + isSecureBootEnabled: + description: Whether Secure Boot is enabled on the + instance. + type: boolean + isSymmetricMultiThreadingEnabled: + description: Whether symmetric multithreading is enabled + on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel + Hyper-Threading. Intel and AMD processors have two + hardware execution threads per core (OCPU). SMT + permits multiple independent threads of execution, + to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only + one thread is permitted to run on each core, which + can provide higher or more predictable performance + for some workloads. + type: boolean + isTrustedPlatformModuleEnabled: + description: Whether the Trusted Platform Module (TPM) + is enabled on the instance. + type: boolean + numaNodesPerSocket: + description: The number of NUMA nodes per socket (NPS). + type: string + percentageOfCoresEnabled: + description: The percentage of cores enabled. Value + must be a multiple of 25%. If the requested percentage + results in a fractional number of cores, the system + rounds up the number of cores across processors + and provisions an instance with a whole number of + cores. If the applications that you run on the instance + use a core-based licensing model and need fewer + cores than the full size of the shape, you can disable + cores to reduce your licensing costs. The instance + itself is billed for the full shape, regardless + of whether all cores are enabled. + type: integer + type: object + amdRomeBmGpuPlatformConfig: + description: AmdMilanBmPlatformConfig describe AMD Rome + BM platform configuration + properties: + areVirtualInstructionsEnabled: + description: Whether virtualization instructions are + available. For example, Secure Virtual Machine for + AMD shapes or VT-x for Intel shapes. + type: boolean + isAccessControlServiceEnabled: + description: Whether the Access Control Service is + enabled on the instance. When enabled, the platform + can enforce PCIe device isolation, required for + VFIO device pass-through. + type: boolean + isInputOutputMemoryManagementUnitEnabled: + description: Whether the input-output memory management + unit is enabled. + type: boolean + isMeasuredBootEnabled: + description: Whether the Measured Boot feature is + enabled on the instance. + type: boolean + isSecureBootEnabled: + description: Whether Secure Boot is enabled on the + instance. + type: boolean + isSymmetricMultiThreadingEnabled: + description: Whether symmetric multithreading is enabled + on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel + Hyper-Threading. Intel and AMD processors have two + hardware execution threads per core (OCPU). SMT + permits multiple independent threads of execution, + to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only + one thread is permitted to run on each core, which + can provide higher or more predictable performance + for some workloads. + type: boolean + isTrustedPlatformModuleEnabled: + description: Whether the Trusted Platform Module (TPM) + is enabled on the instance. + type: boolean + numaNodesPerSocket: + description: The number of NUMA nodes per socket (NPS). + type: string + type: object + amdRomeBmPlatformConfig: + description: AmdMilanBmPlatformConfig describe AMD Rome + BM platform configuration + properties: + areVirtualInstructionsEnabled: + description: Whether virtualization instructions are + available. For example, Secure Virtual Machine for + AMD shapes or VT-x for Intel shapes. + type: boolean + isAccessControlServiceEnabled: + description: Whether the Access Control Service is + enabled on the instance. When enabled, the platform + can enforce PCIe device isolation, required for + VFIO device pass-through. + type: boolean + isInputOutputMemoryManagementUnitEnabled: + description: Whether the input-output memory management + unit is enabled. + type: boolean + isMeasuredBootEnabled: + description: Whether the Measured Boot feature is + enabled on the instance. + type: boolean + isSecureBootEnabled: + description: Whether Secure Boot is enabled on the + instance. + type: boolean + isSymmetricMultiThreadingEnabled: + description: Whether symmetric multithreading is enabled + on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel + Hyper-Threading. Intel and AMD processors have two + hardware execution threads per core (OCPU). SMT + permits multiple independent threads of execution, + to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only + one thread is permitted to run on each core, which + can provide higher or more predictable performance + for some workloads. + type: boolean + isTrustedPlatformModuleEnabled: + description: Whether the Trusted Platform Module (TPM) + is enabled on the instance. + type: boolean + numaNodesPerSocket: + description: The number of NUMA nodes per socket (NPS). + type: string + percentageOfCoresEnabled: + description: The percentage of cores enabled. Value + must be a multiple of 25%. If the requested percentage + results in a fractional number of cores, the system + rounds up the number of cores across processors + and provisions an instance with a whole number of + cores. If the applications that you run on the instance + use a core-based licensing model and need fewer + cores than the full size of the shape, you can disable + cores to reduce your licensing costs. The instance + itself is billed for the full shape, regardless + of whether all cores are enabled. + type: integer + type: object + amdVmPlatformConfig: + description: AmdMilanBmPlatformConfig describe AMD VM + platform configuration + properties: + isMeasuredBootEnabled: + description: Whether the Measured Boot feature is + enabled on the instance. + type: boolean + isSecureBootEnabled: + description: Whether Secure Boot is enabled on the + instance. + type: boolean + isTrustedPlatformModuleEnabled: + description: Whether the Trusted Platform Module (TPM) + is enabled on the instance. + type: boolean + type: object + intelIcelakeBmPlatformConfig: + description: AmdMilanBmPlatformConfig describe Intel Skylke + BM platform configuration + properties: + isInputOutputMemoryManagementUnitEnabled: + description: Whether the input-output memory management + unit is enabled. + type: boolean + isMeasuredBootEnabled: + description: Whether the Measured Boot feature is + enabled on the instance. + type: boolean + isSecureBootEnabled: + description: Whether Secure Boot is enabled on the + instance. + type: boolean + isSymmetricMultiThreadingEnabled: + description: Whether symmetric multithreading is enabled + on the instance. Symmetric multithreading is also + called simultaneous multithreading (SMT) or Intel + Hyper-Threading. Intel and AMD processors have two + hardware execution threads per core (OCPU). SMT + permits multiple independent threads of execution, + to better use the resources and increase the efficiency + of the CPU. When multithreading is disabled, only + one thread is permitted to run on each core, which + can provide higher or more predictable performance + for some workloads. + type: boolean + isTrustedPlatformModuleEnabled: + description: Whether the Trusted Platform Module (TPM) + is enabled on the instance. + type: boolean + numaNodesPerSocket: + description: The number of NUMA nodes per socket (NPS). + type: string + percentageOfCoresEnabled: + description: The percentage of cores enabled. Value + must be a multiple of 25%. If the requested percentage + results in a fractional number of cores, the system + rounds up the number of cores across processors + and provisions an instance with a whole number of + cores. If the applications that you run on the instance + use a core-based licensing model and need fewer + cores than the full size of the shape, you can disable + cores to reduce your licensing costs. The instance + itself is billed for the full shape, regardless + of whether all cores are enabled. + type: integer + type: object + intelSkylakeBmPlatformConfig: + description: AmdMilanBmPlatformConfig describe Intel Skylke + BM platform configuration + properties: + isMeasuredBootEnabled: + description: Whether the Measured Boot feature is + enabled on the instance. + type: boolean + isSecureBootEnabled: + description: Whether Secure Boot is enabled on the + instance. + type: boolean + isTrustedPlatformModuleEnabled: + description: Whether the Trusted Platform Module (TPM) + is enabled on the instance. + type: boolean + type: object + intelVmPlatformConfig: + description: AmdMilanBmPlatformConfig describe Intel VM + platform configuration + properties: + isMeasuredBootEnabled: + description: Whether the Measured Boot feature is + enabled on the instance. + type: boolean + isSecureBootEnabled: + description: Whether Secure Boot is enabled on the + instance. + type: boolean + isTrustedPlatformModuleEnabled: + description: Whether the Trusted Platform Module (TPM) + is enabled on the instance. + type: boolean + type: object + type: object + preemptibleInstanceConfig: + description: PreemptibleInstanceConfig Configuration options + for preemptible instances. + properties: + terminatePreemptionAction: + description: TerminatePreemptionAction Terminates the + preemptible instance when it is interrupted for eviction. + properties: + preserveBootVolume: + description: PreserveBootVolume defines whether to + preserve the boot volume that was used to launch + the preemptible instance when the instance is terminated. + Defaults to false if not specified. + type: boolean + type: object + type: object providerID: description: Provider ID of the instance, this will be set by Cluster API provider itself, users should not set this @@ -130,6 +650,10 @@ spec: description: The total amount of memory available to the instance, in gigabytes. type: string + nvmes: + description: Nvmes defines the number of NVMe drives to + be used for storage. A single drive has 6.8 TB available. + type: integer ocpus: description: The total number of OCPUs available to the instance. diff --git a/test/e2e/cluster_test.go b/test/e2e/cluster_test.go index 51b79dd7..c50b83ca 100644 --- a/test/e2e/cluster_test.go +++ b/test/e2e/cluster_test.go @@ -261,7 +261,7 @@ var _ = Describe("Workload cluster creation", func() { namespace: metav1.NamespaceDefault, replicas: int32(1), selector: map[string]string{"app": "nginx"}, - storageClassName: "oci-bv", + storageClassName: "oci-bv-encrypted", volumeName: "nginx-volumes", svcName: "nginx-svc", svcPort: int32(80), diff --git a/test/e2e/data/infrastructure-oci/v1beta1/bases/ccm.yaml b/test/e2e/data/infrastructure-oci/v1beta1/bases/ccm.yaml index 3179812d..53e3fe01 100644 --- a/test/e2e/data/infrastructure-oci/v1beta1/bases/ccm.yaml +++ b/test/e2e/data/infrastructure-oci/v1beta1/bases/ccm.yaml @@ -99,7 +99,7 @@ data: args: - --cloud-config=/etc/oci/cloud-provider.yaml - --cloud-provider=oci - - --leader-elect-resource-lock=configmaps + - --leader-elect-resource-lock=configmapsleases - --v=2 volumeMounts: - name: cfg @@ -194,6 +194,17 @@ data: - list - watch - update + - apiGroups: + - "coordination.k8s.io" + resources: + - leases + verbs: + - get + - create + - update + - delete + - patch + - watch - apiGroups: - "" @@ -315,7 +326,7 @@ data: node-role.kubernetes.io/control-plane: "" containers: - name: csi-volume-provisioner - image: k8s.gcr.io/sig-storage/csi-provisioner:v3.1.0 + image: k8s.gcr.io/sig-storage/csi-provisioner:v3.2.1 args: - --csi-address=/var/run/shared-tmpfs/csi.sock - --volume-name-prefix=csi @@ -330,7 +341,7 @@ data: - mountPath: /var/run/shared-tmpfs name: shared-tmpfs - name: csi-attacher - image: k8s.gcr.io/sig-storage/csi-attacher:v3.4.0 + image: k8s.gcr.io/sig-storage/csi-attacher:v3.5.0 args: - --csi-address=/var/run/shared-tmpfs/csi.sock - --timeout=120s @@ -343,7 +354,7 @@ data: - mountPath: /var/run/shared-tmpfs name: shared-tmpfs - name: csi-resizer - image: k8s.gcr.io/sig-storage/csi-resizer:v1.4.0 + image: k8s.gcr.io/sig-storage/csi-resizer:v1.5.0 args: - --csi-address=/var/run/shared-tmpfs/csi.sock - --leader-election @@ -534,7 +545,7 @@ data: args: - --csi-address=/csi/csi.sock - --kubelet-registration-path=/var/lib/kubelet/plugins/blockvolume.csi.oraclecloud.com/csi.sock - image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.5.0 + image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.5.1 securityContext: privileged: true lifecycle: @@ -677,6 +688,33 @@ data: kind: ClusterRole name: csi-oci apiGroup: rbac.authorization.k8s.io + --- + kind: StorageClass + apiVersion: storage.k8s.io/v1 + metadata: + name: oci + provisioner: oracle.com/oci + --- + apiVersion: storage.k8s.io/v1 + kind: StorageClass + metadata: + name: oci-bv + provisioner: blockvolume.csi.oraclecloud.com + volumeBindingMode: WaitForFirstConsumer + allowVolumeExpansion: true + reclaimPolicy: Delete + --- + apiVersion: storage.k8s.io/v1 + kind: StorageClass + metadata: + name: oci-bv-encrypted + provisioner: blockvolume.csi.oraclecloud.com + parameters: + attachment-type: "paravirtualized" + reclaimPolicy: Delete + volumeBindingMode: WaitForFirstConsumer + allowVolumeExpansion: true + --- kind: ConfigMap metadata: annotations: