实时迁移会发生什么

What happens under live migration

我想了解在执行我的最后一年项目的实时迁移中发生了什么

据我了解,两台主机通过 SAN 共享一个公共存储

1)当一个虚拟机从一台主机迁移到另一台主机时,虚拟机文件从一个ESXI传输到另一个,但问题是它们有一个共享存储,所以它们将如何传输。

2)VMDK,实时迁移时传输快照文件

现在我有问题

1)只传输VMDK、.vmx文件

2) 使用 VMotion 传输内存页,那么这些内存页是什么,它们是文件,还是它们在物理上是什么

3)迁移的代码在哪里,在管理程序或 VCenter

4)我们能否在迁移过程中获取 vm 和管理程序的堆栈跟踪信息,如果可以,那怎么可能(我尝试了 strace 来了解 VM (ubuntu) 如何调用hypervisor 但这只给我直到 linux 系统而不是超出那个)

任何人都可以指导我吗。

VMotion overview

Phase 1: Guest Trace Phase

The guest VM is staged for migration during this phase. Traces are placed on the guest memory pages to track any modifications by the guest during the migration. Tracing all of the memory can cause a brief, noticeable drop in workload throughput. The impact is generally proportional to the overall size of guest memory.

Phase 2: Precopy Phase

Because the virtual machine continues to run and actively modify its memory state on the source host during this phase, the memory contents of the virtual machine are copied from the source vSphere host to the destination vSphere host in an iterative process. The first iteration copies all of the memory. Subsequent iterations copy only the memory pages that were modified during the previous iteration. The number of precopy iterations and the number of memory pages copied during each iteration depend on how actively the memory is changed on the source vSphere host, due to the guest’s ongoing operations. The bulk of vMotion network transfer is done during this phase—without taking any significant number of CPU cycles directly from the guest. One would still observe an impact on guest performance, because the write trace fires during the precopy phase will cause a slight slowdown in page writes.

Phase 3: Switchover Phase

During this final phase, the virtual machine is momentarily quiesced on the source vSphere host, the last set of memory changes are copied to the target vSphere host, and the virtual machine is resumed on the target vSphere host. The guest briefly pauses processing during this step. Although the duration of this phase is generally less than a second, it is the most likely phase where the largest impact on guest performance (an abrupt, temporary increase of latency) is observed. The impact depends on a variety of factors not limited to but including network infrastructure, shared storage configuration, host hardware, vSphere version, and dynamic guest workload.

根据我的经验,我会说在 阶段 3 期间我总是至少失去 1 ping

关于您的问题:

1) 所有数据都通过 TCP/IP 网络传输。没有 .vmdk 被传输,除非它是 Storage VMotion。您可以在 documentation

中找到所有详细信息

2) .nvram是VMware VM内存文件。可以验证所有 VMware VM 文件类型列表 here

3) 所有逻辑都在管理程序中。 vSphere Client/vCenter 是管理产品。 VMware 拥有专有代码库,因此我认为您无法获得实际源代码。同时也欢迎大家查看ESXiclidocumentation。由于许可限制,VMotion 调用只能通过客户端完成。

4) 来宾 OS(在您的情况下 Ubuntu)根本不知道它使用虚拟硬件这一事实。一般而言,来宾 OS 无法跟踪迁移或任何其他 VMware kernel/vmfs activity。