XenMotion,Vmotion和Live Migration分别是Xen(XenServer),VMware(ESX)和Microsoft(Hyper-V)的非常重要的一个功能,也是众多IT人员非常喜欢的功能.
他能够在无宕机的情况下将虚拟机从一台主机迁移到另外一台主机,然后对主机进行维护.
但是我们只是知道有这么一个很棒的功能,但是在具体的实施时需要考虑CPU的限制,如果所有的物理主机都用相同型号的CPU,那肯定没有问题,但是随着时间的推移,CPU更新换代了,这个问题就会凸显出来.
最近在研究Xen的产品,搭建Resource Pool时发现有这么一个问题,顺便研究了一下.
对于XenServer,其要求如下:
Requirements for creating Resource Pools
A Resource Pool is an aggregate of one or more homogeneous XenServer Hosts, up to a maximum of 16. The definition of homogeneous is:
- each CPU is from the same vendor (in particular AMD-V and Intel VT CPUs cannot be mixed);
- each CPU is the same model (except for stepping); and
- each CPU has the same feature flags.
In addition to being homogeneous, an individual XenServer Host can only join a Resource Pool if:
- it has a static IP address (either manually assigned or via DHCP);
- it is not a member of an existing Resource Pool;
- it has a clock synchronized to the pool master server (e.g. via NTP);
- it has no shared storage configured; and
- there are no running or suspended VMs on the XenServer Host;
XenServer Hosts in Resource Pools may contain different numbers of physical network interfaces. Local storage repositories may also exist, of varying size. In practice, it is often difficult to obtain multiple hosts with the exact same CPUs, and so minor variations are permitted. If you are sure that it is acceptable in your environment for hosts with varying CPUs to be part of the same Resource Pool, then the pool joining operation may be forced.
他的要求比较严格,首先是同一个厂家的产品,其次是相同型号,再次是相同的Feature Flags。
我所用的两台机器的CPU分别是Intel XEON E5530和Intel XEON E5310,所以不能加入到同一个Resource Pool,不能实现XenMotion
加入pool时会有报错信息,如下图:
对于VMware的ESX,其要求如下:
VMware Enhanced VMotion Compatibility (EVC)―available in VMware Infrastructure 3 beginning with
version 3.5 Update 2―facilitates VMotion between different CPU generations, taking advantage of Intel Flex
Migration and AMD�\V Extended Migration technologies. When enabled for a cluster, EVC ensures that all
CPUs within the cluster are VMotion compatible. CPUs starting with Intel 45nm Core 2 (Penryn) and AMD
Second Generation Opteron (revision E or F) incorporate FlexMigration and Extended Migration technologies,
respectively.
http://www.vmware.com/files/pdf/vmotion_info_guide.pdf
VMware现在有一种新的技术,称之为EVC,其利用Intel和AMD的硬件支持可以比以前的兼容性好一些,但是对于老的CPU限制环视很大,其官方有一个列表,见如下连接。另外VMware还制作了CPUID的引导光盘,可以在安装之前检查其CPU的兼容性
http://virtualisedreality.wordpress.com/2009/06/09/vmotion-cpu-compatibility-requirements-for-intel-processors
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1003212
对于Microsoft的Hyper-V,其要求如下:
Most of the well-behaved applications written use the recommended method of querying processor features available through calling the CPUID instruction. In the virtualization environment, when a VM is moved to another server the software applications running inside VM are completely unaware of the change. An application may try to execute CPU features that it discovered when it was started on source host but they may not be present on the destination host. The virtualization platform needs to ensure applications continue to run successfully. This is performed by the processor compatibility check. The processor compatibility check is performed before restoring a running VM on the destination to ensure destination host has identical or superset of source host’s CPU features. As per the compatibility check if a VM is moved from host A to host B, depending upon processor features of host A and host B, the VM migration might fail or succeed. See below table for details.
ost A processor features
|
Host B processor features
|
VM migration
|
Results
|
Same as host B
(features: X, Y, Z)
|
Same as host A
(features: X, Y, Z)
|
Host A to Host B,
Host B to Host A
|
Succeeds
Succeeds
|
Superset of host B
(features: X, Y,Z)
|
Subset of host A
(features: X, Y)
|
Host A to Host B
Host B to Host A
|
Fails
Succeeds
|
Subset of host B
(features: X, Y)
|
Superset of host A
(features: X, Y,Z)
|
Host A to Host B
Host B to Host A
|
Succeeds
Fails
|
Different set of host B*
(features: X, Y)
|
Different set of host A*
(features: Y, Z)
|
Host A to Host B
Host B to Host A
|
Fails
Fails
|
*There are no processors today that fall into this scenario but it is possible in future when processor vendors stop shipping some rarely used features.
While processor computability check provides robust VM migration, it also reduces flexibility, so starting Windows Server 2008 R2 RC Hyper-V introduces Processor compatibility mode capability that will allow VM migration between hosts A and B successfully.
简单来说,Microsoft的要求是可以从功能集多的CPU迁移到功能集少的CPU上,但是不能反过来迁移.
总和来说,虚拟机迁移时会检查源主机和目的主机的CPU的指令集,如果目的主机的指令集少于或者不同于源主机,那样操作系统的支持会有问题,所以不能迁移成功.