Affinity Groups
91
• Host tags. The administrator can assign tags to hosts. These tags can be used to specify which host
a VM should use. The CloudPlatform administrator decides whether to define host tags, then create
a service offering using those tags and offer it to the user.
• Affinity groups. By defining affinity groups and assigning VMs to them, the user or administrator
can influence (but not dictate) which VMs should run on separate hosts. This feature is to let users
specify that certain VMs won't be on the same host.
• CloudPlatform also provides a pluggable interface for adding new allocators. These custom
allocators can provide any policy the administrator desires.
11.8.1. Affinity Groups
By defining affinity groups and assigning VMs to them, the user or administrator can influence (but not
dictate) which VMs should run on separate hosts. This feature is to let users specify that VMs with the
same “host anti-affinity” type won’t be on the same host. This serves to increase fault tolerance. If a
host fails, another VM offering the same service (for example, hosting the user's website) is still up
and running on another host.
The scope of an affinity group is per user account.
Creating a New Affinity Group
To add an affinity group:
1. Log in to the CloudPlatform UI as an administrator or user.
2. In the left navigation bar, click Affinity Groups.
3. Click Add affinity group. In the dialog box, fill in the following fields:
• Name. Give the group a name.
• Description. Any desired text to tell more about the purpose of the group.
• Type. The only supported type shipped with CloudPlatform is Host Anti-Affinity. This indicates
that the VMs in this group should avoid being placed on the same VM with each other. If you
see other types in this list, it means that your installation of CloudPlatform has been extended
with customized affinity group plugins.
Assign a New VM to an Affinity Group
To assign a new VM to an affinity group:
• Create the VM as usual, as described in Section 11.4, “Creating VMs”. In the Add Instance wizard,
there is a new Affinity tab where you can select the affinity group.
Change Affinity Group for an Existing VM
To assign an existing VM to an affinity group:
1. Log in to the CloudPlatform UI as an administrator or user.
2. In the left navigation bar, click Instances.
3. Click the name of the VM you want to work with.
4. Stop the VM by clicking the Stop button.