kubernetes/kops · error

Failed to create floating IP: %v

Error message

Failed to create floating IP: %v

What it means

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.

Source

Thrown at upup/pkg/fi/cloudup/openstacktasks/floatingip.go:256

			FloatingNetworkID: external.ID,
			Description:       fi.ValueOf(e.Name),
		}

		if e.LB != nil {
			opts.PortID = fi.ValueOf(e.LB.PortID)
		}

		// instance floatingips comes from the same subnet as the kubernetes API floatingip
		lbSubnet, err := cloud.GetLBFloatingSubnet()
		if err != nil {
			return fmt.Errorf("Failed to find floatingip subnet: %v", err)
		}
		if lbSubnet != nil {
			opts.SubnetID = lbSubnet.ID
		}
		fip, err := cloud.CreateL3FloatingIP(opts)
		if err != nil {
			return fmt.Errorf("Failed to create floating IP: %v", err)
		}

		e.ID = new(fip.ID)
		e.IP = new(fip.FloatingIP)

		return nil
	}
	if changes.Name != nil {
		_, err := l3floatingip.Update(context.TODO(), cloud.NetworkingClient(), fi.ValueOf(a.ID), l3floatingip.UpdateOpts{
			Description: e.Name,
		}).Extract()
		if err != nil {
			return fmt.Errorf("failed to update floating ip %v: %v", fi.ValueOf(e.Name), err)
		}

	}

	klog.V(2).Infof("Openstack task Instance::RenderOpenstack did nothing")

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Read the wrapped error: for quota, free or raise floating IP quota (`openstack quota set --floating-ips <n> <project>`).
  2. For 'no more IP addresses available', free unused FIPs or extend the external subnet allocation pool.
  3. Verify the external network is up and its subnet has capacity: `openstack floating ip list`, `openstack subnet show`.
  4. For 403/400 mismatches, confirm the LB port's subnet is routable from the chosen external network, then rerun kops.

Example fix

// before
openstack quota show <project>   # floating-ips: 1 (exhausted)
// after
openstack quota set --floating-ips 20 <project>
Defensive patterns

Strategy: try-catch

Validate before calling

// check quota and free IP capacity before attempting creation
q, _ := cloud.GetFloatingIPQuota() // e.g. networkv2 GetQuotas
fips, _ := cloud.ListL3FloatingIPs(l3floatingip.ListOpts{})
if q.FloatingIP >= 0 && len(fips) >= q.FloatingIP {
    return fmt.Errorf("floating IP quota (%d) exhausted", q.FloatingIP)
}

Type guard

func isQuotaOrCapacityError(err error) bool {
    var gerr gophercloud.ErrUnexpectedResponseCode
    return errors.As(err, &gerr) && (gerr.Actual == 409 || gerr.Actual == 400)
}

Try / catch

err := f.RenderOpenstack(target, a, e, changes)
if err != nil && strings.Contains(err.Error(), "Failed to create floating IP") {
    if isQuotaOrCapacityError(err) {
        // free/raise quota or extend the external subnet pool, then retry
    }
    return err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/eb88f0f959e187c2. Report an issue: GitHub.