The Book of Xen
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.
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.
They should have named this book The Zen of Xen.
I've abandoned my search for truth; now I'm just looking for some useful delusions.
Wasn't Xen the computer of the Liberator?
Chapter 1: How to crouch-jump.
Chapter 2: Platforms, the silent killer.
Chapter 3: Giant psychic fetuses and you.
In the interest of ethics, you should also now not work for this publisher for 2 years.
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 kvm; Redhat et al are doing xen .. I think (corrections please). On that count, xen is doing well. But moving forward, it seems like they have to do a lot of extra work to track kernel development, which will be made harder by virtue of the fact that key kernel developers may not feel like devoting time to what they feel is a duplicate effort.
Buy a Linode ;).
Sorry, I just couldn't resist.
512 MB RAM, 20 GB disk, 200 GB transfer, five datacenters. $19.95/month.
Y'know, there by default vs reinstalling your kernel and patching everything every release etc.
Deleted
Luke Crawford is great - I used to have a virtual server hosted with his company, 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.
Spork.
P.S. Spork.
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.
"Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
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.
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.
Not as quick as with hardware virtualisation and consumes rather too many host cycles, but kqemu in particular is pretty straightforward to set up on older CPUs with rhel or centos (just make sure the kernel module version is compatible with the emulator).
Deleted
I'm pretty sure I've emailed you to ask dumb questions several times, and you answered. :)
if you pay for power, replacing 8 P4s with 1 dual quad-core xeon or opteron usually saves you enough in power costs to pay for the capital cost in a few months.
For me, the big differentiator is robustness and reliability. KVM will get there, I'm sure. But in the hosting space, Xen is the established tool, and KVM is the new technology. Nearly all the linux developers are rooting hard for KVM, which may mean that it will become better. Personally, I'm hedging my bets by learning both. But for now, at least, I think Xen is the best choice for the hosting provider.
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.
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.
of the xen stuff- I've had nothing but trouble with it in testing, and looking, it seems that the debian people aren't particularly interested in helping if you have problems, and if you ask the xen mailing lists, they tell you to ask the debian people. If you want stability, you have to deal with the 2.6.18.8-xen kernel distributed by xen.org, or the 2.6.18-patchedtohellandback kernel distributed by RedHat. (the Suse kernel might be stable, I haven't tried it, but the debian port of the suse kernel that is 2.6.27, man, that sucks. Some people say this is because they took the initial patch and have not been good about importing fixes that suse did.)
I've used both those Linux kernels (the xen.org kernel and the RHEL 5 kernel) quite a lot; my experience has been that the RHEL kernel is slightly less stable, while the xen.org kernel has serious driver deficiencies.
For my current production boxes, I'm using the xen.org 2.6.18 system, and I just buy the exact same hardware every time. (Yay for cheap sata_sil cards!)
Another option, of course, is NetBSD5. After starting on NetBSD 3, and switching to linux for pae and x86_64 support, I'm seriously considering switching back, now that NetBSD5 is starting to look good.
DomU works, and should continue to work for the foreseeable future; DomU paravirt ops is upstream, so unless debian goes through extra effort to break xen DomU support, it should Just Work.
Personally, after the age of 25 or so, I started to agree more and more with Paul Graham on the subject
'desktop virtualization' which is another animal entirely. (personally, I think desktop virtualization will suffer the same fate of other recent 'thin client' schemes, but really, it's not my area, so that's just wild speculation.)
Provisioning and mass deployments is something I go into a little bit... but certainly isn't the focus of the book. I firmly believe that it is madness to treat physical and virtual servers differently; you want to use one tool for both. And right now, the best one tool is cobbler/koan.
- 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 irrelevant anyway. It doesn't take much effort to say "Ksen" (like it is spelled, not "ker-SEN", which seems like a more reasonable pronunciation of "Xen".
*huff, huff* Right, I feel much better now. Thank you for listening.
There's a link to the errata at the bottom of http://www.nostarch.com/xen.htm
See the bottom of No Starch's page on "The Book of Xen for a link.