虚拟机的热迁移无论对于公有云还是私有云都是重要的功能,尤其是为了保持高可用,不down机更新等,热迁移更是必不可少,但是如何测试云热迁移的性能,发现热迁移的瓶颈,找寻了很多方法,最后发现qemu monitor本身就提供了很好监控热迁移以及虚拟机各项指标的功能,并且可以通过在qemu monitor里配置优化迁移的特性达到提高迁移效率或者实现一些特定条件的热迁移,下面几篇内容会包含对于qemu monitor的搭建和使用,以及对于live migration和部分优化手段的测试。
我们先看看做热迁移的要求(https://www.linux-kvm.org/page/Migration )
The VM image is accessible on both source and destination hosts (located on a shared storage, e.g. using nfs).
It is recommended an images-directory would be found on the same path on both hosts (for migrations of a copy-on-write image -- an image created on top of a base-image using "qemu-image create -b ...")
The src and dst hosts must be on the same subnet (keeping guest's network when tap is used).
Do not use -snapshot qemu command line option.
For tcp: migration protocol
the guest on the destination must be started the same way it was started on