Skip to main content

DRS rules and groups

A placement rule defines where VMs must run relative to each other and to nodes. For example: two database replicas on different nodes, so that a single node failure does not stop both; VMs with a license tied to specific servers only on those servers. The rules are applied at VM start, auto-restart and migration, in node maintenance mode and by DRS.

Rule types​

TypeWhat it means
Keep VMs togetherThe VMs of the rule run on the same node. Use it for VMs that exchange data intensively
Separate VMsThe VMs of the rule run on different nodes, so a single node failure does not stop all of them
VMs to nodesThe VMs run only on the nodes of a node group or, on the contrary, not on them. Enforcement: Must run on nodes in group, Should run on nodes in group, Must not run on nodes in group, Should not run on nodes in group

Rules on a four-node cluster: web-01 and web-02 apart, app-01 and db-01 together, lic-01 only on the nodes of the licensed nodes group

A mandatory VMs to nodes rule is never violated by a start, a migration or an auto-restart: if no suitable node is available, the VM does not start or move. A preferred one is followed when possible: a resource shortage, a node failure or a manual migration may violate it.

Separate VMs has the On node failure setting:

  • Restart anyway — after a node failure the VMs are restarted even if they end up on the same node;
  • Do not restart — a VM that has no separate node stays powered off until such a node becomes available. The wait is visible in the VM tasks.

Rule enforcement​

MechanismBehavior
VM start without a chosen nodePicks a node where the rules hold; does not pick a node that violates a mandatory VMs to nodes rule
Start and migration to a chosen nodeThe operation is refused if the node violates a mandatory VMs to nodes rule or no node satisfies it. The node selection window shows which node a rule forbids and which node would violate a rule
Auto-restartDoes not violate a mandatory VMs to nodes rule or Separate VMs with Do not restart
DRS and node maintenance modeDo not violate Keep VMs together, Separate VMs or a mandatory VMs to nodes rule. DRS proposes moves to fix a violated rule — with the reason Fix rule <name>. DRS fixes preferred rules at thresholds 2–5 and only if the move does not noticeably worsen the balance

For a user without rights to the whole cluster, the refusal message does not include the rule name.

While DRS is off, the rules are followed when VMs start and auto-restart, but violations are not fixed. The Rules tab shows a reminder about this.

Before you begin​

  • To see rules and groups, you need the "View DRS" privilege in a role assigned to the whole cluster. To create, change, enable and delete them, you need the "Configure DRS" privilege; only the Cluster master has it.
  • For a VMs to nodes rule, create a node group first.

1. Create a group​

A group is a named set of VMs, nodes or VDCs that a rule refers to. A rule on a VDC group applies to all VMs of those VDCs, including ones created later.

  1. In the left menu, select Provider Data Center → the cluster name and open the DRS Compute tab.
  2. In the tab menu, select VM Groups, Node Groups or VDC Groups.
  3. Click Create group.
  4. Enter the Name, select the Members and click Create.

Center shows Group <name> saved. The groups table shows the Name, Members and the Rules that refer to the group. To change or delete a group, use the ⋮ menu at the end of the row or the panel that opens when you click the row.

The group name must be unique, otherwise Center rejects it with the message "The name <name> is already used". A group that rules refer to cannot be deleted: "The group is used by rules: <list>. Remove it from these rules first".

2. Create a rule​

  1. In the DRS tab menu, select Rules and click Create rule. A panel opens on the right.
  2. Enter the Name.
  3. Select the Rule type. Below the list, a description of the selected type is shown.
  4. In Applies to, select which VMs the rule applies to: Several VMs, VM group, VDC or VDC group. Then select the VMs, the group or the VDC themselves. The Keep VMs together and Separate VMs rules need at least two VMs.
  5. For VMs to nodes, select the Node group and the Enforcement. For Separate VMs, select the On node failure behavior.
  6. Check the summary line at the bottom of the panel, for example web-01, web-02 will run on different nodes., and click Save.

Center shows Rule <name> saved, and the rule appears in the table switched on.

If a rule conflicts with another one​

Rules conflict when they cannot be met together: for example, "together" and "apart" for the same two VMs, or a VM has no allowed nodes left. The senior rule — the one enabled earlier — takes precedence. Center saves a new conflicting rule switched off: Rule saved switched off: it conflicts with <rule>.

A rule for VMs or a VM group takes precedence over a VDC rule: if they contradict, the VM rule applies to the shared VMs. A VDC rule shows this as Does not apply to <N> VMs: overridden by VM rules.

Preferred VMs to nodes rules do not create conflicts.

3. Watch the rule status​

The Rules table has an on/off switch, Name, Rule type, Applies to, Nodes, Enforcement and Status:

StatusWhat it means
Satisfiedall VMs of the rule are placed according to it
Violated (<N>)the number of VMs whose placement violates the rule
Disabledthe rule is switched off
Conflicts with <rule>the rule is switched off because of a conflict with a senior rule
Group is emptythe rule's group is empty; such a rule is not enforced

A "Separate VMs" rule with more VMs than nodes shows the warning More VMs than nodes: some VMs will share a node.

To disable a rule temporarily, turn it off with the switch in its row. To change or delete a rule, use the panel that opens when you click the row or the ⋮ menu.

Check the result​

The rule status is Satisfied. If it is Violated, with DRS enabled the Recommendations tab gets moves with the reason Fix rule <name>: at the Fully Automated level DRS applies them automatically; at other levels, apply them manually. If a VM cannot be moved, it appears on the Faults tab with the reason "Would violate rule <name>" or "No suitable node". View the load and apply DRS recommendations

To check what DRS would do without a rule, run a simulation — DRS simulation.

When a VM or a VDC is deleted, Center removes it from groups and rules and deletes the rules of that VDC; the cluster Tasks get a record of it.

Next​

API methods: drs-group-list, drs-group-set, drs-group-delete, drs-rule-list, drs-rule-set, drs-rule-delete — in the API reference.