Features/XenPvopsDom0

From FedoraProject

< Features(Difference between revisions)
Jump to: navigation, search
(Add notes about upstream work on Xen Dom0)
Line 16: Line 16:
 
* Last updated: 2010-10-29
 
* Last updated: 2010-10-29
 
* Percentage of completion: 0%
 
* Percentage of completion: 0%
 +
 +
In order to implement this feature, it is necessary to get Xen Dom0 support upstream and in Fedora. In order to support development until this happens, Michael Young has been building third-party [http://fedorapeople.org/~myoung/dom0/ Dom0 kernels]. He creates a diff between upstream and the xen/stable-2.6.32.x branch and uses it to patch the Fedora 12 kernel package. The reason that he based his work on the Fedora 12 kernel is that newer Fedora versions ship newer kernels, while Xen had continued to target 2.6.32. This has changed recently, as Linus began accepting Dom0 patches from Xen and applying them to the 2.6.37 tree. Presently, the core Dom0 support has been accepted upstream. What remains is the backend driver support that Dom0 provides DomU guests. So, it should be possible to boot an upstream kernel in Dom0, but the resulting system will not be able to host DomU guests.
  
 
== Detailed Description ==
 
== Detailed Description ==
  
Xen is a hypervisor-based type-1 virtualization solution. The Xen hypervisor requires a standard operating system to run in a privileged domain, Dom0. The Dom0 operating system provides driver and guest management support to Xen and other guest operating systems running in the DomU domain. Fedora 8 provided a kernel that could serve as a Dom0 guest. However, newer Fedora releases dropped support for Dom0 (although they can run in DomU). The Xen project is presently pushing the features required for a Dom0 Linux kernel upstream. Once these features are available in a mainline kernel, it follows that Fedora could support Xen Dom0.
+
Xen is a hypervisor-based type-1 virtualization solution. The Xen hypervisor requires a standard operating system that runs in a privileged domain, Dom0. The Dom0 operating system provides driver and guest management support to Xen and other guest operating systems running in the DomU domain. Fedora 8 provided a kernel that could serve as a Dom0 guest. However, newer Fedora releases dropped support for Dom0 (although they can run in DomU). The Xen project is presently pushing the features required for a Dom0 Linux kernel upstream. Once these features are available in the mainline kernel, it follows that Fedora could support Xen Dom0.
  
 
== Benefit to Fedora ==
 
== Benefit to Fedora ==
Line 29: Line 31:
 
* Implement Dom0 support in upstream kernel (Xen / Jeremy Fitzhardinge)
 
* Implement Dom0 support in upstream kernel (Xen / Jeremy Fitzhardinge)
 
* Modify 'grubby' to support GRUB syntax required by Xen ([https://bugzilla.redhat.com/show_bug.cgi?id=640486 Bugzilla #640486])
 
* Modify 'grubby' to support GRUB syntax required by Xen ([https://bugzilla.redhat.com/show_bug.cgi?id=640486 Bugzilla #640486])
* Make 'new-kernel-pkg' aware of Xen, possibly by a flag in /etc/sysconfig/kernel
+
* Make 'new-kernel-pkg' aware of Xen using the HYPERVISOR option in /etc/sysconfig/kernel
 
* Ensure Fedora's virtualization tools support Xen
 
* Ensure Fedora's virtualization tools support Xen
 +
* Possibly implement support for bridging in NetworkManager
 
* Possibly implement support in Anaconda
 
* Possibly implement support in Anaconda
  
 
== How To Test ==
 
== How To Test ==
  
* Install a Fedora Dom0 kernel
+
* Install a Fedora Dom0 kernel and {{package|xen}}
 +
* Confirm grub.conf does not boot the new kernel using Xen
 +
* Reboot
 +
* Confirm the Dom0 kernel can boot on bare metal (no Xen)
 
* Turn on Xen Userspace by running 'chkconfig xend on'
 
* Turn on Xen Userspace by running 'chkconfig xend on'
* Turn on Xen Hypervisor by setting 'HYPERVISOR=/boot/xen-4.0.gz' in /etc/sysconfig/kernel and running some tool (TBD)
+
* Turn on Xen Hypervisor by setting 'HYPERVISOR=/boot/xen-X.Y.gz' in /etc/sysconfig/kernel
 +
* Remove and reinstall the Dom0 kernel
 +
* Confirm grub.conf boots the new kernel using Xen
 
* Reboot
 
* Reboot
 
* Observe presence of Xen via /sys/hypervisor/
 
* Observe presence of Xen via /sys/hypervisor/
Line 48: Line 56:
 
== User Experience ==
 
== User Experience ==
  
* Stock Fedora kernel supports Xen dom0
+
* Stock Fedora kernel supports both Xen dom0 and bare metal
* All features and hardware supported on baremetal also work on Xen Dom0
+
* All features and hardware supported on bare metal also work on Xen Dom0
* Can enable and disable the use of hypervisor via a /etc/sysconfig/kernel setting
+
* Can enable and disable the use of the Xen hypervisor via a /etc/sysconfig/kernel setting
 +
* Can manage Xen guests using Fedora virtualization tools
  
 
== Dependencies ==
 
== Dependencies ==
  
* kernel
+
* {{package|kernel}}
* grubby
+
* {{package|grubby}}
 
* Fedora virtualization tools
 
* Fedora virtualization tools
* (possibly) anaconda
+
* (possibly) {{package|anaconda}}
 +
* (possibly) {{package|NetworkManager}}
  
 
== Contingency Plan ==
 
== Contingency Plan ==
  
There is presently some uncertainty as to when the Xen drivers will be upstream. They may make the 2.6.37 series and therefore Fedora 15 or they may not. Regardless, we will have to touch a lot of subsystems, so it makes sense to start early.
+
There is presently some uncertainty as to when the backend driver support that the Dom0 guest provides DomU guests will be upstream. This may make the 2.6.37 series and therefore Fedora 15 or it may not. Regardless, we will have to touch a lot of subsystems, so it makes sense to start early.
  
If the Xen drivers don't make Fedora 15, then little is lost. We can continue to test the Dom0 kernel (without DomU) and work on the supporting infrastructure. It would be useful for our effort to have a working Dom0, grubby, etc in Fedora 15 even if other features do not make it. In the worst case, we may delay the announcement of the Dom0 feature to Fedora 16, but can include all progress completed in Fedora 15. There is no shame in a delayed feature -- this happened to systemd during the preparation for Fedora 14.
+
If the Xen drivers don't make Fedora 15, then little is lost. We can continue to test the Dom0 kernel (without support for DomU guests) and work on the supporting infrastructure. It would be useful for our effort to have a working Dom0, grubby, etc in Fedora 15 even if other features (most notably DomU guests) do not make it. In the worst case, we may delay the announcement of the Dom0 feature to Fedora 16, but can include all progress completed in Fedora 15.
  
 
== Documentation ==
 
== Documentation ==
  
 
See also:
 
See also:
 +
 +
* Xen, http://www.xen.org/
 +
 +
* The Xen mailing lists, hosted at xen.org
 +
 +
* The fedora-xen mailing list, hosted by Fedora
  
 
* "Dom0 xen support in Fedora 15?" on fedora-xen mailing list, http://lists.fedoraproject.org/pipermail/xen/2010-November/005205.html
 
* "Dom0 xen support in Fedora 15?" on fedora-xen mailing list, http://lists.fedoraproject.org/pipermail/xen/2010-November/005205.html
Line 73: Line 89:
 
* Michael Young's third-party Dom0 kernels, http://fedorapeople.org/~myoung/dom0/
 
* Michael Young's third-party Dom0 kernels, http://fedorapeople.org/~myoung/dom0/
  
* Xen, http://www.xen.org/
+
In order to configure a system to boot Michael Young's kernel in Dom0 on a present Fedora system:
 +
 
 +
1. yum install xen.
 +
 
 +
2. Install a Dom0 kernel package.
 +
 
 +
3. Create a grub.conf entry such as the following (note the module syntax):
 +
 
 +
<pre>
 +
title Fedora (2.6.32.23-170.1.xendom0.fc12.x86_64)
 +
        root (hd0,0)
 +
        kernel /xen-4.0.1.gz
 +
        module /vmlinuz-2.6.32.23-170.1.xendom0.fc12.x86_64 ro root=/dev/mapper/vg_imp-lv_root_64bit LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet 3
 +
        module /initramfs-2.6.32.23-170.1.xendom0.fc12.x86_64.im
 +
</pre>
 +
 
 +
4. Configure a bridge device by setting /etc/sysconfig/network-scripts/ifcfg-virbr0:
 +
 
 +
<pre>
 +
DEVICE=virbr0
 +
TYPE=Bridge
 +
ONBOOT=yes
 +
USERCTL=no
 +
BOOTPROTO=dhcp
 +
NM_CONTROLLED=no
 +
</pre>
 +
 
 +
5. Configure eth0 to be a member of the bridge:
 +
 
 +
<pre>
 +
DEVICE=eth0
 +
HWADDR=[XX:XX:XX:XX:XX:XX]
 +
TYPE=Ethernet
 +
ONBOOT=yes
 +
USERCTL=no
 +
BOOTPROTO=none
 +
BRIDGE=virbr0
 +
NM_CONTROLLED=no
 +
</pre>
 +
 
 +
6. Reboot and select your Xen kernel in the GRUB boot menu
  
 
== Release Notes ==
 
== Release Notes ==

Revision as of 03:34, 30 November 2010

Contents

Xen Pvops Dom0

Summary

pvops-based Package-x-generic-16.pngkernel to serve as Dom0 for a Xen-based system. Currently Fedora releases greater than 8 contain the Xen hypervisor and tools, but not a Xen Dom0-capable kernel.

Owner

  • Name: W. Michael Petullo
  • Email: mike@flyn.org
  • People Involved: Michael Young, Eduardo Habkost, Mark McLoughlin, Stephen Tweedie, Chris Wright, Juan Quintela, Markus Armbruster, Glauber Costa, Daniel Berrange et al.

Current status

  • Targeted release: Fedora 15
  • Last updated: 2010-10-29
  • Percentage of completion: 0%

In order to implement this feature, it is necessary to get Xen Dom0 support upstream and in Fedora. In order to support development until this happens, Michael Young has been building third-party Dom0 kernels. He creates a diff between upstream and the xen/stable-2.6.32.x branch and uses it to patch the Fedora 12 kernel package. The reason that he based his work on the Fedora 12 kernel is that newer Fedora versions ship newer kernels, while Xen had continued to target 2.6.32. This has changed recently, as Linus began accepting Dom0 patches from Xen and applying them to the 2.6.37 tree. Presently, the core Dom0 support has been accepted upstream. What remains is the backend driver support that Dom0 provides DomU guests. So, it should be possible to boot an upstream kernel in Dom0, but the resulting system will not be able to host DomU guests.

Detailed Description

Xen is a hypervisor-based type-1 virtualization solution. The Xen hypervisor requires a standard operating system that runs in a privileged domain, Dom0. The Dom0 operating system provides driver and guest management support to Xen and other guest operating systems running in the DomU domain. Fedora 8 provided a kernel that could serve as a Dom0 guest. However, newer Fedora releases dropped support for Dom0 (although they can run in DomU). The Xen project is presently pushing the features required for a Dom0 Linux kernel upstream. Once these features are available in the mainline kernel, it follows that Fedora could support Xen Dom0.

Benefit to Fedora

Fedora will benefit from a Xen Dom0-capable kernel. Xen has proven to be a competitive virtualization solution in real-world installations. Xen is different enough from KVM that the two technologies could complement each other within the Fedora Project. There are ongoing benchmarks that intend to define the relative performance of the two technologies.

Scope

  • Implement Dom0 support in upstream kernel (Xen / Jeremy Fitzhardinge)
  • Modify 'grubby' to support GRUB syntax required by Xen (Bugzilla #640486)
  • Make 'new-kernel-pkg' aware of Xen using the HYPERVISOR option in /etc/sysconfig/kernel
  • Ensure Fedora's virtualization tools support Xen
  • Possibly implement support for bridging in NetworkManager
  • Possibly implement support in Anaconda

How To Test

  • Install a Fedora Dom0 kernel and Package-x-generic-16.pngxen
  • Confirm grub.conf does not boot the new kernel using Xen
  • Reboot
  • Confirm the Dom0 kernel can boot on bare metal (no Xen)
  • Turn on Xen Userspace by running 'chkconfig xend on'
  • Turn on Xen Hypervisor by setting 'HYPERVISOR=/boot/xen-X.Y.gz' in /etc/sysconfig/kernel
  • Remove and reinstall the Dom0 kernel
  • Confirm grub.conf boots the new kernel using Xen
  • Reboot
  • Observe presence of Xen via /sys/hypervisor/
  • Run 'xm list' and observe Domain-0
  • Use 'virt-install' to deploy a Fedora paravirtualized guest
  • Use 'virt-install' to deploy a Fedora fully virtualized guest
  • Use 'virsh' to save & restore guests
  • Balloon down memory of a guest with 'virsh'

User Experience

  • Stock Fedora kernel supports both Xen dom0 and bare metal
  • All features and hardware supported on bare metal also work on Xen Dom0
  • Can enable and disable the use of the Xen hypervisor via a /etc/sysconfig/kernel setting
  • Can manage Xen guests using Fedora virtualization tools

Dependencies

Contingency Plan

There is presently some uncertainty as to when the backend driver support that the Dom0 guest provides DomU guests will be upstream. This may make the 2.6.37 series and therefore Fedora 15 or it may not. Regardless, we will have to touch a lot of subsystems, so it makes sense to start early.

If the Xen drivers don't make Fedora 15, then little is lost. We can continue to test the Dom0 kernel (without support for DomU guests) and work on the supporting infrastructure. It would be useful for our effort to have a working Dom0, grubby, etc in Fedora 15 even if other features (most notably DomU guests) do not make it. In the worst case, we may delay the announcement of the Dom0 feature to Fedora 16, but can include all progress completed in Fedora 15.

Documentation

See also:

  • The Xen mailing lists, hosted at xen.org
  • The fedora-xen mailing list, hosted by Fedora

In order to configure a system to boot Michael Young's kernel in Dom0 on a present Fedora system:

1. yum install xen.

2. Install a Dom0 kernel package.

3. Create a grub.conf entry such as the following (note the module syntax):

title Fedora (2.6.32.23-170.1.xendom0.fc12.x86_64)
        root (hd0,0)
        kernel /xen-4.0.1.gz
        module /vmlinuz-2.6.32.23-170.1.xendom0.fc12.x86_64 ro root=/dev/mapper/vg_imp-lv_root_64bit LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet 3
        module /initramfs-2.6.32.23-170.1.xendom0.fc12.x86_64.im

4. Configure a bridge device by setting /etc/sysconfig/network-scripts/ifcfg-virbr0:

DEVICE=virbr0
TYPE=Bridge
ONBOOT=yes
USERCTL=no
BOOTPROTO=dhcp
NM_CONTROLLED=no

5. Configure eth0 to be a member of the bridge:

DEVICE=eth0
HWADDR=[XX:XX:XX:XX:XX:XX]
TYPE=Ethernet
ONBOOT=yes
USERCTL=no
BOOTPROTO=none
BRIDGE=virbr0
NM_CONTROLLED=no

6. Reboot and select your Xen kernel in the GRUB boot menu

Release Notes

Comments and Discussion