{"record":{"id":"a0ba826cbb6956f5","repo":"kubernetes/kops","slug":"could-not-find-flavor-with-name-v","errorCode":null,"errorMessage":"could not find flavor with name %v","messagePattern":"could not find flavor with name (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstack/instance.go","lineNumber":393,"sourceCode":"func getFlavor(c OpenstackCloud, name string) (*flavors.Flavor, error) {\n\topts := flavors.ListOpts{}\n\tpager := flavors.ListDetail(c.ComputeClient(), opts)\n\tpage, err := pager.AllPages(context.TODO())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to list flavors: %v\", err)\n\t}\n\n\tfs, err := flavors.ExtractFlavors(page)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to extract flavors: %v\", err)\n\t}\n\tfor _, f := range fs {\n\t\tif f.Name == name {\n\t\t\treturn &f, nil\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"could not find flavor with name %v\", name)\n}\n","sourceCodeStart":375,"sourceCodeEnd":395,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstack/instance.go#L375-L395","documentation":"getFlavor iterates the extracted flavors looking for one whose Name matches the requested name; if none matches, it returns this error. It means the configured instance type/flavor name does not exist in this OpenStack project/region.","triggerScenarios":"GetFlavor called with a flavor name that does not exist in the target Nova deployment — typically the instanceType from the kops InstanceGroup does not match any flavor name in the cloud.","commonSituations":"Copy-pasting AWS instance types (e.g. m5.large) into an OpenStack cluster spec; flavor renamed or absent in a different region/project; flavors not exposed to the project.","solutions":["List available flavors with `openstack flavor list` and use an exact name in the InstanceGroup spec","Correct the instanceType in the instance group (kops edit ig <ig>) and update the cluster","Ask the cloud admin to create/enable the required flavor if it genuinely should exist"],"exampleFix":"// before: kops instance group spec\nmachineType: m5.large\n// after: a real OpenStack flavor name\nmachineType: m1.medium","handlingStrategy":"validation","validationCode":"// resolve the flavor before applying the cluster/instance group\nfunc validateFlavorExists(cl OpenstackCloud, name string) error {\n    _, err := GetFlavor(cl, name)\n    return err // 'could not find flavor with name' surfaces here\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `openstack flavor list` and copy exact flavor names into instance group specs","Never assume AWS/GCE machine types exist on OpenStack","Check flavor availability per region and per project (RBAC may hide flavors)","Validate machineType in CI with a kops cluster template linter"],"tags":["openstack","flavors","configuration","instance-group"],"backgroundTag":"flavor-not-found","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"}