diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 03748e909..f893e0e92 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: hooks: - id: shellcheck - repo: https://github.com/crate-ci/typos - rev: v1.17.2 + rev: v1.28.1 hooks: - id: typos - repo: https://github.com/pre-commit/pre-commit-hooks diff --git a/go.mod b/go.mod index 3b2d0b3c3..18fbeb261 100644 --- a/go.mod +++ b/go.mod @@ -32,6 +32,7 @@ require ( github.com/stretchr/testify v1.9.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 + gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.29.3 k8s.io/apiextensions-apiserver v0.29.3 k8s.io/apimachinery v0.29.3 @@ -146,7 +147,6 @@ require ( google.golang.org/protobuf v1.34.2 // indirect gopkg.in/dnaeon/go-vcr.v3 v3.2.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/cloud-provider v0.29.3 // indirect k8s.io/component-base v0.29.3 // indirect diff --git a/hack/codegen.sh b/hack/codegen.sh index 664dd23d1..8d179f2a0 100755 --- a/hack/codegen.sh +++ b/hack/codegen.sh @@ -32,7 +32,7 @@ skugen() { NO_UPDATE=" pkg/fake/zz_generated.sku.$location.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)" SUBJECT="SKUGEN" - go run hack/code/instancetype_testdata_gen.go -- "${GENERATED_FILE}" "$location" "Standard_B1s,Standard_A0,Standard_D2_v2,Standard_D2_v3,Standard_DS2_v2,Standard_D2s_v3,Standard_D2_v5,Standard_D16plds_v5,Standard_F16s_v2,Standard_NC6s,Standard_NC6s_v3,Standard_NC16as_T4_v3,Standard_NC24ads_A100_v4,Standard_M8-2ms,Standard_D4s_v3,Standard_D64s_v3,Standard_DC8s_v3" + go run hack/code/instancetype_testdata_gen.go -- "${GENERATED_FILE}" "$location" "Standard_B1s,Standard_A0,Standard_D2_v2,Standard_D2_v3,Standard_DS2_v2,Standard_D2s_v3,Standard_D2_v5,Standard_D16plds_v5,Standard_F16s_v2,Standard_NC6s,Standard_NC6s_v3,Standard_NC16as_T4_v3,Standard_NC24ads_A100_v4,Standard_M8-2ms,Standard_D4s_v3,Standard_D64s_v3,Standard_DC8s_v3,Standard_D2as_v6" go fmt "${GENERATED_FILE}" GIT_DIFF=$(git diff --stat "${GENERATED_FILE}") diff --git a/pkg/fake/zz_generated.sku.eastus.go b/pkg/fake/zz_generated.sku.eastus.go index a36d2186a..0cc25d4ef 100644 --- a/pkg/fake/zz_generated.sku.eastus.go +++ b/pkg/fake/zz_generated.sku.eastus.go @@ -24,7 +24,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute" ) -// generated at 2024-01-12T06:16:27Z +// generated at 2024-12-13T00:09:51Z func init() { // ResourceSkus is a list of selected VM SKUs for a given region @@ -70,6 +70,11 @@ func init() { {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("1")}, {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("50")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("1")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("1000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("20971520")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("10485760")}, + {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("1600")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("24000000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -96,6 +101,7 @@ func init() { {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("1")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("1")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, @@ -142,6 +148,7 @@ func init() { {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("16")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("32")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("32")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("Arm64")}, @@ -173,6 +180,53 @@ func init() { }, }, }, + { + Name: lo.ToPtr("Standard_D2as_v6"), + Tier: lo.ToPtr("Standard"), + Kind: lo.ToPtr(""), + Size: lo.ToPtr("D2as_v6"), + Family: lo.ToPtr("standardDav6Family"), + ResourceType: lo.ToPtr("virtualMachines"), + APIVersions: &[]string{}, + Costs: &[]compute.ResourceSkuCosts{}, + Restrictions: &[]compute.ResourceSkuRestrictions{}, + Capabilities: &[]compute.ResourceSkuCapabilities{ + {Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("0")}, + {Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")}, + {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("2")}, + {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V2")}, + {Name: lo.ToPtr("DiskControllerTypes"), Value: lo.ToPtr("NVMe")}, + {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("8")}, + {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("4")}, + {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, + {Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS")}, + {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("2")}, + {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("230")}, + {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("9000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("125000000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("125000000")}, + {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("4000")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("90000000")}, + {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")}, + {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, + {Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")}, + {Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("2")}, + }, + Locations: &[]string{"eastus"}, + LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr("eastus"), Zones: &[]string{ + "1", + "2", + "3", + }, + }, + }, + }, { Name: lo.ToPtr("Standard_D2s_v3"), Tier: lo.ToPtr("Standard"), @@ -189,6 +243,7 @@ func init() { {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("8")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("4")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, @@ -199,11 +254,11 @@ func init() { {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("160")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("4000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("33554432")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("33554432")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("32768000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("32768000")}, {Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("53687091200")}, {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("3200")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("50331648")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("48000000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -246,8 +301,10 @@ func init() { {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("210")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("1")}, {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("6000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("97517568")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("48234496")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("98304000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("49152000")}, + {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("6400")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("96000000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -290,8 +347,10 @@ func init() { {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("160")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("3000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("48234496")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("24117248")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("49152000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("24576000")}, + {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("3200")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("48000000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -332,11 +391,11 @@ func init() { {Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS")}, {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("19000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("131072000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("131072000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("9000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("125000000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("125000000")}, {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("3750")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("89128960")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("85000000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -369,6 +428,7 @@ func init() { {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("4")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("16")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("8")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, @@ -379,11 +439,11 @@ func init() { {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("160")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("8000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("67108864")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("67108864")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("65536000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("65536000")}, {Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("107374182400")}, {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("6400")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("100663296")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("96000000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -416,6 +476,7 @@ func init() { {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("64")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("256")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("32")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, @@ -426,11 +487,11 @@ func init() { {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("160")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("128000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("1073741824")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("1073741824")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("1048576000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("1048576000")}, {Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("1717986918400")}, {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("80000")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("1258291200")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("1200000000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -474,8 +535,8 @@ func init() { {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("77000")}, {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("77000000000")}, {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("77000000000")}, - {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("25600")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("384000000")}, + {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("12800")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("201326592")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -506,6 +567,7 @@ func init() { {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("7")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("8")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, @@ -553,6 +615,7 @@ func init() { {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("16")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("32")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("32")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, @@ -609,11 +672,12 @@ func init() { }, }, Capabilities: &[]compute.ResourceSkuCapabilities{ - {Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("256000")}, + {Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("262144")}, {Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")}, {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("8")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("218.75")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("8")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, @@ -626,11 +690,11 @@ func init() { {Name: lo.ToPtr("ParentSize"), Value: lo.ToPtr("Standard_M8ms")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("10000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("104857600")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("104857600")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("100000000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("100000000")}, {Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("851477266432")}, {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("5000")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("131072000")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("125000000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -664,6 +728,7 @@ func init() { {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("16")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("110")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("32")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, @@ -673,12 +738,12 @@ func init() { {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("16")}, {Name: lo.ToPtr("GPUs"), Value: lo.ToPtr("1")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("1")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("16320")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("251658240")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("251658240")}, - {Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("154619000000")}, - {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("24480")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("368640000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("32000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("503316480")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("503316480")}, + {Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("154618822656")}, + {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("48000")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("737280000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -711,6 +776,7 @@ func init() { {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("24")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("220")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("8")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, @@ -720,13 +786,14 @@ func init() { {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("24")}, {Name: lo.ToPtr("GPUs"), Value: lo.ToPtr("1")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("1")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("75000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("1000000000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("1000000000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("32000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("256000000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("256000000")}, {Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("274877906944")}, - {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("25600")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("384000000")}, - {Name: lo.ToPtr("NvmeDiskSizeInMiB"), Value: lo.ToPtr("915456")}, + {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("30000")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("1024000000")}, + {Name: lo.ToPtr("NvmeDiskSizeInMiB"), Value: lo.ToPtr("915527")}, + {Name: lo.ToPtr("NvmeSizePerDiskInMiB"), Value: lo.ToPtr("915527")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -736,7 +803,7 @@ func init() { }, Locations: &[]string{"eastus"}, LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr("eastus"), Zones: &[]string{ - "1", + "3", }, }, }, @@ -768,11 +835,12 @@ func init() { }, }, Capabilities: &[]compute.ResourceSkuCapabilities{ - {Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("344064")}, + {Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("753664")}, {Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")}, {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("6")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("112")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("12")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, @@ -782,6 +850,12 @@ func init() { {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("6")}, {Name: lo.ToPtr("GPUs"), Value: lo.ToPtr("1")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("1")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("24000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("210763776")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("210763776")}, + {Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("343597383680")}, + {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("20000")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("300000000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, diff --git a/pkg/fake/zz_generated.sku.westcentralus.go b/pkg/fake/zz_generated.sku.westcentralus.go index a37c219d5..dea4c94f4 100644 --- a/pkg/fake/zz_generated.sku.westcentralus.go +++ b/pkg/fake/zz_generated.sku.westcentralus.go @@ -24,7 +24,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute" ) -// generated at 2023-12-18T15:29:11Z +// generated at 2024-12-13T00:09:53Z func init() { // ResourceSkus is a list of selected VM SKUs for a given region @@ -66,6 +66,11 @@ func init() { {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("1")}, {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("50")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("1")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("1000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("20971520")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("10485760")}, + {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("1600")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("24000000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -92,6 +97,7 @@ func init() { {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("1")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("1")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, @@ -116,6 +122,89 @@ func init() { Locations: &[]string{"westcentralus"}, LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr("westcentralus"), Zones: &[]string{}}}, }, + { + Name: lo.ToPtr("Standard_D16plds_v5"), + Tier: lo.ToPtr("Standard"), + Kind: lo.ToPtr(""), + Size: lo.ToPtr("D16plds_v5"), + Family: lo.ToPtr("standardDPLDSv5Family"), + ResourceType: lo.ToPtr("virtualMachines"), + APIVersions: &[]string{}, + Costs: &[]compute.ResourceSkuCosts{}, + Restrictions: &[]compute.ResourceSkuRestrictions{}, + Capabilities: &[]compute.ResourceSkuCapabilities{ + {Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("614400")}, + {Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")}, + {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("16")}, + {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, + {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("32")}, + {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("32")}, + {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("Arm64")}, + {Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS")}, + {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("16")}, + {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("1")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("75000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("1000000000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("1000000000")}, + {Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("429496729600")}, + {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("25600")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("600000000")}, + {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, + {Name: lo.ToPtr("TrustedLaunchDisabled"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")}, + {Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("4")}, + }, + Locations: &[]string{"westcentralus"}, + LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr("westcentralus"), Zones: &[]string{}}}, + }, + { + Name: lo.ToPtr("Standard_D2as_v6"), + Tier: lo.ToPtr("Standard"), + Kind: lo.ToPtr(""), + Size: lo.ToPtr("D2as_v6"), + Family: lo.ToPtr("standardDav6Family"), + ResourceType: lo.ToPtr("virtualMachines"), + APIVersions: &[]string{}, + Costs: &[]compute.ResourceSkuCosts{}, + Restrictions: &[]compute.ResourceSkuRestrictions{}, + Capabilities: &[]compute.ResourceSkuCapabilities{ + {Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("0")}, + {Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")}, + {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("2")}, + {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V2")}, + {Name: lo.ToPtr("DiskControllerTypes"), Value: lo.ToPtr("NVMe")}, + {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("8")}, + {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("4")}, + {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, + {Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS")}, + {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("2")}, + {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("230")}, + {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("9000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("125000000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("125000000")}, + {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("4000")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("90000000")}, + {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")}, + {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, + {Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")}, + {Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")}, + {Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("2")}, + }, + Locations: &[]string{"westcentralus"}, + LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr("westcentralus"), Zones: &[]string{}}}, + }, { Name: lo.ToPtr("Standard_D2s_v3"), Tier: lo.ToPtr("Standard"), @@ -132,6 +221,7 @@ func init() { {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("8")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("4")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, @@ -142,11 +232,11 @@ func init() { {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("160")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("4000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("33554432")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("33554432")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("32768000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("32768000")}, {Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("53687091200")}, {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("3200")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("50331648")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("48000000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -183,8 +273,10 @@ func init() { {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("210")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("1")}, {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("6000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("97517568")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("48234496")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("98304000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("49152000")}, + {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("6400")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("96000000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -221,8 +313,10 @@ func init() { {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("160")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("3000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("48234496")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("24117248")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("49152000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("24576000")}, + {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("3200")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("48000000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -257,11 +351,11 @@ func init() { {Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS")}, {Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("19000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("131072000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("131072000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("9000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("125000000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("125000000")}, {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("3750")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("89128960")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("85000000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -288,6 +382,7 @@ func init() { {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("4")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("16")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("8")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, @@ -298,11 +393,11 @@ func init() { {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("160")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("8000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("67108864")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("67108864")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("65536000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("65536000")}, {Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("107374182400")}, {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("6400")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("100663296")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("96000000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -329,6 +424,7 @@ func init() { {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("64")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("256")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("32")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, @@ -339,11 +435,11 @@ func init() { {Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("160")}, {Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("128000")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("1073741824")}, - {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("1073741824")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("1048576000")}, + {Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("1048576000")}, {Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("1717986918400")}, {Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("80000")}, - {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("1258291200")}, + {Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("1200000000")}, {Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")}, @@ -370,6 +466,7 @@ func init() { {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("2")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("7")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("8")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, @@ -411,6 +508,7 @@ func init() { {Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("16")}, {Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")}, {Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")}, + {Name: lo.ToPtr("SupportedEphemeralOSDiskPlacements"), Value: lo.ToPtr("ResourceDisk,CacheDisk")}, {Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("32")}, {Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("32")}, {Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")}, diff --git a/pkg/providers/imagefamily/azlinux.go b/pkg/providers/imagefamily/azlinux.go index f4f4beff4..d5e6dd315 100644 --- a/pkg/providers/imagefamily/azlinux.go +++ b/pkg/providers/imagefamily/azlinux.go @@ -84,9 +84,9 @@ func (u AzureLinux) UserData(kubeletConfig *corev1beta1.KubeletConfiguration, ta CABundle: caBundle, GPUNode: u.Options.GPUNode, GPUDriverVersion: u.Options.GPUDriverVersion, - // GPUImageSHA: u.Options.GPUImageSHA - GPU image SHA only applies to Ubuntu - // See: https://github.com/Azure/AgentBaker/blob/f393d6e4d689d9204d6000c85623ad9b764e2a29/vhdbuilder/packer/install-dependencies.sh#L201 - SubnetID: u.Options.SubnetID, + GPUDriverType: u.Options.GPUDriverType, + GPUImageSHA: u.Options.GPUImageSHA, + SubnetID: u.Options.SubnetID, }, Arch: u.Options.Arch, TenantID: u.Options.TenantID, diff --git a/pkg/providers/imagefamily/bootstrap/aksbootstrap.go b/pkg/providers/imagefamily/bootstrap/aksbootstrap.go index eda48311b..180da8981 100644 --- a/pkg/providers/imagefamily/bootstrap/aksbootstrap.go +++ b/pkg/providers/imagefamily/bootstrap/aksbootstrap.go @@ -205,6 +205,7 @@ type NodeBootstrapVariables struct { SwapFileSizeMB int // t user input GPUImageSHA string // s static sha rarely updated GPUDriverVersion string // k determine by OS + GPU hardware requirements; can be determined automatically, but hard. suggest using GPU operator. + GPUDriverType string // k GPUInstanceProfile string // t user-specified CustomSearchDomainName string // c user-specified [presumably cluster-level] CustomSearchRealmUser string // c user-specified [presumably cluster-level] @@ -468,6 +469,7 @@ func (a AKS) applyOptions(nbv *NodeBootstrapVariables) { nbv.GPUNode = true nbv.ConfigGPUDriverIfNeeded = true nbv.GPUDriverVersion = a.GPUDriverVersion + nbv.GPUDriverType = a.GPUDriverType nbv.GPUImageSHA = a.GPUImageSHA } diff --git a/pkg/providers/imagefamily/bootstrap/bootstrap.go b/pkg/providers/imagefamily/bootstrap/bootstrap.go index 2bf1fab8d..afeb28589 100644 --- a/pkg/providers/imagefamily/bootstrap/bootstrap.go +++ b/pkg/providers/imagefamily/bootstrap/bootstrap.go @@ -31,6 +31,7 @@ type Options struct { CABundle *string GPUNode bool GPUDriverVersion string + GPUDriverType string GPUImageSHA string SubnetID string } diff --git a/pkg/providers/imagefamily/bootstrap/cse_cmd.sh.gtpl b/pkg/providers/imagefamily/bootstrap/cse_cmd.sh.gtpl index 00e032f24..a480c88fc 100644 --- a/pkg/providers/imagefamily/bootstrap/cse_cmd.sh.gtpl +++ b/pkg/providers/imagefamily/bootstrap/cse_cmd.sh.gtpl @@ -128,6 +128,7 @@ KUBELET_CONFIG_FILE_CONTENT="{{.KubeletConfigFileContent}}" SWAP_FILE_SIZE_MB="{{.SwapFileSizeMB}}" GPU_IMAGE_SHA="{{.GPUImageSHA}}" GPU_DRIVER_VERSION="{{.GPUDriverVersion}}" +GPU_DRIVER_TYPE="{{.GPUDriverType}}" GPU_INSTANCE_PROFILE="{{.GPUInstanceProfile}}" CUSTOM_SEARCH_DOMAIN_NAME="{{.CustomSearchDomainName}}" CUSTOM_SEARCH_REALM_USER="{{.CustomSearchRealmUser}}" diff --git a/pkg/providers/imagefamily/ubuntu_2204.go b/pkg/providers/imagefamily/ubuntu_2204.go index 4542fbef7..baa6159b4 100644 --- a/pkg/providers/imagefamily/ubuntu_2204.go +++ b/pkg/providers/imagefamily/ubuntu_2204.go @@ -85,6 +85,7 @@ func (u Ubuntu2204) UserData(kubeletConfig *corev1beta1.KubeletConfiguration, ta GPUNode: u.Options.GPUNode, GPUDriverVersion: u.Options.GPUDriverVersion, GPUImageSHA: u.Options.GPUImageSHA, + GPUDriverType: u.Options.GPUDriverType, SubnetID: u.Options.SubnetID, }, Arch: u.Options.Arch, diff --git a/pkg/providers/instancetype/instancetypes.go b/pkg/providers/instancetype/instancetypes.go index 8e2addb5b..3752637bc 100644 --- a/pkg/providers/instancetype/instancetypes.go +++ b/pkg/providers/instancetype/instancetypes.go @@ -29,6 +29,7 @@ import ( "github.com/mitchellh/hashstructure/v2" "github.com/samber/lo" + "github.com/Azure/azure-sdk-for-go/profiles/latest/compute/mgmt/compute" "github.com/Azure/go-autorest/autorest/to" "github.com/Azure/karpenter-provider-azure/pkg/apis/v1alpha2" kcache "github.com/Azure/karpenter-provider-azure/pkg/cache" @@ -212,7 +213,8 @@ func (p *Provider) getInstanceTypes(ctx context.Context) (map[string]*skewer.SKU continue } - if !skus[i].HasLocationRestriction(p.region) && p.isSupported(&skus[i], vmsize) { + useSIG := false // replace with options.FromContext(ctx).UseSIG when available + if !skus[i].HasLocationRestriction(p.region) && p.isSupported(&skus[i], vmsize, useSIG) { instanceTypes[skus[i].GetName()] = &skus[i] } } @@ -229,13 +231,14 @@ func (p *Provider) getInstanceTypes(ctx context.Context) (map[string]*skewer.SKU } // isSupported indicates SKU is supported by AKS, based on SKU properties -func (p *Provider) isSupported(sku *skewer.SKU, vmsize *skewer.VMSizeType) bool { +func (p *Provider) isSupported(sku *skewer.SKU, vmsize *skewer.VMSizeType, useSIG bool) bool { return p.hasMinimumCPU(sku) && p.hasMinimumMemory(sku) && !p.isUnsupportedByAKS(sku) && !p.isUnsupportedGPU(sku) && !p.hasConstrainedCPUs(vmsize) && - !p.isConfidential(sku) + !p.isConfidential(sku) && + isCompatibleImageAvailable(sku, useSIG) } // at least 2 cpus @@ -344,3 +347,15 @@ var ( func hasZonalSupport(region string) bool { return zonalRegions.Has(region) } + +func isCompatibleImageAvailable(sku *skewer.SKU, useSIG bool) bool { + hasSCSISupport := func(sku *skewer.SKU) bool { // TODO: move capability determination to skewer + const diskControllerTypeCapability = "DiskControllerTypes" + declaresSCSI := sku.HasCapabilityWithSeparator(diskControllerTypeCapability, string(compute.SCSI)) + declaresNVMe := sku.HasCapabilityWithSeparator(diskControllerTypeCapability, string(compute.NVMe)) + declaresNothing := !(declaresSCSI || declaresNVMe) + return declaresSCSI || declaresNothing // if nothing is declared, assume SCSI is supported + } + + return useSIG || hasSCSISupport(sku) // CIG images are not currently tagged for NVMe +} diff --git a/pkg/providers/instancetype/suite_test.go b/pkg/providers/instancetype/suite_test.go index a1108f87d..157f450b3 100644 --- a/pkg/providers/instancetype/suite_test.go +++ b/pkg/providers/instancetype/suite_test.go @@ -348,6 +348,9 @@ var _ = Describe("InstanceType Provider", func() { It("should not include confidential SKUs", func() { Expect(instanceTypes).ShouldNot(ContainElement(WithTransform(getName, Equal("Standard_DC8s_v3")))) }) + It("should not include SKUs without compatible image", func() { + Expect(instanceTypes).ShouldNot(ContainElement(WithTransform(getName, Equal("Standard_D2as_v6")))) + }) }) Context("Filtering GPU SKUs ProviderList(AzureLinux)", func() { var instanceTypes corecloudprovider.InstanceTypes @@ -648,12 +651,10 @@ var _ = Describe("InstanceType Provider", func() { nodes := &v1.NodeList{} Expect(env.Client.List(ctx, nodes)).To(Succeed()) for _, node := range nodes.Items { - Expect(node.Labels["karpenter.k8s.azure/zone"]).ToNot(Equal(fmt.Sprintf("%s-1", fake.Region))) + Expect(node.Labels["karpenter.kubernetes.azure/zone"]).ToNot(Equal(fmt.Sprintf("%s-1", fake.Region))) Expect(node.Labels["node.kubernetes.io/instance-type"]).To(Equal("Standard_D2_v2")) - } } - }) DescribeTable("Should not return unavailable offerings", func(azEnv *test.Environment) { @@ -699,7 +700,7 @@ var _ = Describe("InstanceType Provider", func() { }}} ExpectProvisioned(ctx, env.Client, cluster, cloudProvider, coreProvisioner, pod) node := ExpectScheduled(ctx, env.Client, pod) - Expect(node.Labels["karpenter.k8s.azure/zone"]).ToNot(Equal(fmt.Sprintf("%s-1", fake.Region))) + Expect(node.Labels["karpenter.kubernetes.azure/zone"]).ToNot(Equal(fmt.Sprintf("%s-1", fake.Region))) Expect(node.Labels["node.kubernetes.io/instance-type"]).To(Equal("Standard_D2_v2")) }) It("should launch smaller instances than optimal if larger instance launch results in Insufficient Capacity Error", func() { @@ -1055,7 +1056,7 @@ var _ = Describe("InstanceType Provider", func() { ExpectApplied(ctx, env.Client, nodePool, nodeClass) pod := coretest.UnschedulablePod(coretest.PodOptions{}) ExpectProvisioned(ctx, env.Client, cluster, cloudProvider, coreProvisioner, pod) - ExpectScheduled(ctx, env.Client, pod) + node := ExpectScheduled(ctx, env.Client, pod) Expect(azureEnv.VirtualMachinesAPI.VirtualMachineCreateOrUpdateBehavior.CalledWithInput.Len()).To(Equal(1)) vm := azureEnv.VirtualMachinesAPI.VirtualMachineCreateOrUpdateBehavior.CalledWithInput.Pop().VM @@ -1063,12 +1064,7 @@ var _ = Describe("InstanceType Provider", func() { Expect(vm.Properties.HardwareProfile).ToNot(BeNil()) Expect(utils.IsNvidiaEnabledSKU(string(*vm.Properties.HardwareProfile.VMSize))).To(BeFalse()) - clusterNodes := cluster.Nodes() - node := clusterNodes[0] - if node.Name() == pod.Spec.NodeName { - nodeLabels := node.Labels() - Expect(nodeLabels).To(HaveKeyWithValue("karpenter.k8s.azure/sku-gpu-count", "0")) - } + Expect(node.Labels).To(HaveKeyWithValue("karpenter.azure.com/sku-gpu-count", "0")) }) It("should schedule GPU pod on GPU capable node", func() { @@ -1098,23 +1094,31 @@ var _ = Describe("InstanceType Provider", func() { }) ExpectProvisioned(ctx, env.Client, cluster, cloudProvider, coreProvisioner, pod) - ExpectScheduled(ctx, env.Client, pod) - - // Verify that the node has the GPU label set that the pod was scheduled on - clusterNodes := cluster.Nodes() - Expect(clusterNodes).ToNot(BeEmpty()) - Expect(len(clusterNodes)).To(Equal(1)) - node := clusterNodes[0] - Expect(node.Node.Status.Allocatable).To(HaveKeyWithValue(v1.ResourceName("nvidia.com/gpu"), resource.MustParse("1"))) + node := ExpectScheduled(ctx, env.Client, pod) - if node.Name() == pod.Spec.NodeName { - nodeLabels := node.Labels() + // the following checks assume Standard_NC16as_T4_v3 (surprisingly the cheapest GPU in the test set), so test the assumption + Expect(node.Labels).To(HaveKeyWithValue("node.kubernetes.io/instance-type", "Standard_NC16as_T4_v3")) - Expect(nodeLabels).To(HaveKeyWithValue("karpenter.k8s.azure/sku-gpu-name", "A100")) - Expect(nodeLabels).To(HaveKeyWithValue("karpenter.k8s.azure/sku-gpu-manufacturer", v1alpha2.ManufacturerNvidia)) - Expect(nodeLabels).To(HaveKeyWithValue("karpenter.k8s.azure/sku-gpu-count", "1")) + // Verify GPU related settings in bootstrap (assuming one Standard_NC16as_T4_v3) + customData := ExpectDecodedCustomData(azureEnv) + Expect(customData).To(SatisfyAll( + ContainSubstring("GPU_NODE=true"), + ContainSubstring("SGX_NODE=false"), + ContainSubstring("MIG_NODE=false"), + ContainSubstring("CONFIG_GPU_DRIVER_IF_NEEDED=true"), + ContainSubstring("ENABLE_GPU_DEVICE_PLUGIN_IF_NEEDED=false"), + ContainSubstring("GPU_DRIVER_TYPE=\"cuda\""), + ContainSubstring(fmt.Sprintf("GPU_DRIVER_VERSION=\"%s\"", utils.NvidiaCudaDriverVersion)), + ContainSubstring(fmt.Sprintf("GPU_IMAGE_SHA=\"%s\"", utils.AKSGPUCudaVersionSuffix)), + ContainSubstring("GPU_NEEDS_FABRIC_MANAGER=\"false\""), + ContainSubstring("GPU_INSTANCE_PROFILE=\"\""), + )) - } + // Verify that the node the pod was scheduled on has GPU resource and labels set + Expect(node.Status.Allocatable).To(HaveKeyWithValue(v1.ResourceName("nvidia.com/gpu"), resource.MustParse("1"))) + Expect(node.Labels).To(HaveKeyWithValue("karpenter.azure.com/sku-gpu-name", "T4")) + Expect(node.Labels).To(HaveKeyWithValue("karpenter.azure.com/sku-gpu-manufacturer", v1alpha2.ManufacturerNvidia)) + Expect(node.Labels).To(HaveKeyWithValue("karpenter.azure.com/sku-gpu-count", "1")) }) }) diff --git a/pkg/providers/launchtemplate/launchtemplate.go b/pkg/providers/launchtemplate/launchtemplate.go index 6cc180a29..438284f1c 100644 --- a/pkg/providers/launchtemplate/launchtemplate.go +++ b/pkg/providers/launchtemplate/launchtemplate.go @@ -144,6 +144,7 @@ func (p *Provider) getStaticParameters(ctx context.Context, instanceType *cloudp Arch: arch, GPUNode: utils.IsNvidiaEnabledSKU(instanceType.Name), GPUDriverVersion: utils.GetGPUDriverVersion(instanceType.Name), + GPUDriverType: utils.GetGPUDriverType(instanceType.Name), GPUImageSHA: utils.GetAKSGPUImageSHA(instanceType.Name), TenantID: p.tenantID, SubscriptionID: p.subscriptionID, diff --git a/pkg/providers/launchtemplate/parameters/types.go b/pkg/providers/launchtemplate/parameters/types.go index 9ccbd8cb3..21fb7bf33 100644 --- a/pkg/providers/launchtemplate/parameters/types.go +++ b/pkg/providers/launchtemplate/parameters/types.go @@ -28,6 +28,7 @@ type StaticParameters struct { Arch string GPUNode bool GPUDriverVersion string + GPUDriverType string GPUImageSHA string TenantID string SubscriptionID string diff --git a/pkg/test/expectations/expectations.go b/pkg/test/expectations/expectations.go index f16b7fcfe..26390f29c 100644 --- a/pkg/test/expectations/expectations.go +++ b/pkg/test/expectations/expectations.go @@ -24,6 +24,9 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "github.com/Azure/karpenter-provider-azure/pkg/fake" "github.com/Azure/karpenter-provider-azure/pkg/test" ) diff --git a/pkg/utils/gpu.go b/pkg/utils/gpu.go index f9a7dc416..cb026d5d6 100644 --- a/pkg/utils/gpu.go +++ b/pkg/utils/gpu.go @@ -17,116 +17,73 @@ limitations under the License. package utils import ( + _ "embed" "strings" + + "gopkg.in/yaml.v2" ) // TODO: Get these from agentbaker const ( - Nvidia470CudaDriverVersion = "cuda-470.82.01" - Nvidia550CudaDriverVersion = "cuda-550.54.15" - Nvidia535GridDriverVersion = "grid-535.161.08" - - // These SHAs will change once we update aks-gpu images in aks-gpu repository. We do that fairly rarely at this time. - // So for now these will be kept here like this and periodically bump them - AKSGPUGridSHA = "sha-d1f0ca" - AKSGPUCudaSHA = "sha-2d4c96" + Nvidia470CudaDriverVersion = "470.82.01" + + // https://github.com/Azure/AgentBaker/blob/ddf36a24eafd02ce0589657ff2dc799125f4ad37/parts/linux/cloud-init/artifacts/components.json#L562 + NvidiaCudaDriverVersion = "550.90.12" + AKSGPUCudaVersionSuffix = "20241021235610" + + NvidiaGridDriverVersion = "535.161.08" + AKSGPUGridVersionSuffix = "20241021235607" ) -func GetAKSGPUImageSHA(size string) string { - if useGridDrivers(size) { - return AKSGPUGridSHA - } - return AKSGPUCudaSHA +type NvidiaSKUConfig struct { + NvidiaEnabledSKUFamilies map[string][]string `yaml:"nvidiaEnabledSKUs"` + MarinerNvidiaEnabledSKUFamilies map[string][]string `yaml:"marinerNvidiaEnabledSKUs"` } var ( - /* If a new GPU sku becomes available, add a key to this map, but only if you have a confirmation - that we have an agreement with NVIDIA for this specific gpu. - */ - NvidiaEnabledSKUs = map[string]bool{ - // M60 - "standard_nv6": true, - "standard_nv12": true, - "standard_nv12s_v3": true, - "standard_nv24": true, - "standard_nv24s_v3": true, - "standard_nv24r": true, - "standard_nv48s_v3": true, - // P40 - "standard_nd6s": true, - "standard_nd12s": true, - "standard_nd24s": true, - "standard_nd24rs": true, - // P100 - "standard_nc6s_v2": true, - "standard_nc12s_v2": true, - "standard_nc24s_v2": true, - "standard_nc24rs_v2": true, - // V100 - "standard_nc6s_v3": true, - "standard_nc12s_v3": true, - "standard_nc24s_v3": true, - "standard_nc24rs_v3": true, - "standard_nd40s_v3": true, - "standard_nd40rs_v2": true, - // T4 - "standard_nc4as_t4_v3": true, - "standard_nc8as_t4_v3": true, - "standard_nc16as_t4_v3": true, - "standard_nc64as_t4_v3": true, - // A100 40GB - "standard_nd96asr_v4": true, - "standard_nd112asr_a100_v4": true, - "standard_nd120asr_a100_v4": true, - // A100 80GB - "standard_nd96amsr_a100_v4": true, - "standard_nd112amsr_a100_v4": true, - "standard_nd120amsr_a100_v4": true, - // A100 PCIE 80GB - "standard_nc24ads_a100_v4": true, - "standard_nc48ads_a100_v4": true, - "standard_nc96ads_a100_v4": true, - "standard_ncads_a100_v4": true, - // A10 - "standard_nc8ads_a10_v4": true, - "standard_nc16ads_a10_v4": true, - "standard_nc32ads_a10_v4": true, - // A10, GRID only - "standard_nv6ads_a10_v5": true, - "standard_nv12ads_a10_v5": true, - "standard_nv18ads_a10_v5": true, - "standard_nv36ads_a10_v5": true, - "standard_nv36adms_a10_v5": true, - "standard_nv72ads_a10_v5": true, - // A100 - "standard_nd96ams_v4": true, - "standard_nd96ams_a100_v4": true, + nvidiaEnabledSKUs = make(map[string]bool) + marinerNvidiaEnabledSKUs = make(map[string]bool) +) + +//go:embed supported-gpus.yaml +var configFile []byte + +func init() { + readNvidiaSKUConfig() +} + +func readNvidiaSKUConfig() { + var nvidiaSKUConfig NvidiaSKUConfig + + err := yaml.Unmarshal(configFile, &nvidiaSKUConfig) + if err != nil { + panic(err) + } + for _, skus := range nvidiaSKUConfig.NvidiaEnabledSKUFamilies { + for _, sku := range skus { + nvidiaEnabledSKUs[sku] = true + } + } + for _, skus := range nvidiaSKUConfig.MarinerNvidiaEnabledSKUFamilies { + for _, sku := range skus { + marinerNvidiaEnabledSKUs[sku] = true + } } +} - // List of GPU SKUs currently enabled and validated for Mariner. Will expand the support - // to cover other SKUs available in Azure - MarinerNvidiaEnabledSKUs = map[string]bool{ - // V100 - "standard_nc6s_v3": true, - "standard_nc12s_v3": true, - "standard_nc24s_v3": true, - "standard_nc24rs_v3": true, - "standard_nd40s_v3": true, - "standard_nd40rs_v2": true, - // T4 - "standard_nc4as_t4_v3": true, - "standard_nc8as_t4_v3": true, - "standard_nc16as_t4_v3": true, - "standard_nc64as_t4_v3": true, +func GetAKSGPUImageSHA(size string) string { + if UseGridDrivers(size) { + return AKSGPUGridVersionSuffix } -) + return AKSGPUCudaVersionSuffix +} // IsNvidiaEnabledSKU determines if an VM SKU has nvidia driver support func IsNvidiaEnabledSKU(vmSize string) bool { // Trim the optional _Promo suffix. vmSize = strings.ToLower(vmSize) vmSize = strings.TrimSuffix(vmSize, "_promo") - return NvidiaEnabledSKUs[vmSize] + return nvidiaEnabledSKUs[vmSize] } // IsNvidiaEnabledSKU determines if an VM SKU has nvidia driver support @@ -134,7 +91,7 @@ func IsMarinerEnabledGPUSKU(vmSize string) bool { // Trim the optional _Promo suffix. vmSize = strings.ToLower(vmSize) vmSize = strings.TrimSuffix(vmSize, "_promo") - return MarinerNvidiaEnabledSKUs[vmSize] + return marinerNvidiaEnabledSKUs[vmSize] } // NV series GPUs target graphics workloads vs NC which targets compute. @@ -142,13 +99,21 @@ func IsMarinerEnabledGPUSKU(vmSize string) bool { // NVv1 seems to run with CUDA, NVv5 requires GRID. // NVv3 is untested on AKS, NVv4 is AMD so n/a, and NVv2 no longer seems to exist (?). func GetGPUDriverVersion(size string) string { - if useGridDrivers(size) { - return Nvidia535GridDriverVersion + if UseGridDrivers(size) { + return NvidiaGridDriverVersion } if isStandardNCv1(size) { return Nvidia470CudaDriverVersion } - return Nvidia550CudaDriverVersion + return NvidiaCudaDriverVersion +} + +// GetGPUDriverType returns the type of GPU driver for given VM SKU ("grid" or "cuda") +func GetGPUDriverType(size string) string { + if UseGridDrivers(size) { + return "grid" + } + return "cuda" } func isStandardNCv1(size string) bool { @@ -156,7 +121,7 @@ func isStandardNCv1(size string) bool { return strings.HasPrefix(tmp, "standard_nc") && !strings.Contains(tmp, "_v") } -func useGridDrivers(size string) bool { +func UseGridDrivers(size string) bool { return ConvergedGPUDriverSizes[strings.ToLower(size)] } diff --git a/pkg/utils/gpu_test.go b/pkg/utils/gpu_test.go index ed6529bcc..7e95b5403 100644 --- a/pkg/utils/gpu_test.go +++ b/pkg/utils/gpu_test.go @@ -25,23 +25,24 @@ import ( func TestGetAKSGPUImageSHA(t *testing.T) { assert := assert.New(t) tests := []struct { - name string - size string - output string + name string + size string + gpuDriverSha string + gpuDriverType string }{ - {"GRID Driver - NC Series v4", "standard_nc8ads_a10_v4", AKSGPUGridSHA}, - {"Cuda Driver - NV Series", "standard_nv6", AKSGPUCudaSHA}, - {"CUDA Driver - NC Series", "standard_nc6s_v3", AKSGPUCudaSHA}, - {"GRID Driver - NV Series v5", "standard_nv6ads_a10_v5", AKSGPUGridSHA}, - {"Unknown SKU", "unknown_sku", AKSGPUCudaSHA}, - {"CUDA Driver - NC Series v2", "standard_nc6s_v2", AKSGPUCudaSHA}, - {"CUDA Driver - NV Series v3", "standard_nv12s_v3", AKSGPUCudaSHA}, + {"GRID Driver - NC Series v4", "standard_nc8ads_a10_v4", AKSGPUGridVersionSuffix, "grid"}, + {"Cuda Driver - NV Series", "standard_nv6", AKSGPUCudaVersionSuffix, "cuda"}, + {"CUDA Driver - NC Series", "standard_nc6s_v3", AKSGPUCudaVersionSuffix, "cuda"}, + {"GRID Driver - NV Series v5", "standard_nv6ads_a10_v5", AKSGPUGridVersionSuffix, "grid"}, + {"Unknown SKU", "unknown_sku", AKSGPUCudaVersionSuffix, "cuda"}, + {"CUDA Driver - NC Series v2", "standard_nc6s_v2", AKSGPUCudaVersionSuffix, "cuda"}, + {"CUDA Driver - NV Series v3", "standard_nv12s_v3", AKSGPUCudaVersionSuffix, "cuda"}, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { - result := GetAKSGPUImageSHA(test.size) - assert.Equal(test.output, result, "Failed for size: %s", test.size) + assert.Equal(test.gpuDriverSha, GetAKSGPUImageSHA(test.size), "Failed for size: %s", test.size) + assert.Equal(test.gpuDriverType, GetGPUDriverType(test.size), "Failed for size: %s", test.size) }) } } @@ -53,12 +54,12 @@ func TestGetGPUDriverVersion(t *testing.T) { size string output string }{ - {"GRID Driver - NV Series v5", "standard_nv6ads_a10_v5", Nvidia535GridDriverVersion}, + {"GRID Driver - NV Series v5", "standard_nv6ads_a10_v5", NvidiaGridDriverVersion}, {"CUDA Driver - NC Series v1", "standard_nc6s", Nvidia470CudaDriverVersion}, - {"CUDA Driver - NC Series v2", "standard_nc6s_v2", Nvidia550CudaDriverVersion}, - {"Unknown SKU", "unknown_sku", Nvidia550CudaDriverVersion}, - {"CUDA Driver - NC Series v3", "standard_nc6s_v3", Nvidia550CudaDriverVersion}, - {"GRID Driver - A10", "standard_nc8ads_a10_v4", Nvidia535GridDriverVersion}, + {"CUDA Driver - NC Series v2", "standard_nc6s_v2", NvidiaCudaDriverVersion}, + {"Unknown SKU", "unknown_sku", NvidiaCudaDriverVersion}, + {"CUDA Driver - NC Series v3", "standard_nc6s_v3", NvidiaCudaDriverVersion}, + {"GRID Driver - A10", "standard_nc8ads_a10_v4", NvidiaGridDriverVersion}, } for _, test := range tests { diff --git a/pkg/utils/supported-gpus.yaml b/pkg/utils/supported-gpus.yaml new file mode 100644 index 000000000..1b5c73b57 --- /dev/null +++ b/pkg/utils/supported-gpus.yaml @@ -0,0 +1,110 @@ +nvidiaEnabledSKUs: + StandardNCADSA10v4Family: + - standard_nc16ads_a10_v4 + - standard_nc32ads_a10_v4 + - standard_nc8ads_a10_v4 + StandardNCADSA100v4Family: + - standard_nc24ads_a100_v4 + - standard_nc48ads_a100_v4 + - standard_nc96ads_a100_v4 + StandardNCASv3_T4Family: + - standard_nc16as_t4_v3 + - standard_nc4as_t4_v3 + - standard_nc64as_t4_v3 + - standard_nc8as_t4_v3 + StandardNCadsH100v5Family: + - standard_nc40ads_h100_v5 + - standard_nc80adis_h100_v5 + StandardNDASv4_A100Family: + - standard_nd96asr_v4 + - standard_nd112asr_a100_v4 + - standard_nd120asr_a100_v4 + StandardNVADSA10v5Family: + - standard_nv12ads_a10_v5 + - standard_nv18ads_a10_v5 + - standard_nv36adms_a10_v5 + - standard_nv36ads_a10_v5 + - standard_nv6ads_a10_v5 + - standard_nv72ads_a10_v5 + standardNCFamily: + - standard_nc6 + - standard_nc12 + - standard_nc24 + - standard_nc24r + standardNCSv3Family: + - standard_nc12s_v3 + - standard_nc24rs_v3 + - standard_nc24s_v3 + - standard_nc6s_v3 + standardNCSv2Family: + - standard_nc12s_v2 + - standard_nc24rs_v2 + - standard_nc24s_v2 + - standard_nc6s_v2 + standardNDAMSv4_A100Family: + - standard_nd96amsr_a100_v4 + - standard_nd112amsr_a100_v4 + - standard_nd120amsr_a100_v4 + standardNDSH100v5Family: + - standard_nd96isr_h100_v5 + - standard_nd96is_h100_v5 + - standard_nd96is_noib_h100_v5 + - standard_nd96is_flex_h100_v5 + standardNDSFamily: + - standard_nd6s + - standard_nd12s + - standard_nd24s + - standard_nd24rs + standardNDSv2Family: + - standard_nd40rs_v2 + standardNDSv3Family: + - standard_nd40s_v3 + standardNVFamily: + - standard_nv12 + - standard_nv24 + - standard_nv6 + - standard_nv24r + standardNVSv3Family: + - standard_nv12s_v3 + - standard_nv24s_v3 + - standard_nv48s_v3 + standardNVPromoFamily: + - standard_nv12_promo + - standard_nv24_promo + - standard_nv6_promo + standardNDSFH100v5Family: + - standard_nd96isf_h100_v5 + - standard_nd96isrf_h100_v5 + standardNDAMSv4A100noRDMAFamily: + - standard_nd96ams_v4 + - standard_nd96ams_a100_flex_v4 + - standard_nd96ams_a100_v4 + - standard_nd96amsf_a100_v4 + standardNDAMSFv4_A100Family: + - standard_nd96amsrf_a100_v4 + standardNCPromoFamily: + - standard_nc12_promo + - standard_nc24r_promo + - standard_nc24_promo + - standard_nc6_promo + standardNDSH200v5Family: + - standard_nd96isr_h200_v5 + - standard_nd96is_h200_v5 + standardNDSFH200v5Family: + - standard_nd96isf_h200_v5 + - standard_nd96isrf_h200_v5 +marinerNvidiaEnabledSKUs: + StandardNCASv3_T4Family: + - standard_nc16as_t4_v3 + - standard_nc4as_t4_v3 + - standard_nc64as_t4_v3 + - standard_nc8as_t4_v3 + standardNCSv3Family: + - standard_nc12s_v3 + - standard_nc24rs_v3 + - standard_nc24s_v3 + - standard_nc6s_v3 + standardNDSv2Family: + - standard_nd40rs_v2 + standardNDSv3Family: + - standard_nd40s_v3 diff --git a/typos.toml b/typos.toml index 6f1a81dc6..8ad784397 100644 --- a/typos.toml +++ b/typos.toml @@ -1,3 +1,5 @@ [default.extend-words] aks = "aks" ERRO = "ERRO" +nd = "nd" +ND = "ND"