kubernetes/kops · error
No suitable flavor for role %q
Error message
No suitable flavor for role %q
What it means
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.
Source
Thrown at upup/pkg/fi/cloudup/openstack/utils.go:101
case ig.Spec.Role.HasNode():
for _, flavor := range fList {
if flavor.RAM >= 4096 && flavor.VCPUs >= 2 {
candidates = append(candidates, flavor)
}
}
case ig.Spec.Role.HasBastion():
for _, flavor := range fList {
if flavor.RAM >= 1024 {
candidates = append(candidates, flavor)
}
}
default:
return "", fmt.Errorf("unhandled role %q", ig.Spec.Role)
}
if len(candidates) == 0 {
return "", fmt.Errorf("No suitable flavor for role %q", ig.Spec.Role)
}
return candidates[0].Name, nil
}
func GetServerFixedIP(server *servers.Server, interfaceName string) (poolAddress string, err error) {
if localAddr, ok := server.Addresses[interfaceName]; ok {
if localAddresses, ok := localAddr.([]interface{}); ok {
for _, addr := range localAddresses {
addrMap := addr.(map[string]interface{})
if addrType, ok := addrMap[openstackExternalIPType]; ok && addrType == openstackAddressFixed {
if fixedIP, ok := addrMap[openstackAddress]; ok {
if fixedIPStr, ok := fixedIP.(string); ok {
poolAddress = fixedIPStr
} else {
err = fmt.Errorf("Fixed IP was not a string: %v", fixedIP)
}
} else {
err = fmt.Errorf("Type fixed did not contain addr: %v", addr)View on GitHub (pinned to 4c8573c808)
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).
Example fix
// before
if len(candidates) == 0 {
return "", fmt.Errorf("No suitable flavor for role %q", ig.Spec.Role)
}
// after
if len(candidates) == 0 {
return "", fmt.Errorf("no flavor meets minimum requirements for role %q; available: %d flavors", ig.Spec.Role, len(fList))
} Defensive patterns
Strategy: validation
Validate before calling
flavors, err := flavorsList(novaClient)
if err != nil {
return err
}
if len(flavors) == 0 {
return errors.New("project sees no flavors; check flavor visibility/quotas")
} Try / catch
if _, err := DefaultInstanceType(ig); err != nil {
if strings.Contains(err.Error(), "No suitable flavor") {
log.Printf("no flavor for role %s; check catalog", ig.Spec.Role)
}
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Could not list flavors: %v
- error building nova client: %v
- no decernable storage availability zone could be mapped to c
- error building nova client: %w
- could not delete instance %q: %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/163f296324c54be7.
Report an issue: GitHub.