Xen中,使用XL还是XM?

用过Xen的几乎都知道xm/xend这一套工具,但是最近社区中都是在讨论xl这个工具,特别是对老用户,可能有些疑惑,我们使用Xen之时,到底是XL还是XM作为工具。

我接触Xen也一年多了,每天工作都和Xen打交道,而且经常在Xen开源社区中交流,所以这里我总结一下我的认识,给对xl这个新工具有疑惑的同学答疑一下吧。

  1. 如果你是老用户,而且使用的Xen版本较低(低于4.1),那么你只能使用xm/xend这套老的工具了。
  2. 凡事使用xen的版本等于或高于4.1,强烈推荐使用XL这个工具。

一些原因如下:

  1. XL在Xen 4.1中作为默认的管理工具,而且开源社区现在都是主要支持xl
  2. xl具有和xm几乎完全一致的使用方法,完全兼容。(如果你发现哪里不兼容,请到xen-devel邮件组报告bug吧。)
  3. 目前xm/xend也是作为遗留代码,留在最新的xen开发分支中的,功能基本可用。
  4. 今后的xen版本(比如:5.x之类的),可能就会完全去掉xm/xend相关的代码。
  5. xl主要基于libxl这个库来实现的
  6. xl的功能比较完善了,今后如果添加新功能,也会是在xl这边添加。
  7. xl与以前的xm相比,缺失的主要功能是:managed domain 和 一个XML RPC接口。

 

问:使用xl时,需要启动xend吗?

答:不需要,xl不依赖于xend,而且建议使用xl时关掉Xend的运行;另外,请注意xencommons这个daemon还是要启动的(它一般位于/etc/init.d/xencommons,其实它也是去启动了xenstored 和 xenconsoled两个daemon)。

下面是我收集的一些关于是否使用xl的英文材料,有兴趣的可以看看。

XL wiki:

http://wiki.xen.org/wiki/XL

As of Xen 4.1, xl is the default toolstack supplied as part of the Xen release. The older xend toolstack is still available in tree but is considered deprecated and may eventually be removed.

xl is based on the xenlight library (libxl), a library designed to provide a common "bottom third" for any Xen toolstack.

 

Xen 4.1 release notes.

http://blog.xen.org/index.php/2011/03/25/xen-4-1-releases/

XL Toolstack: Xen 4.1 includes a re-architected toolstack, that is based on the new libxenlight library, providing a simple and robust API for toolstacks. XL is functionally equivalent and almost entirely backwards compatible with existing XM domain configuration files. The XEND toolstack remains supported in Xen 4.1 however we strongly recommend that users upgrade to XL.

 

some discussions about XL/XM in Xen-devel mailing list:

http://xen.1045712.n5.nabble.com/New-feature-support-xl-or-xm-td2516259.html

xl does have the callback mechanisms for cleanup, they are implemented in a per-VM daemon that is started when you create the domain. However you can still create a VM without starting the related daemon.

(no callbacks or cleanups in that case).

There are only two things that xl doesn't have compared to xend: the concept of managed domains (domains that are installed on your system and may be offline) and an XML-RPC interface.

We like the 'xm' CLI, in fact we are trying our best to provide a compatible command line interface with 'xl'. Ideally you'll be able to symlink xl to xm and everything will still work.

libxl does use libxenctrl and libxenguest. But it does not use xend and so does not need it to be running.

if you want to migrate your VMs to another 4.1 (or 4.2 or 5.0, etc.) host without xend you just need to shutdown xend (leaving the VMs running) and use xl to perform the migration.

 

http://lists.xen.org/archives/html/xen-devel/2012-01/msg02227.html

http://lists.xen.org/archives/html/xen-devel/2012-01/msg02227.html

Features missing in Xl, with no current plan to introduce them (as usual, contributions are welcome and encouraged):

- python support in VM config files;

- an RPC interface;

- managed domain;

- pv-usb;

- netchannel2;

- pv-scsi;

 

Features missing in Xl, work in progress:

- Remus;

- machine parsable output from xl create.

master

Stay hungry, stay foolish.

4 Comments

  1. 我在ubuntu12.04上安装了xen4.1.2
    如果开机时启动xend,关闭xend后,使用xl正常
    如过开机时没有启动xend,则使用xl
    请问您知道这是因为什么吗

    • 如果xencommons存在,需要 /etc/init.d/xencommons start 来启动一些daemon后才能使用xl;使用xl 时,最好将xend关掉。 (另外你描述的问题也不够清楚 :-))

  2. 想问问 如果关闭了xend 怎么用libvirt连接xen呢?
    直接连接会报错。connection refused unable to connect localhost:8000

发表评论

邮箱地址不会被公开。 必填项已用*标注

*