Forgot your password?
typodupeerror
Programming Book Reviews

The Book of Xen 88

Posted by samzenpus
from the read-all-about-it dept.
swsuehr writes "The Book of Xen: A Practical Guide for the System Administrator provides an excellent resource for learning about Xen virtualization. I frequently need to create test environments for examples that appear in various books and magazine articles (in the interest of full disclosure, I've never written for the publisher of this book). In the days before virtualization that meant finding and piecing together hardware. Like many readers, I've been using virtualization in one form or another for several years, including Xen. This book would've saved hours searching around the web looking for tidbits of information and sifting through what works and doesn't work in setting up Xen environments. The authors have done the sifting for me within the ~250 pages of the book. But far beyond, the authors also convey their experience with Xen using walkthroughs, tips, and recommendations for Xen in the real world." Read on for the rest of Steve's review.
The Book of Xen: A Practical Guide for the System Administrator
author Luke Crawford, Chris Takemura
pages 312
publisher No Starch Press
rating 9/10
reviewer Steve Suehring
ISBN 1593271867
summary A guide for using Xen for virtualization.
The Book of Xen is written with the system administrator in mind; someone who is comfortable with tasks like installing Linux and working with the command line. While it wouldn't be impossible for someone completely new to Linux to accomplish the tasks in the book, a bit of experience would go a long way to both visualize and complete the installation and configuration steps shown in the book. As stated in the introduction, the book is organized "(mostly) alternating between theoretical and practical discussion [because] an admin needs both practical experience and a firm theoretical ground to effectively solve problems..." (xxiii).

The authors do an excellent job of explaining what Xen is and where it fits in the virtualization landscape. This explanation begins with the introduction where the reader gathers a brief history of virtualization along with Xen's place in the landscape. Xen's limitations and reasons for using Xen are also covered right in the introduction, along with an overview of the book.

Chapter 1 begins with a high-level overview of Xen. This discussion is excellent if only to get the readers on equal footing for the discussions to come later in the book. Included in this chapter is a discussion of various techniques for virtualization including Full Virtualization, OS Virtualization, and Paravirtualization. The section on Paravirtualization leads nicely into some of the underlying details of scheduling, interrupts, and memory, and other resource management which are handled by Xen and discussed later in the chapter.

Chapter 2 sends the reader down the path of installing and using Xen. It's a short chapter, coming in at about 9 pages, and the reader is expected to be able to handle an install of CentOS with just a bit of guidance from the authors on specific options to select. This is a key point for those among us who have a preference for a certain Linux distribution. The book isn't tied specifically to a single distro, as the authors note in the introduction, "[w]e've tried to keep this book as distribution- and version-independent as possible, except in the tutorial sections, where we try to be extremely specific and detailed..." (xxiv). The base or host system upon which the examples run is based on CentOS, which the authors acknowledge and highlight in Chapter 2, "[f]or the purposes of this chapter, we'll assume you're installing CentOS 5.x with the server defaults and using its built-in Xen support. If you're using something else, this chapter will probably still be useful, but you might have to improvise a bit" (13). There is discussion of the Xen-tools package in a later chapter which shows its installation under Debian Linux too. So far from being tied to one distro, the book is refreshingly neutral in this regard.

By the end of Chapter 2, the reader has a working Xen host system and a domain 0 or dom0 host upon which to provision virtual machines. Included in Chapter 3 is a discussion of how to provision guest operating systems, known as domU in Xen-speak. The authors devote a good number of pages to making this task clear, and work through examples of basic domU installation and the use of package management systems and Debian's debootstrap to create domUs. Additionally in Chapter 3 the reader learns how to convert VMware disk images to a format usable by Xen.

Chapters 4 and 5 examine details of the Xen backend, including storage and networking. Chapter 4 stands out for its recommendation of blktap and LVM (Logical Volume Manager) as the storage backend as well as an overview of LVM itself, along with the use of networked storage for Xen.

Chapter 6 looks at tools for management of Xen, focusing on Xen-tools, libvirt, and Xen-shell while Chapter 7 gives advice for hosting untrusted users with Xen. Chapter 8 discusses the use of Xen with Unix-like operating systems and includes sections on Solaris and NetBSD.

The ability to migrate the virtual machine from one physical machine to another is one of the advantages of virtualization. As pointed out by the authors, a virtual machine might be migrated to take advantage of newer hardware, to perform maintenance, or any number of other reasons. Chapter 9 is of interest for its discussion of Xen migration. Cold and Live migrations are examined and Footnote 1 on page 126 is interesting for its reference to the Kemari Project and Project Remus which are projects to add hardware redundancy to Xen.

Tools and techniques for the measurement of Xen performance are shown in Chapter 10, which walks the reader through basic usage of well-known tools such as Bonnie++, httperf, UnixBench, and others. More importantly for the Xen admin is the discussion of Xen-aware profilers like Xenoprof which is "a version of OProfile that has been extended to work as a system-wide profiling tool under Xen..." (151).

Chapter 11 covers the Citrix XenServer, which is the enterprise-grade commercial Xen product from Citrix. The authors summarized it best in the review of Chapter 11: "Can Citrix's product replace the open source Xen? As always, the answer is maybe. It offers significant improvements in management and some interesting new capabilities, but that's balanced against the substantial cost and annoying limitations" (174).

Chapter 12 begins the discussion of Hardware Virtual Machines (HVMs), which are virtualization extensions that enable "an unmodified operating system [to run] as a domU" (176). This means the ability to run an unmodified version of Microsoft Windows as a guest OS within a Xen environment. The HVM discussion in Chapter 12 leads nicely into Chapter 13, "Xen and Windows".

The main chapters of the book end with Chapter 14, "Tips", and Chapter 15, "Troubleshooting". Both chapters draw on the experience of the authors and provide value to the book for their recommendations. Though the tool of choice for troubleshooting is the nearest Google search box, it's still helpful to glance over the content in the Troubleshooting chapter if for no other reason than to maybe remember that it's there when you receive the dreaded "Error: DestroyDevice() takes exactly 3 arguments" error.

The Book of Xen is almost certainly a time-saver for anyone looking to implement Xen or virtualization with Linux. The back cover states "The Complete Guide to Virtualization with Xen". The book lives up to that statement and more.

You can purchase The Book of Xen: A Practical Guide for the System Administrator from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

*

This discussion has been archived. No new comments can be posted.

The Book of Xen

Comments Filter:
  • by Itninja (937614) on Monday December 14, 2009 @02:10PM (#30433472) Homepage
    I think that's been done...about 20,000 times [google.com].
  • by MightyMartian (840721) on Monday December 14, 2009 @02:40PM (#30433866) Journal

    You make KVM sound like it's nothing more than a desktop virtualization package, as if somehow it's less of a virtualization solution than Xen, and that's just bullshit.

    I'm running KVM on Ubuntu 9.10 right now with three guests; Windows Server 2003, an Ubuntu 8.04 install running as a file server and a Debian Lenny install for my webserver. With the newer versions of KVM, I should be able to get a SCSI card running on a guest (paravirtualization), so I'll be giving my backup server a shot as a guest as well.

    I'm not trying to claim KVM is better than Xen, but the characterization of KVM that you give might have applied a couple of years ago, but it's just uninformed crapola now.

  • by Lemming Mark (849014) on Monday December 14, 2009 @03:07PM (#30434132) Homepage

    Disclaimer: I've been a Xen developer in the past and I'm currently obliged to work on Xen-related stuff for my degree.

    Minor clarification: Xen support for running as a domU is upstream and there are plans to get dom0 support upstream as well. If getting dom0 support upstream doesn't happen, at least (hopefully) they might be able to base their dom0 kernel on a patchset on top of the kernel.org domU support rather than the horrible forked business they used for a long time :-S

  • by reset_button (903303) on Monday December 14, 2009 @03:18PM (#30434256)

    They're both Linux only at this point, and Xen effectively runs a forked version of Linux because it isn't, and won't be, upstream.

    This is false. You can actually run various BSDs under Xen, and you can run Windows too.

    I believe he meant that the hypervisor itself is a forked version of Linux. Sure, you can run any guest OS you want on both Xen and KVM.

  • by Lemming Mark (849014) on Monday December 14, 2009 @03:24PM (#30434340) Homepage

    Disclaimer: I've been a Xen developer in the past and I'm currently obliged to work on Xen-related stuff for my degree. However, please take the following as my personal opinions!

    Wrt keeping pace with kernel driver development: it's worth noting that most of Xen's hardware support comes from running device drivers within a privileged Linux VM (dom0). So most things supported under Linux should work under Xen, plus new drivers should also work as they're added (assuming you're running an up-to-date Linux, which as others have noted you may not be given Xen's officially supported dom0 has mostly been based on 2.6.18, though I hear rumours that proper support for running kernel.org kernels as dom0 might be coming or already available somewhere). That said, stuff like power management / CPU frequency scaling / hibernate / etc tends to need co-operation from Xen, so that can lead to some duplication and extra complexity for Xen to support (I don't know that it does support hibernate support, for instance).

    I think that the kernel developers have given Xen support in mainline a fairly rough ride (though as the patches were somewhat large and unusual, that's partly understandable). The Xen developers could probably have handled the merge faster by engaging more and better with the kernel community earlier on.

    Regarding distro support - RedHat made Xen a major feature, with good Xen support in RHEL5 (and later support for RHEL4 running as a PV Xen guest) and Fedora. However, relatively early on they started isolating their command-line tools and GUI from the specifics of Xen through an abstraction library called libvirt, a command shell called virsh and a gui called virt-manager. They are now going with KVM as their primary virtualisation feature for the future, with the same UI provided. Obviously they'll have to keep supporting Xen in RHEL due to long term support guarantees. Fedora hasn't supported running as dom0 for a couple of releases as they've decided to stop porting the Xen patches and wait for kernel.org support (they did provide some development and impetus to the mainlining effort, to help this goal along). RedHat has bought the company which wrote KVM and also acquired their SPICE virtual desktop protocol and additions to KVM / Qemu to support this. SPICE is currently most useful for Windows guests from what I've read but it can do some pretty impressive stuff.

    SuSE are still quite keen on Xen AFAIK and Xen is certainly still an OSS project which continues to be developed and enhanced. That said, XenSource (which is now owned by Citrix) isn't really in the business of providing virtualisation for Linux distros (although the open source Xen can do that), so much as in selling "appliance-style" virtualisation software a la VMware ESX. They want to be attractive as a commercial virtualisation platform for whatever is expected to be popular in data centres and they're not so worried about being a de-facto standard in Open Source circles.

  • by jsolan (1014825) on Monday December 14, 2009 @05:20PM (#30435630)
    No, those of use with older servers (without vmx/svm processors) are not. The machines work just fine and XEN allows us to paravirtualize several linux machines on each one. Unfortunately RedHat has lost sight of those customers. As far as I'm aware KVM still requires the intel vt/amd-v technologies to create any guests, which XEN only requires for HVM guests (i.e. windows).
  • by qnetter (312322) on Tuesday December 15, 2009 @05:01AM (#30441738)

    Wow - how many inaccuracies can you pack into one comment?!

    Xen itself - including not just the hypervisor but the kernel code needed for dom0 and for paravirtualized domU - is GPL licensed, and always has been. What Citrix (NOT Cisco) recently open-sourced was the control stack used in he commercial XenServer. There has always been an open-source control stack -- it has been possible to run a Xen system entirely using GPL licensed code. The only change in October 2009 was to make the management APIs compatible between the commercial and open-source offerings.

    (And the "owned by Citrix" part is open to debate too. XenSource -- a company -- was bought by Citrix -- not Xen -- a code base. The licensing status of the code is the same as it ever was. Its direction is driven by an advisory board that includes representatives of Citrix and lots of other companies.)

  • by TheRaven64 (641858) on Tuesday December 15, 2009 @01:15PM (#30446384) Journal
    Not surprising, because that was the title of the first research paper that presented Xen. Xen and the Art of Virtualization is the paper that describes Xen 1.0.

Put no trust in cryptic comments.

Working...