{"record":{"id":"163f296324c54be7","repo":"kubernetes/kops","slug":"no-suitable-flavor-for-role-q","errorCode":null,"errorMessage":"No suitable flavor for role %q","messagePattern":"No suitable flavor for role %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstack/utils.go","lineNumber":101,"sourceCode":"\tcase ig.Spec.Role.HasNode():\n\t\tfor _, flavor := range fList {\n\t\t\tif flavor.RAM >= 4096 && flavor.VCPUs >= 2 {\n\t\t\t\tcandidates = append(candidates, flavor)\n\t\t\t}\n\t\t}\n\n\tcase ig.Spec.Role.HasBastion():\n\t\tfor _, flavor := range fList {\n\t\t\tif flavor.RAM >= 1024 {\n\t\t\t\tcandidates = append(candidates, flavor)\n\t\t\t}\n\t\t}\n\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unhandled role %q\", ig.Spec.Role)\n\t}\n\tif len(candidates) == 0 {\n\t\treturn \"\", fmt.Errorf(\"No suitable flavor for role %q\", ig.Spec.Role)\n\t}\n\treturn candidates[0].Name, nil\n}\n\nfunc GetServerFixedIP(server *servers.Server, interfaceName string) (poolAddress string, err error) {\n\tif localAddr, ok := server.Addresses[interfaceName]; ok {\n\t\tif localAddresses, ok := localAddr.([]interface{}); ok {\n\t\t\tfor _, addr := range localAddresses {\n\t\t\t\taddrMap := addr.(map[string]interface{})\n\t\t\t\tif addrType, ok := addrMap[openstackExternalIPType]; ok && addrType == openstackAddressFixed {\n\t\t\t\t\tif fixedIP, ok := addrMap[openstackAddress]; ok {\n\t\t\t\t\t\tif fixedIPStr, ok := fixedIP.(string); ok {\n\t\t\t\t\t\t\tpoolAddress = fixedIPStr\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\terr = fmt.Errorf(\"Fixed IP was not a string: %v\", fixedIP)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\terr = fmt.Errorf(\"Type fixed did not contain addr: %v\", addr)","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstack/utils.go#L83-L119","documentation":"Thrown by defaultInstanceType when the candidate flavor list for the instance group's role is empty after filtering and sorting. The cloud's flavor catalog contains no flavor meeting the role's minimum requirements (e.g. RAM >= 1024 MB for the default case), so no instance type can be defaulted.","triggerScenarios":"defaultInstanceType built `candidates` from the flavor list for the matching role case, but len(candidates) == 0 — no Nova flavor satisfied the role's size constraints.","commonSituations":"Small/private OpenStack clouds with restricted catalogs; flavors hidden from the project via flavor visibility/access rules; quota or admin policies exposing only flavors smaller than the role's minimums.","solutions":["Run `openstack flavor list` with the same project credentials and confirm a flavor meets the role's minimum requirements (e.g. >=1024 MB RAM).","Lower the role's minimum flavor requirements in the code/spec if the cloud is small.","Ask the cloud admin to make a suitable flavor visible to your project (flavor access/visibility)."],"exampleFix":"// before\nif len(candidates) == 0 {\n    return \"\", fmt.Errorf(\"No suitable flavor for role %q\", ig.Spec.Role)\n}\n// after\nif len(candidates) == 0 {\n    return \"\", fmt.Errorf(\"no flavor meets minimum requirements for role %q; available: %d flavors\", ig.Spec.Role, len(fList))\n}","handlingStrategy":"validation","validationCode":"flavors, err := flavorsList(novaClient)\nif err != nil {\n    return err\n}\nif len(flavors) == 0 {\n    return errors.New(\"project sees no flavors; check flavor visibility/quotas\")\n}","typeGuard":null,"tryCatchPattern":"if _, err := DefaultInstanceType(ig); err != nil {\n    if strings.Contains(err.Error(), \"No suitable flavor\") {\n        log.Printf(\"no flavor for role %s; check catalog\", ig.Spec.Role)\n    }\n}","preventionTips":["Run `openstack flavor list` with the provisioning credentials first","Verify the flavor is shared/visible to your project","Keep role minimum requirements below the smallest available flavor"],"tags":["openstack","nova","flavor","instance-type"],"backgroundTag":"no-matching-instance-type","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"}