> 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).

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

解释控制虚拟机运行在哪个节点上的 VM 选项，包括 HA 组亲和性和反亲和性、首选节点、首选集群和故障转移集群设置。

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

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

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

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