EEL6892 Spring 11 HW 3: Introduction to Xen
From Grid-Appliance Wiki
Contents |
Introduction
The objective of this assignment is to introduce you to Xen. Much like the previous project, the overall time required for this assignment will take much longer than the time you spend focused on it. So please do not procrastinate. By the end of the assignment you should be comfortable with the following:
- Installing an application from source into a chroot environment
- Understanding Xen architecture
- Starting Xen dom0 and domU
- Compare the behavior of Cache and CR3 between Xen and Linux
The questions following the assignment will verify that you have ascertained this knowledge.
I want to emphasize that because this is an upper level graduate course, you are expected to be independent and creative. The directions given over time will be less and less verbose. Your submissions are to be thoughtful and concise. Furthermore, you should READ the entire assignment first before beginning. It will expedite your process.
Reading
Required: Xen Introduction Recommended:
Part 1 - Installing DBENCH
- Install DBENCH into a chroot of your ubuntu-xen.img
- You will need to install autoconf and libpopt-dev (apt-get)
- You should not run make install (thoughh it doesn't matter if you do)
- Verify DBENCH works (from the dbench folder):
- ./dbench -c loadfiles/client.txt -t 30 1
- ./dbench -c loadfiles/client.txt -t 30 2
- Copy dbench into the /root/ubuntu.img image inside ubuntu-xen.img
- From /root, mkdir tmp
- mount -oloop ubuntu.img tmp
- cp -axf dbench tmp/root/.
- umount tmp
Part 2 - Starting Xen
- Note: Your Grid Appliance VM needs to have at least 1GB of memory. If you are using the default GA, you only have 512 MB. If you are using VMware Player, you will need to modify the Grid Appliance.vmx file and replace memsize = "512" with memsize = "1024" or greater.
- Starts Simics with ubuntu-xen enter Xen from within grub
- Start a domU
- Switch to root user
- cd /root
- The image is labeled ubuntu.img and the Xen configfile is ubuntu.cfg
- Start and enter the Xen VM using xm (see man xm above)
- The user name and password for the domU is root and password
- Leave the domU using "ctrl-]"
- Create checkpoints for dom0, domU, and Linux
- Start DBENCH with "./dbench -c loadfiles/client.txt -t 300 1"
- Run for 2,000,000,000
- Create check point
Part 3 - Simics and Haps
- Download this Simics configuration file into your VM
- Read the contents of this file, it shows how we use haps to monitor CPU mode and CR3.
- Review chapter 8 in the Simics user guide
- Review the Simics reference manual
- It is critical going forward that you understand Haps and ponder their use for evaluating Xen.
Part 4 - Questions
- What is DBENCH? What does it test? How does it differ from GCC and Swim?
- Why is chroot used for DBENCH? What would happen if you didn't use chroot?
- Comparing "./dbench -c loadfiles/client.txt -t 30 1" and "./dbench -c loadfiles/client.txt -t 30 2" (note: this does not need to be done in Simics)
- What is the command line difference?
- What is the behavioral difference?
- Why don't we use an offset or chroot for the ubuntu.img?
- When Xen boots how many VMs are running? What environment are you running (i.e. domain) when Xen presents you the first login screen? How many are running after we create the domU?
- Using the checkpoints for Linux, dom0, and domU for DBENCH compare cache rates for 16 KB, 128 KB, and 1024 KB.
- Plot the results on a graph
- Discuss why the results are different
- What is paravirtualization?
- What are some of the key challenges with paravirtualization?
- Why can operating systems like Windows not easily be paravirtualized?
- Assuming we have a virtualized environment like VMware:
- Can we introduce paravirtualization?
- What components of the system can we target?
- What are some potential limitations?
- What is a hypercall? What are the advantages of hypercalls to system calls? Where are hypercalls defined? How are hypercalls implemented?
- What is a Hap?
- In watch.simics, how are we using Haps?
- Run your checkpoints using watch.simics, how do they compare?
- Explain how CR3 and CPU Mode relate to each other?
- Why are the results so different, what other components or Haps could we watch to understand why?
- Test your theory and provide the results (this should be repeated a few times, your theories should be sound, but the results do not matter very much).
- In this part of the homework you will familiarize yourself with and summarize enhancements made in the Xen architecture to handle I/O. To answer the questions below, you should survey technical documents on the Xen I/O architecture which are available on the Web. Starting points: Google searches, documentation at xensource.com and at the systems research group in Cambridge, UK. Make sure to provide references to material that you based your answers from. In the Xen paper (available on Sakai), the hypervisor is responsible for driving I/O devices, and communication between a domain and the hypervisor is done via hypercalls, event notification and the producer/consumer I/O ring. Such was the implementation of Xen version 1.0; in subsequent versions (2.0, 3.0), the I/O architecture of Xen changed to one where device drivers are "split" in a different way, where the "backend" device driver runs on a privileged domain (not the hypervisor) which is typically the management domain "dom0", and the "frontend" driver runs on an unprivileged domain ("domU").
- What are the motivations behind this change in the architecture? Discuss its pros and cons.
- Are the I/O descriptor ring and event notification abstractions preserved in the newer architecture?
- Describe, with an example, how "grant tables" work and why they are needed in this architecture.

