leaseweb knowledge base logo - white color on the orange background

Managing Apache CloudStack Affinity Groups

Managing Apache CloudStack Affinity Groups

Description

To further reduce fault tolerance, running multiple instances serving your application/ service together with the load balancer feature provided from the virtual router in CloudStack, is recommended. In case you have multiple servers running your services, you can assign instances to an Affinity group in CloudStack. This keeps instances from the same Affinity group with rule “host anti-affinity” deployed on different hypervisors as much as possible. Should a host fail and your instance goes down, another instance on a different host serving the same content keeps working preventing your entire service from being unavailable.

Information

Affinity groups can be attached to instances while creating the instance. You can change an Affinity group of an existing instance from the Instance Details tab. Make sure to stop the instance before changing the Affinity group.


Contents

Adding an Affinity Group

  1. From the left menu choose Compute Affinity Groups, click Add new Affinity Group.
  2. Provide a name, optionally the description and choose affinity type.
    69960067 

    Information

    Affinity types Description
    host anti-affinity CloudStack deploys instances on different hypervisors as much as possible.
    host affinity CloudStack deploys instances on same hypervisor as much as possible.

Adding an existing Instance to an Affinity group

  1. From the left menu choose Compute Instances, click on the instance name.

  2. Stop the instance, by clicking on Stop instance from the top right options.
    69960066
  3. Click on Change Affinity, from the top right options.
    69960065
  4. Select the Affinity group and confirm by clicking OK.
  5. Make sure to start up your instance again.