> 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/learn-the-platform/zh/mo-kuai-10-chang-jing-shi-yan/lab-hci.md).

# 实验：HCI 部署

## 目标

使用 Terraform playground 在超融合基础设施（HCI）配置中部署 VergeOS。你将分别部署一个最小化的 2 节点集群和一个扩展的 4 节点集群，然后验证存储、网络和整体集群健康状况。

## 前置条件

* 已完成所有前置模块（1–9）
* 可访问 vergeos-terraform-playground 仓库（已在本地克隆）
* 已安装并配置 Terraform CLI
* 支持嵌套部署的 VergeOS 环境或实验室
* 熟悉 Terraform 基础知识（init、plan、apply）

## 难度

**中级** -- 需要理解 VergeOS 架构和 Terraform 的基本用法

## 预计时间

**2 小时**

## 步骤

### 第 1 部分：2 节点 HCI 部署

部署最小化的 HCI 拓扑。

1. 克隆 vergeos-terraform-playground 仓库（如果尚未完成）
2. 查看 `examples/` 目录并找到 2 节点 HCI `.tfvars` 文件
3. 检查变量以了解：
   * 节点数量和角色
   * 网络配置（核心 fabric、外部）
   * 存储层配置
4. 运行 `terraform init` 以初始化提供程序
5. 运行 `terraform plan -var-file=<2-node-hci>.tfvars` 并查看计划的资源
6. 运行 `terraform apply -var-file=<2-node-hci>.tfvars` 以部署
7. 登录 VergeOS UI 并验证：
   * 两个节点都在仪表板中显示为在线
   * 核心 fabric 网络已建立
   * vSAN 存储池健康，容量符合预期
   * 控制器节点角色分配给 Node 1 和 Node 2（存在 Tier 0 元数据存储）

### 第 2 部分：4 节点 HCI 部署

扩展为 4 节点 HCI 集群。

1. 找到 4 节点 HCI `.tfvars` 文件（位于 examples 目录中）
2. 将其与 2 节点配置进行比较——注意以下差异：
   * 节点数量
   * 存储冗余设置
   * 任何额外的网络配置
3. 使用以下命令部署 4 节点拓扑： `terraform plan` 以及 `terraform apply`
4. 在 VergeOS UI 中验证：
   * 所有四个节点都在线且健康
   * 存储已重新分布到所有节点
   * 控制器节点故障切换（Node 1 / Node 2 上的 HA 配对）正常
   * 所有节点之间的网络连通性已建立

### 第 3 部分：验证与比较

比较这两种部署并验证生产就绪性。

1. 在每个集群上创建一个测试虚拟机并验证其可成功启动
2. 测试虚拟机在节点之间的热迁移
3. 比较 2 节点和 4 节点部署之间的资源利用率
4. 记录以下方面的差异：
   * 存储冗余和容量
   * 计算资源余量
   * 故障域考虑
5. 使用以下命令清理两个部署： `terraform destroy`

## 验证

当你能够回答以下问题时，你的 HCI 部署实验就完成了： **是** 时，你的 VMware 迁移实验就完成了：

* [ ] 已通过 Terraform 成功部署 2 节点 HCI 拓扑
* [ ] 已通过 Terraform 成功部署 4 节点 HCI 拓扑
* [ ] 已在 VergeOS UI 中验证集群健康状况、存储池和网络
* [ ] 已在至少一个集群上创建并迁移测试虚拟机
* [ ] 已记录 2 节点和 4 节点 HCI 部署之间的关键差异
* [ ] 使用以下命令清理所有实验资源： `terraform destroy`


---

# 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/learn-the-platform/zh/mo-kuai-10-chang-jing-shi-yan/lab-hci.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.
