Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Programming Book Reviews

The Book of Xen 88

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 Locke2005 ( 849178 ) on Monday December 14, 2009 @02:05PM (#30433420)
    They should have named this book The Zen of Xen.
    • Re: (Score:3, Informative)

      by Itninja ( 937614 )
      I think that's been done...about 20,000 times [google.com].
    • not that I have anything against Persig, but xen/zen puns are pretty worn out. We had a bit of a scare when we noticed that the proof for the rear cover said "Xen and the art of virtualization" - I mean, Our "no persig puns" rule aside, that's what the Cambridge folks called one of the first papers on Xen, so there would have been copyright issues. No starch caught the mistake before it hit paper, though.

      • Zen and the art of Motorcycle Maintenance totally sucked in the same way Steppenwolf sucked, and not because it is "deep" and difficult to understand. Those books sucked because they are like Tori Amos songs - a bunch of "random" self-indulgent garbage which could be applied and interpreted and to mean anything. At least David Lynch's random self-indulgent garbage is somewhat entertaining.

        Both of those books should be modded -1 overrated.
        • Was recommended to me by someone I respect quite a lot, someone who isn't known for being 'fuzzy headed'

          But yeah, I read the book and I didn't get it, either.

          • Re: (Score:2, Insightful)

            You misunderstood me, I did get it. And it was barely a step up from from, "Confucius say, man who stand on toilet is high on pot". I'm sure it appears to be "deep" to the geek who's never read any real literature. It's the Twilight of philosophy.
          • by Degrees ( 220395 )

            There was one contemplation point in the book that was outside the norm of what you would learn in school: "what is quality?" (define quality).

            Prior to reading the book, you probably could not have answered that question. After reading the book, you can. It ties into the opening line of the book: "And what is good, Phaedrus,
            and what is not good -- Need we ask anyone to tell us these things?"

            Outside of that, it made for an interesting drama.

  • Book of Xen (Score:4, Funny)

    by Spatial ( 1235392 ) on Monday December 14, 2009 @02:11PM (#30433478)
    Chapter 1: How to crouch-jump.
    Chapter 2: Platforms, the silent killer.
    Chapter 3: Giant psychic fetuses and you.
  • by Anonymous Coward
    Haven't the kernel developers basically given xen the cold shoulder, preferring now to dedicate their efforts to kvm, the virtualization solution which is now part of the mainline kernel? The problem, from what I recall from reading some threads on the subject a while back was that xen needs to keep pace w/ kernel driver development work, which is an extra effort for the developers. It's easier for them with kvm since it's part of their dev tree. Right now I think Ubuntu is the only big distributer shipping
    • Re: (Score:3, Interesting)

      Redhat et al are doing xen .. I think (corrections please)

      Correction: Red Hat aquired Qumranet, the inventors of KVM (link [redhat.com]), so Red Hat is abandoning Xen in favor of KVM as well.

    • 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.

  • Buy a Linode [linode.com] ;).

    Sorry, I just couldn't resist.
    • haha. Linode is one of the better providers. they are cheaper than slicehost, but more expensive than I am. According to the latest benchmarks I've seen, though, they beat us all (slicehost, ec2 'small', prgmr.com) in terms of CPU power. (though I'm pretty up front about the fact that I optimize for cheap ram over all else, so the results are unsurprising)

      • Well, fancy meeting you here :). I'd go so far as to say we're pursuing somewhat different markets, too. I've certainly heard folks who put a premium on price speak favorably of your offerings. Anyhow, back to hacking on stuff. Have a good one!
  • by Colin Smith ( 2679 ) on Monday December 14, 2009 @02:28PM (#30433696)

    Y'know, there by default vs reinstalling your kernel and patching everything every release etc.
     

    • Re: (Score:2, Informative)

      by jsolan ( 1014825 )
      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).
      • RedHat is supporting Xen for the lifetime of the RHEL5 spin, which is at least a couple years from now. I think you have until 2014 until they stop supporting Xen.

        I was skeptical of the move to KVM but I think it's a good technology. It has some very interesting features that Xen does not, including KSM (kernel same-page merging) and better memory balooning. Plus it makes much better sense from a support standpoint. Xen is owned, at the top, from a proprietary company (Cisco). It was only recently (Oct 20

        • Re: (Score:2, Informative)

          by qnetter ( 312322 )

          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 compat

  • prgmr.com (Score:1, Offtopic)

    by selfabuse ( 681350 )
    Luke Crawford is great - I used to have a virtual server hosted with his company, prgmr.com [prgmr.com]. You can feel pretty confident in your xen machine when the guy who maintains it literally wrote the book on it.
  • I cannot believe that I'm the first to post about hot cute the cover is. At least anyone will have to agree that the subjects would make for interesting sushi.
  • by vlm ( 69642 ) on Monday December 14, 2009 @03:45PM (#30434560)

    The review needs to list, what the book has, that a google search will not find for free.

    The disadvantage of the book, is the review makes it sound like an edited, slightly out of date collection of FAQ printouts, and it costs money.

    The advantage of the book, is ... Come on, give me a reason to buy the book. I got money burning a hole in my pocket here.

    Here are reasons why I'd buy a book that covers a "google-y" topic. First of all, if the $$$ went to a foundation that paid the program authors, or some charity (EFF?). Maybe if it had diagrams and flowcharts or other graphical aids you can't find via google. Maybe if it had interesting exclusive content, behind the scenes interviews with the authors, candid explanations of why and how it was designed the way it was, that simply cannot be found on the internet. Maybe if it had workbook like qualities, like planning worksheets to plan and organize your deployment. Maybe if it had textbook like qualities like questions at the end of each chapter with an answer key at the end. Maybe if it was an artistically beautiful collection of "stuff" like XKCD cartoons, FAQs, stories, pictures, poems, all tied to a common theme in an aesthetically pleasing manner.

    Thats what I want to see in a slashdot review of a "google-y" topic.

    • books can't really compete as references anymore, I don't think. The advantage of a book is that it's easier to sit down and read a book cover to cover than to figure out what you need to look up in order to get an overview of a technology.

    • by drsmithy ( 35869 )

      The review needs to list, what the book has, that a google search will not find for free.

      Off the top of my head, I'd go with coherency, structure, and a lack of insults.

      • by vlm ( 69642 )

        The review needs to list, what the book has, that a google search will not find for free.

        Off the top of my head, I'd go with coherency, structure, and a lack of insults.

        Sounds just like a FAQ... which google will find for free

        Google Xen FAQ first link for me was

        http://wiki.xensource.com/xenwiki/XenFaq [xensource.com]

        Good coherency, although it was not, it looks like it was written in one sitting by one guy, or at least edited to look that way.

        Good structure, its an outline, and the outline even looks well designed.

        Lack of insults, well, its no mailing list. And for $20 or whatever the book costs, I'll glance over a mailing list post calling some dude a noob, or whatever.

  • XEN isn't bad, runs ok unless it's a windows guest. What it lacks it good administrative interface. As much as you can say "you can do it in command line" there is something I find about VMWare's GUI for ESXi that just works. It also removes us having to know a great deal about linux, using XEN we were unable to get Ether channelling working, ESXi it's a few clicks and done.
    • hah. being familiar with linux, and not so familiar with Windows, I had the opposite problem. Xen networking is... Linux networking. (the big problem is that the Dom0 kernel is crusty and ancient; something that should be remedied with Xen 4, which should be out Real Soon Now.)

      • Did you talk to anyone at XenSource (well, the bit of Citrix that used to be XenSource)? Last time I chatted to Simon Crosby, people running Windows guests on top of Xen accounted for around 90% of their market, and they had a custom WinNT HAL for Xen.
        • yeah, they went over the 'citrix xen' chapter.

          But what I was trying to say is that networking under xen is pretty easy for me, as it's just Linux stuff. The times I've had to deal with vmware for clients, I've been frustrated trying to do what I wanted to do with their interface, something obviously designed for windows users. I'm not saying the vmware interface is bad; just that it was designed for a windows user.

  • - or nearly:

    This book title is a wordplay on "Zen", obviously; which leads me, once again, to wonder why the hell English speakers think that "X" is pronounced "Z"? Is it just mental laziness? The depravity that inevitably comes with the filthy excesses of Capitalism? A conspiracy by the religious right?

    In my experience "x" is pronounced "ks", as demonstrated in a word like "sex" - you don't pronounce it "sez" unless you've had a few pints more than what is good for you, in which case sex is probably irrele

  • See the bottom of No Starch's page on "The Book of Xen for a link.

"Protozoa are small, and bacteria are small, but viruses are smaller than the both put together."

Working...