> For the complete documentation index, see [llms.txt](https://docs.verge.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verge.io/knowledge-base/automation-api/determine-node-where-vm-runs.md).

# Settings that Influence VM Node Selection

Explains VM options that control which node a VM runs on, including HA group affinity and anti-affinity, preferred node, preferred cluster, and failover cluster settings.

Each time a VM is powered on or migrated, the system decides where to run the VM based on user-specified VM options as well as balancing workloads across available nodes.

**VM options used in deciding node selection for running a VM:**

* **HA Group**
  * **Node Affinity:** (value starts with a "+", e.g. "+commapp") The system attempts to run VMs with the same HA Group value on the same node. This is used to coalesce application-related workloads to a single physical node for performance optimization.
  * **Node Anti-affinity:** (value does NOT start with "+", e.g. "webservers") VMs with the same HA Group value are run on separate nodes to provide high availability of applications or services.
* **Preferred Node:** a specific node is selected as the first-choice
* **Preferred Cluster:** nodes in specified cluster used as first choice
* **Failover Cluster:** nodes in specified cluster used as next choice when preferred cluster is not available

{% hint style="info" %}
**For more information about these and other VM options, see:** [**Product Guide - Virtual Machine Fields**](/run-the-platform/virtual-machines/vm-field-descriptions.md)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.verge.io/knowledge-base/automation-api/determine-node-where-vm-runs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
