Attach floating IP to VM
Attach a floating public IP to a virtual machine. Pick one of two modes:
Option A — attach a reserved IP (use ip_id)
Pass ip_id set to a previously reserved IP (from POST /api/v1/ips/reserve or GET /api/v1/ips?reserved=true). The IP must:
- belong to the same account
- not be currently attached to another VM
- have reserved: true
No new billing on attach — you're already paying for the reserved IP.
A VM can hold up to 4 public IPv4 addresses. The first IPv4 on a VM becomes its primary address; additional IPv4s must be reserved IPs attached with ip_id.
Option B — auto-assign a new IP (use type)
Leave ip_id empty and pass type to allocate a fresh IP from the pool:
- type: IPv4 (default if omitted)
- type: IPv6
Auto-assign is available only while the VM has no public IP of that family, and the IP is included with the VM at no extra charge. It is not reserved: detaching releases it back to the shared pool.
Notes
- Auto-assign (type) fails if the VM already has a public IP of the same family — attach a reserved IP (ip_id) to add more IPv4s, up to 4 total.
- Optionally pass security_groups (UUID array) to apply security groups to the new NIC.
Path parameters
VM ID (UUID)
Headers
Project ID. Required for all mutating operations (create, delete, power actions, resize).
Request body
Response
IP attached
Example response
{
"success": true
}