Sample config for collocation rules

The collocation rules are used to specify that selected virtual machines must always be kept on the same host (affinity) or can never be placed on the same host (anti-affinity). Both cloud administrators and project administrators are allowed to manage the collocation rule.

In this guide, steps to create the collocation rule, as well as using the collocation rule in the deploy template are outlined. Typical scenarios for the deployment are shown.

For more information about the collocation rules, refer to Collocation Rules.

Steps to use the collocation rule to create a deploy template:

1.On the create collocation rule page, input the name for the rule and select one policy type amongst Affinity, Soft-Affinity, Anti-affinity and Soft-Anti-affinity.

Figure1 avatar

2.In create deploy template page, project admin can select which collocation rule to use. For Collocation rule, the default rule is None, select rule other than None when you want to apply collocation rule in the deployment.

Figure2 avatar

Typical scenarios for deployment:

Collocation rule can be selected together with availability zone and host group(via aggregate instance extra specs) when creating deploy template, for simplicity, only collocation rule will be selected when creating deploy template. Graph3 is the cloud environment where all hosts are in Default Group availability zone.

Figure3 avatar

In the following figures, the deployment flow is shown from left to right: the project administrator creates the deploy template first. Then the self-service user uses the deploy template to deploy the virtual machines and ,finally, after the deployment, the virtual machines' status.

scenario1: the deploy template for a user to deploy VMs using the affinity collocation rule.

On the create deploy template page, select the affinityrule as the collocation rule. On the deployment page, use the deploy template to deploy two virutal machines. The two virtual machines are placed on the same host.

Figure4 avatar

scenario2: the deploy template for a user to deploy VMs using the antiaffinity collocation rule.

On the create deploy template page, select the antiaffinity rule as the collocation rule. On the deployment page, use the deploy template to deploy two virutal machines. The two virtual machines are placed on different hosts.

Figure5 avatar