A floating IP is a public address owned by an account rather than by a server: the customer gives it to one of their servers and moves it to another in seconds. A load balancer is an address of its own that shares connections between several of the customer's servers and stops sending to a server its health check finds down. Both run on your nodes through the VMStack agent; nothing else is installed.
Both pages are under Servers in the sidebar and are used by customers, resellers and administrators alike. Administrators set what each plan includes.
Requirements#
Admin side.
- Nodes with an agent that supports them (0.59.0 or later; use 0.59.1 or later, which fixes a slow move between servers of one node and several load balancer problems).
- Public IPv4 blocks (or IPv6 blocks) on the nodes of the location, in Infrastructure › IP pools. Floating IPs and load balancer addresses are taken from them; see IP pools.
- To move a floating IP between nodes, the nodes must have blocks on the same network: on-link IPv4 blocks with the same gateway, prefix and VLAN, as for live moves. An address of a block routed to one node's main IP (for example a provider's additional IPs) can still be a floating IP, but only between servers of that node.
Allowances#
Admin and reseller side. In Customers › Hosting plans, the plan form has:
| Field | Range | Meaning |
|---|---|---|
| Floating IPs included | 0-64, default 0 | How many floating IPs each server of the plan adds to its owner's allowance. |
| Load balancers included | 0-64, default 0 | How many load balancers each server of the plan adds to its owner's allowance. |
An account's allowance is the sum over its servers. Example: two servers on a plan with 2 floating IPs give the account 4. Administrators are held to no allowance.
An account's own limit (0-1000) replaces the plan sum when set. It is set through the API only: PUT /users/{id}/floating-ip-limit and PUT /users/{id}/load-balancer-limit (scope users:write, staff). A billing module can raise it when a customer buys extra addresses; GET /floating-ip-allowance returns used, limit and own_limit.
Floating IPs#
Make a floating IP#
- Go to Servers › Floating IPs. The header shows the allowance, for example "Yours 1 of 2".
- Click New floating IP….
- Choose the Location, the Address (IPv4, or IPv6 (a single address)), optionally Give it to a server (or No server for now) and a Label. Staff also choose the Owner; it is ignored when a server is chosen (the floating IP is then that server's owner's).
- Click Make floating IP.
Without a server, an IPv4 floating IP is taken from the on-link network found on the most nodes of the location, so it can go to the most servers. With a server, it comes from that server's node (its routed blocks included).
When the allowance is used up: "The account uses all 2 of its floating IPs. Delete one to make another."
Give it to a server, or move it#
- On the list, click Give to a server… (or Move to… when it is on a server).
- Choose the Server. Only servers it can go to are listed.
- Click Give it.
A floating IP on another server is first taken off that server, then given to the new one: "a few seconds without it". The address is never routed by two nodes at once. The node that takes it sends three gratuitous ARPs (IPv4) or unsolicited neighbour advertisements (IPv6), a second apart, so the provider's router learns the new location at once. The list polls and shows the state:
| State | Meaning |
|---|---|
| On a server / On no server | Settled. |
| Being given to the server | The new node is adding it. |
| Moving to another server | The old node is removing it; the new one follows. |
| Being taken off | Being removed from its server. |
| an error text | The move failed; the address is on no server, with the reason, for example "Taken off, but not given to web2: ...". |
A customer needs the Reconfigure the network permission to give a floating IP to a server, move it or take it off (see Customer permissions).
Where a floating IP can go#
| Allowed | Not allowed |
|---|---|
| Virtual machines of the same account, in the floating IP's location, with a public IPv4 address of their own | Servers of another account |
| Servers on a node with a block on the same network (or the floating IP's own node, for a routed block) | Servers behind NAT |
| Bridged servers (each of their addresses has its own MAC at the provider) | |
| Servers on a VLAN | |
| Containers |
IPv6 floating IPs are single /128 addresses of the nodes' IPv6 blocks, with the same rule. IPv6 prefixes routed to a server are not floating.
Use it inside the server#
On a server, a floating IP is one more address of it: the node routes it at once, and it follows everything a server's addresses follow (anti-spoofing, firewall address sets, reverse DNS, live moves and HA restarts). The guest still has to use it. Either:
- use Reconfigure network on the server's Network tab (it rewrites the server's network settings and restarts it), or
- add it by hand, for example:
ip addr add 198.51.100.20/32 dev eth0
Here 198.51.100.20 is the floating IP and eth0 the server's main card. For IPv6 use /128. Make the change permanent in the server's own network configuration.
Moving a floating IP to a server that already has the address configured inside makes it answer there within seconds. The server's address list marks it Floating IP (a link to the Floating IPs page) and has no Remove for it: take it off from the Floating IPs page.
Take it off, delete it#
- Take off removes it from its server; it stays the account's.
- Delete (only on no server) gives the address back to the pool: an IPv4 address becomes an ordinary free address of its block, an IPv6 one is removed.
- A server deleted leaves its floating IP to the account, on no server. An account deleted gives its floating IPs back.
- In Infrastructure › IP pools, a floating IP is never free: it cannot be reserved, given a MAC, or its block deleted.
Load balancers#
How a load balancer works#
- It runs in the agent of one node of the location: the node most of its target servers run on, else the location's first node that runs load balancers.
- Its address is a free public IPv4 address of that node's blocks (not a bridged block or one on a VLAN), held on the node on a dummy interface
vmslb0. The node answers ARP for it. Without a free address the panel refuses: "Node node1 has no free IPv4 address for a load balancer." - TCP listeners splice bytes both ways: TLS passes through untouched, so HTTPS uses the target servers' own certificates. HTTP listeners forward each request and add
X-Forwarded-For,X-Forwarded-ProtoandX-Forwarded-Port, keeping theHost. They answer502when a target does not answer and503when no target is up. - Connections to the target servers come from the load balancer's address. The targets' firewalls must let that one address in.
- Targets are the servers' main IPv4 addresses. Suspended servers drop out; servers behind NAT cannot be targets.
- With the node firewall on, the agent opens the listeners' ports on the balancer's address.
Make a load balancer#
-
Go to Servers › Load balancers and click New load balancer. It opens a full page.
-
Details: Name (up to 64 characters), Location (cannot be changed later), and for staff the Owner.
-
Listeners: for each, the Port of the balancer's address, the Servers' port it leads to, and the Protocol: HTTP or TCP (also HTTPS, passed through). Add a listener adds up to 8.
-
Servers: tick the target servers (your servers in the location with a public IPv4 address of their own), up to 32.
-
Choosing a server:
- Method: Round robin: each in turn or Least connections: the least busy. Each listener keeps its own turn.
- Sticky sessions: a visitor keeps going to the same server (by the visitor's address) while that server is up.
- PROXY protocol (TCP listeners): off, v1 or v2. The targets' web server must expect it.
-
Health check:
Field Default Range Check A TCP connection or An HTTP request (2xx or 3xx) with a Path starting with /Port the first listener's servers' port 1-65535 Every (seconds) 10 2-300 Wait (seconds) 5 1-60, not longer than the interval Up after (answers in a row) 2 1-10 Down after (failures in a row) 3 1-10 -
Click Make load balancer.
A listener port the node itself holds is refused: "Port 8443 is taken on node node1 by the VMStack agent: choose another." The node's SSH port 22 and the agent's port are always held; ports 80 and 443 are held while the node serves websites by domain.
Watch and change it#
The list shows each balancer's address, listeners and, from its node, for example "2 of 2 servers up · 12 connections", or "Not listening on every port: see its page". Edit opens the same page; its Now section shows what the node reports, each target up or down with the reason. A target that refuses connections is skipped at once, before its health check marks it down.
Delete asks for confirmation. The address stops answering at once and goes back to the pool; the target servers are not touched.
API and webhooks#
The API has /floating-ips (with /floating-ips/{id}/assign and /unassign, which return 202 with a task), /floating-ip-allowance and /load-balancers, under the scopes networks:read and networks:write. Refusals are 409 refused with the sentence. The webhook events server.floating_ip_attached and server.floating_ip_detached tell a billing system when a floating IP is in use. Load balancers have no webhook events.
Not supported#
- Floating IPs on servers behind NAT, bridged servers, servers on a VLAN, or containers.
- Moving an address of a routed block (provider additional IPs) between nodes; this would need the provider's API.
- IPv6 prefixes as floating IPs; IPv6 addresses for load balancers.
- TLS termination, HTTP/2 to targets and per-path routing in load balancers.
- Moving a load balancer to another node from the page.
- WHMCS add-on options to sell extra floating IPs or load balancers (the limit endpoints exist for it).
Troubleshooting#
| Symptom | Cause and fix |
|---|---|
| A move between two servers of one node loses traffic for 20 seconds or more | Agent 0.59.0 kept the bridge's ARP entry for the old server. Update to 0.59.1 or later; a move then costs the two node changes, a few seconds. |
| The floating IP is on the server but does not answer | The address is not configured inside the server. Use Reconfigure network or ip addr add. |
| The server cannot be chosen in Give to a server… | It is in another location, behind NAT, bridged, on a VLAN, a container, or on a node without a block on the floating IP's network. The dialog says "No server of the account can take it" when none qualifies. |
| A load balancer target shows down although the service runs | The target's firewall does not allow the load balancer's address, or the health check path does not answer 2xx or 3xx. |
| Every request fails at the targets after turning on PROXY protocol | The targets' web server does not expect the PROXY header. Configure it (nginx proxy_protocol) or turn PROXY protocol off. |