Collocation rules

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). These rules are enforced when a virtual machine is relocated. In OpenStack, collocation rules are called Server Groups.

During deployment, migration, and remote restart PowerVC ensures that these rules are followed. However, if virtual machines are migrated by using an out-of-band operation, it is possible that these rules will be violated. If that happens, the PowerVC user interface shows that the status of the rule is violated on the collocation rules details page.
If the status is violated, review the placement of the virtual machines, which are listed on the details page. For any virtual machines that are on an incorrect host, remove them from the rule. You can then migrate the virtual machine to the correct host and add it to the collocation rule again.
Note: If there is a conflict between the collocation rule and the placement policy, the collocation rule takes precedence.
Collocation rules are helpful in many situations, such as the following:
High availability
It is essential in a high availability environment that redundant virtual machines do not run on the same host. Otherwise, if the host fails, both virtual machines are impacted.
Improve IO performance
Keeping certain virtual machines on the same host can decrease network latency and therefore, improve IO performance. For example, you might want to ensure that your web server and Java™ Platform, Enterprise Edition (Java EE) server are always running on the same host to reduce network latency.

Using collocation rules

You can also deploy a virtual machine directly into an existing collocation rule. You can update a collocation rule any time and then add or remove virtual machines at any time after the virtual machines are deployed. Each virtual machine can belong to one or more collocation rules. To create a new rule, navigate to Configuration > Collocation Rules.


Migrating or remote restarting virtual machines in an affinity collocation rule
When virtual machines are migrated or remote restarted, one virtual machine is moved at a time. This has the following implications for virtual machines in collocation rules that specify affinity:
  • The virtual machines cannot be migrated or remote restarted on another host.
  • When you put a host into maintenance mode, if that host has multiple virtual machines in the same collocation rule, you cannot migrate active virtual machines to another host.

To migrate or remote restart a virtual machine in the above situations, it must first be removed from the collocation rule. After the virtual machine is migrated or remote restarted, it can be added to an appropriate collocation rule.

Ongoing operations in parallel for virtual machines in the same collocation rule
Only one migration or remote restart at a time is allowed for virtual machines in the same collocation rule. Therefore, if you try to migrate or remote restart a virtual machine and any other virtual machines in the same collocation rule are being migrated or remote restarted, that request fails.
Placing a host in maintenance mode and migrating all active virtual machines
If the request was made to migrate active virtual machines when entering maintenance mode, the following cannot also be true, or the request will fail:
  • There is a virtual machine on the host that is a member of a collocation rule that specifies affinity and has multiple members.
  • The collocation rule has a member that is already undergoing a migration or is being remote restarted.
Collocation rules and targeted remote restart
Collocation rules cannot be enforced during a targeted remote restart. Therefore, virtual machines could be placed on any host and the collocation rule could become violated.