> 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/zh/automation-api/determine-node-where-vm-runs.md).

# 影响虚拟机节点选择的设置

每次虚拟机启动或迁移时，系统都会根据用户指定的虚拟机选项以及在可用节点之间平衡工作负载来决定在哪里运行该虚拟机。

**用于决定运行虚拟机时节点选择的虚拟机选项：**

* **HA 组**
  * **节点亲和性：** （值以“+”开头，例如“+commapp”）系统会尝试将具有相同 HA 组值的虚拟机运行在同一节点上。这用于将与应用相关的工作负载合并到单个物理节点，以优化性能。
  * **节点反亲和性：** （值不以“+”开头，例如“webservers”）具有相同 HA 组值的虚拟机会运行在不同的节点上，以提供应用程序或服务的高可用性。
* **首选节点：** 选择某个特定节点作为首选
* **首选集群：** 指定集群中的节点作为首选
* **故障切换集群：** 当首选集群不可用时，指定集群中的节点作为备选

{% hint style="info" %}
**有关这些及其他虚拟机选项的更多信息，请参阅：** [**产品指南 - 虚拟机字段**](/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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
