Attach VMs
A load balancer routes to backends — each one a service, ip, or hostname target. To balance traffic across your virtual machines, add each VM as a backend using its IP address.
Before you begin
- Two or more running VMs in the same workspace serving the same application (Create a VM)
- The application listening on the same port on every VM
- A health endpoint on each VM (e.g.
/health) so failed instances are removed automatically
Add VMs as backends
Collect the VM addresses
Open each VM’s detail page and note its IP address. Prefer private IPs when the VMs and load balancer share a network — traffic stays internal.
Scaling the pool
To add or remove VMs from rotation, update the backend list. Unhealthy VMs are removed from rotation automatically by health checks — you don’t need to remove a VM that’s temporarily down.
To drain a VM before maintenance without removing it, lower its weight so new traffic prefers the other backends.
