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

# 实验：VMware 迁移

## 目标

规划并执行一次完整的 VMware 到 VergeOS 迁移。你将评估现有的 VMware 工作负载，规划迁移，将虚拟机导入 VergeOS，重新配置网络，并验证工作负载在迁移后能正常运行。

## 前置条件

* 已完成所有前置模块（1–9）
* 已完成 HCI 和 UCI 部署实验
* 一个正在运行的 VergeOS 集群（来自之前的实验或专用环境）
* 可访问一个 VMware 环境，其中至少有 1–2 台待迁移的虚拟机（或已导出的虚拟机文件）
* 理解 VMware 网络概念（vSwitch、端口组、VLAN）

## 难度

**高级** -- 需要同时具备 VMware 和 VergeOS 环境的实操经验

## 预计时间

**2 小时**

## 步骤

### 第 1 部分：迁移规划

评估源环境并规划迁移。

1. 清点 VMware 环境：
   * 列出要迁移的虚拟机（名称、操作系统、vCPU、内存、磁盘大小）
   * 记录网络配置（端口组、VLAN、IP 地址）
   * 确定存储需求（精简/厚置备，总容量）
   * 记录任何特殊配置（GPU 直通、RDM、快照）
2. 创建一份迁移计划文档，其中包括：
   * 源到目标的资源映射（VMware → VergeOS）
   * 网络映射（vSphere 端口组 → VergeOS 虚拟网络）
   * 迁移顺序以及虚拟机之间的依赖关系
   * 回滚策略
   * 每台虚拟机的预计停机时间
3. 验证目标 VergeOS 集群是否有足够容量容纳所有已迁移的工作负载

### 第 2 部分：虚拟机导入

将虚拟机从 VMware 导入 VergeOS。

{% hint style="success" %}
**VMware 连接器**

对于实时生产迁移，请考虑使用 **VMware 连接器** （导入/导出 → VMware Services → New Service），它可通过 API 直接连接到 vSphere，并在源虚拟机保持运行时使用变更块跟踪（CBT）执行增量备份——仅需一次简短的最终切换备份（此时源虚拟机关闭）即可完成切换。下面的步骤使用 OVF/文件导入方法，适用于实验环境。
{% endhint %}

1. 从 VMware 导出虚拟机（OVF/OVA 格式）或准备直接导入
2. 在 VergeOS 界面中，导航到 **虚拟机 → + 新建虚拟机 → --从文件导入--**
3. 导入第一台虚拟机并配置：
   * CPU 和内存分配
   * 将磁盘分配到合适的存储层
   * 网络接口映射到 VergeOS 虚拟网络
4. 启动已导入的虚拟机，并验证它能成功启动
5. 对其他虚拟机重复上述步骤
6. 记录导入过程中遇到的任何问题以及如何解决

### 第 3 部分：网络重新配置

确保已迁移的虚拟机具有正确的网络连通性。

1. 验证每台已迁移虚拟机的网络接口是否连接到正确的 VergeOS 虚拟网络
2. 确认 IP 地址配置：
   * 如果使用 DHCP，验证虚拟机是否已获取地址
   * 如果使用静态 IP，验证配置是否正确
3. 测试连通性：
   * 同一网络内的虚拟机之间通信
   * 虚拟机访问外部网络
   * 任何所需的防火墙规则都已到位
4. 比较迁移前后的网络性能（如果可测量）

### 第 4 部分：验证与文档

验证迁移并创建运行手册。

1. 对于每台已迁移的虚拟机，验证：
   * 应用程序/服务运行正常
   * 性能可接受（CPU、内存、磁盘 I/O）
   * 所有网络连通性均正常
   * 任何计划任务或 cron 作业都在运行
2. 运行一次基础负载测试或应用测试，以确认稳定性
3. 创建一份迁移运行手册，记录：
   * 所遵循的逐步流程
   * 遇到的问题及解决方案
   * 每台虚拟机所花费的时间
   * 未来大规模迁移的建议
4. 明确在生产迁移中你会采取哪些不同做法

## 验证

当你能够对以下所有内容回答 **是** 时，你的 VMware 迁移实验就完成了：

* [ ] 创建了一份包含源到目标资源映射的详细迁移计划
* [ ] 已成功将至少一台虚拟机从 VMware 导入 VergeOS
* [ ] 已验证导入的虚拟机能启动并正常运行其应用程序/服务
* [ ] 已确认所有已迁移虚拟机的网络连通性
* [ ] 已将迁移流程记录为可复用的运行手册
* [ ] 已识别经验教训以及面向生产迁移的建议


---

# 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-migration.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.
