{"record":{"id":"5fc57b52728261f7","repo":"kubernetes/kops","slug":"error-looking-up-machine-type-info-v","errorCode":null,"errorMessage":"error looking up machine type info: %v","messagePattern":"error looking up machine type info: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/populate_instancegroup_spec.go","lineNumber":214,"sourceCode":"\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(ig.Spec.Subnets) == 0 {\n\t\treturn nil, fmt.Errorf(\"unable to infer any Subnets for InstanceGroup %s \", ig.ObjectMeta.Name)\n\t}\n\n\thasGPU := false\n\tclusterNvidia := cluster.Spec.Containerd != nil && cluster.Spec.Containerd.NvidiaGPU != nil && fi.ValueOf(cluster.Spec.Containerd.NvidiaGPU.Enabled)\n\tigNvidia := ig.Spec.Containerd != nil && ig.Spec.Containerd.NvidiaGPU != nil && fi.ValueOf(ig.Spec.Containerd.NvidiaGPU.Enabled)\n\n\tswitch cluster.GetCloudProvider() {\n\tcase kops.CloudProviderAWS:\n\t\tif clusterNvidia || igNvidia {\n\t\t\tmt, err := awsup.GetMachineTypeInfo(cloud.(awsup.AWSCloud), ec2types.InstanceType(ig.Spec.MachineType))\n\t\t\tif err != nil {\n\t\t\t\treturn ig, fmt.Errorf(\"error looking up machine type info: %v\", err)\n\t\t\t}\n\t\t\thasGPU = mt.GPU\n\t\t}\n\tcase kops.CloudProviderOpenstack:\n\t\tif igNvidia {\n\t\t\thasGPU = true\n\t\t}\n\t}\n\n\tif hasGPU {\n\t\tif ig.Spec.NodeLabels == nil {\n\t\t\tig.Spec.NodeLabels = make(map[string]string)\n\t\t}\n\t\tig.Spec.NodeLabels[\"kops.k8s.io/gpu\"] = \"1\"\n\t\thasNvidiaTaint := false\n\t\tfor _, taint := range ig.Spec.Taints {\n\t\t\tif strings.HasPrefix(taint, \"nvidia.com/gpu\") {\n\t\t\t\thasNvidiaTaint = true","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/populate_instancegroup_spec.go#L196-L232","documentation":"When GPU support is enabled (cluster-level or InstanceGroup containerd nvidiaGPU) on AWS, kOps queries EC2 for the instance type info via awsup.GetMachineTypeInfo to check whether the type actually has a GPU. Failure to look up that info produces this error.","triggerScenarios":"AWS cluster with containerd.nvidiaGPU.enabled: true and a machineType that GetMachineTypeInfo cannot resolve — invalid instance type name, EC2 API error (credentials, region, throttling), or instance family not known to this kOps version.","commonSituations":"Typo'd GPU instance type (e.g. p3.2xlarage); IAM policy missing ec2:DescribeInstanceTypes; new GPU families (g6e, p5) with an older kOps; network/API outage during `kops update cluster`.","solutions":["Verify spec.machineType is a valid AWS GPU instance type","Check AWS credentials/IAM permissions for ec2:DescribeInstanceTypes and connectivity","Upgrade kOps if the instance family is newer than the release","If GPU isn't actually needed, remove the nvidiaGPU block to skip the lookup"],"exampleFix":"// before\nspec:\n  machineType: p3.2xlarage\n  containerd:\n    nvidiaGPU:\n      enabled: true\n// after\nspec:\n  machineType: p3.2xlarge\n  containerd:\n    nvidiaGPU:\n      enabled: true","handlingStrategy":"try-catch","validationCode":"// Pre-verify GPU instance type is resolvable before enabling nvidiaGPU\n// aws ec2 describe-instance-types --instance-types p3.2xlarge --region <region>\nif gpuEnabled && !strings.HasSuffix(ig.Spec.MachineType, \"large\") == false && !isKnownGPUFamily(ig.Spec.MachineType) {\n    return fmt.Errorf(\"machineType %s is not a known GPU type; fix before enabling nvidiaGPU\", ig.Spec.MachineType)\n}","typeGuard":"func isKnownGPUFamily(mt string) bool {\n\tfor _, p := range []string{\"p3.\", \"p4d.\", \"p5.\", \"g4dn.\", \"g5.\", \"g6.\"} {\n\t\tif strings.HasPrefix(mt, p) { return true }\n\t}\n\treturn false\n}","tryCatchPattern":"if _, err := populateInstanceGroupSpec(...); err != nil {\n    if strings.Contains(err.Error(), \"error looking up machine type info\") {\n        // check IAM ec2:DescribeInstanceTypes, region support, then retry with corrected machineType\n        return fmt.Errorf(\"GPU type lookup failed; verify instance type and AWS permissions: %w\", err)\n    }\n    return err\n}","preventionTips":["Use well-known GPU families (p3/p4/p5/g4/g5/g6)","Grant ec2:DescribeInstanceTypes to the kOps credentials","Upgrade kOps before adopting brand-new GPU families","Enable nvidiaGPU only on IGs that actually need it"],"tags":["kops","aws","gpu","ec2","api"],"backgroundTag":"instance-type-lookup-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}