{"record":{"id":"eb88f0f959e187c2","repo":"kubernetes/kops","slug":"failed-to-create-floating-ip-v","errorCode":null,"errorMessage":"Failed to create floating IP: %v","messagePattern":"Failed to create floating IP: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstacktasks/floatingip.go","lineNumber":256,"sourceCode":"\t\t\tFloatingNetworkID: external.ID,\n\t\t\tDescription:       fi.ValueOf(e.Name),\n\t\t}\n\n\t\tif e.LB != nil {\n\t\t\topts.PortID = fi.ValueOf(e.LB.PortID)\n\t\t}\n\n\t\t// instance floatingips comes from the same subnet as the kubernetes API floatingip\n\t\tlbSubnet, err := cloud.GetLBFloatingSubnet()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to find floatingip subnet: %v\", err)\n\t\t}\n\t\tif lbSubnet != nil {\n\t\t\topts.SubnetID = lbSubnet.ID\n\t\t}\n\t\tfip, err := cloud.CreateL3FloatingIP(opts)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to create floating IP: %v\", err)\n\t\t}\n\n\t\te.ID = new(fip.ID)\n\t\te.IP = new(fip.FloatingIP)\n\n\t\treturn nil\n\t}\n\tif changes.Name != nil {\n\t\t_, err := l3floatingip.Update(context.TODO(), cloud.NetworkingClient(), fi.ValueOf(a.ID), l3floatingip.UpdateOpts{\n\t\t\tDescription: e.Name,\n\t\t}).Extract()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to update floating ip %v: %v\", fi.ValueOf(e.Name), err)\n\t\t}\n\n\t}\n\n\tklog.V(2).Infof(\"Openstack task Instance::RenderOpenstack did nothing\")","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/floatingip.go#L238-L274","documentation":"RenderOpenstack in floatingip.go:256 wraps an error from cloud.CreateL3FloatingIP(opts) — the Neutron POST /floatingips call failed after the external network and subnet were resolved. The gophercloud error (quota, no free IPs, invalid port, etc.) is embedded.","triggerScenarios":"Neutron returns 409 quota exceeded (too many floating IPs), 400 no free IPs in the external subnet or invalid FloatingNetworkID/PortID/SubnetID combination, 403 policy denial, or 5xx.","commonSituations":"Project floating IP quota exhausted; the external network's subnet pool fully allocated; creating FIP for a port on a subnet not routable from the external network; policy restrictions on which projects may allocate FIPs.","solutions":["Read the wrapped error: for quota, free or raise floating IP quota (`openstack quota set --floating-ips <n> <project>`).","For 'no more IP addresses available', free unused FIPs or extend the external subnet allocation pool.","Verify the external network is up and its subnet has capacity: `openstack floating ip list`, `openstack subnet show`.","For 403/400 mismatches, confirm the LB port's subnet is routable from the chosen external network, then rerun kops."],"exampleFix":"// before\nopenstack quota show <project>   # floating-ips: 1 (exhausted)\n// after\nopenstack quota set --floating-ips 20 <project>","handlingStrategy":"try-catch","validationCode":"// check quota and free IP capacity before attempting creation\nq, _ := cloud.GetFloatingIPQuota() // e.g. networkv2 GetQuotas\nfips, _ := cloud.ListL3FloatingIPs(l3floatingip.ListOpts{})\nif q.FloatingIP >= 0 && len(fips) >= q.FloatingIP {\n    return fmt.Errorf(\"floating IP quota (%d) exhausted\", q.FloatingIP)\n}","typeGuard":"func isQuotaOrCapacityError(err error) bool {\n    var gerr gophercloud.ErrUnexpectedResponseCode\n    return errors.As(err, &gerr) && (gerr.Actual == 409 || gerr.Actual == 400)\n}","tryCatchPattern":"err := f.RenderOpenstack(target, a, e, changes)\nif err != nil && strings.Contains(err.Error(), \"Failed to create floating IP\") {\n    if isQuotaOrCapacityError(err) {\n        // free/raise quota or extend the external subnet pool, then retry\n    }\n    return err\n}","preventionTips":["Monitor floating IP quota usage in the project before cluster updates","Keep headroom in the external subnet allocation pool","Ensure the LB port subnet is routable from the chosen external network","Clean up orphaned FIPs from previous cluster deletions"],"tags":["openstack","neutron","floating-ip","quota","create"],"backgroundTag":"floating-ip-quota-exceeded","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}