My CloudVPS

Article overview

/ OS1 Load Balancing with IP Failover

This article will go through preparing a load balanced infrastructure with IP failover within your CloudVPS Compute platform.

This article only applies on our Legacy OpenStack platform

Prepare your infrastructure for Load Balancing

  1. Create a new private network (a /16 subnet is recommended) with DHCP enabled. (see on how to create a network).
  2. Reserve the first floating IP address (see on how to reserve a floating IP address).
  3. Boot two new servers with your desired Operating System
 (see on how to boot new servers) and connect them to the private network created at step 1.
  4. Next, from within the CLI create a network port which will generate a fixed ip address. This fixed ip address will be used as internal VIP for your failover software:
    neutron port-create NETWORK-UUID --tenant-id YOUR_TENANT_ID
  5. Note the previously generated port id and assign the floating IP address to the network port:
    neutron floatingip-associate FLOATING_IP_UUID PORT_UUID
  6. Reserve a second floating IP address.
  7. Assign the second floating IP address to the private IP address of the second server to act as management IP.

You can find the UUID's for the network, floating IP and port with the following commands:

Network UUID:

$ neutron net-list
| id               | name            | subnets                      |
| 00[...]00        | net-public      | 2c5[...]310213.187.243.0/24  |
| 57[...]8d        | local-example   | aaa[...]6    |

Floating IP UUID:

$ neutron floatingip-list
| id           | fixed_ip_address | floating_ip_address   | port_id       |
| df[...]44b   |     |       | 01[...9f      |
| f3[...]00    |                  |       |               |

Port UUID:

$ neutron port-list
| id        | fixed_ip_address   | floating_ip_address | port_id     |
| 30[...]79 |                    |      |             |
| 46[...]4e |       |      | 56[...]a67  |

Now you are ready to configure the load balancers and use the first floating IP address as the external VIP and the fixed IP address as the internal VIP.

Ubuntu & Centos changes

Configure the following files as described below.

Add the following to the DHCP client configuration (/etc/dhcp/dhclient.conf)

alias {
     interface "eth0";
     fixed-address <fixed ip>;
     option subnet-mask;

Configure Default Gateway (/etc/sysconfig/network)

GATEWAY=<gateway ip>

Configure DNS Server (/etc/resolv.conf)

nameserver      # Or replace with your nameserver ip
nameserver      # Or replace with your nameserver ip

Restart the network service

service network restart

Share this article