Restoring Load Balancers

If a Virtuozzo node was hosting one or more load balancers before it failed, you also need to restore these load balancers:

  1. Restore the node by following the instructions in Restoring Virtuozzo Nodes.
  2. Make sure that the new Virtuozzo node is registered in Operations. See the Cloud Infrastructure Deployment Guide for details.
  3. Log in to the IM node and stop the IM and Terracotta services:

    # service PACI-im stop
    # service terracotta stop
  4. Run the following commands to log in to the IM database node as root:

    # su - postgres
    # psql im
  5. Find out the name of the active load balancer image (LB_IMAGE_NAME) and the backup node (BN_NAME) that keeps the active image:

    im=> select images.name, backup_node.name from backup_node, images where is_lb='t' and is_active='t';

    You will need the active image later to create a new load balancer on its basis.

  6. Learn the IDs of the failed (FAILED_NODE_UUID) and new (NEW_NODE_UUID) Virtuozzo nodes:

    im=> select uuid from hn where name='FAILED_NODE_UUID'
    im=> select uuid from hn where name='NEW_NODE_UUID'
  7. Find out the following information about each load balancer that was hosted on the failed Virtuozzo node:

    • name (LB_NAME)
    • customer ID (CUSTOMER_ID)
    • private IP address (LB_PRIVATE_IP)
    • public IP address and network mask (LB_PUBLIC_IP and NET_MASK)
    • gateway (LB_GATEWAY)

    You will need this information when recreating load balancers in the next step. To get this information, run the following command:

    im=> select ve.name,ve.customer_id,ve.private_ip,ve_public_ip.ip,ve_public_ip.gateway from ve, ve_public_ip where ve_public_ip.ve_ref = ve.id and is_lb='t' and hn_id='Failed_Node_ID';
  8. Recreate each of the found load balancers. See Recreating Load Balancers for details.
  9. On the IM node, update the information about the new Virtuozzo node where it will be hosted:

    im=> update ve set hn_id='NEW_NODE_UUID' where name='LB_NAME';

    NEW_NODE_UUID is the global unique identifier of the new Virtuozzo node and LB_NAME is the name assigned to the failed load balancer. See Step 6 and 7 above for information on how to find out these parameters.

  10. Start the Terracotta service and the IM service on the IM node:

    # service PACI-im start
    # service terracotta stop
  11. Remove the failed Virtuozzo node from Operations.