百度首页 | 百度空间
 
查看文章
 
openQRM - Server Virtualization via Xen
2008-04-22 16:21
openQRM - Server Virtualization via Xen | Print |

A “how to” by Matt Rechenburg

This document explains in detail how to use Server-virtualization via Xen — managed by openQRM and integrated by the Xen plug-in.

Requirements:

  • A running openQRM 2.2.2 server
  • A system which can be used as the Xen host – must have 2 network-cards
Step 1) -- Installing the Xen plug-in

Download the Xen plug-in rpm package from the files section on the openQRM website at sourceforge.net, and then install it:

rpm -iHv qrm-xen-plugin.rpm

Activate the Xen plug-in within the openQRM server by:

cd /opt/qrm
       ./bin/qrm-plugin -u qrm -p qrm xen register
        ./qrm-configurator
        --> basic
            (no changes needed)
        --> plugin
            Select the Xen-plugin
        --> pluginconf
                --> Xen

Follow the wizard. Provide the ip address for the source system being used to create a Xen host filesystem image. A logical name for the storage-server along with the full path to the filesystem image directory and its regular and management ip-addresses are needed. For the storage type, keep the default NFS. Finally, provide the ip address of the default-gateway in your network.

Below is a possible Xen plug-in configuration:

   Source system ip-address:                       192.168.1.10
   Storage server name:                               NFS-server
   Storage server path:                                 /diskimages/Xen_image_1_0
   Storage server ip-address:                       192.168.1.5
   Storage server management ip address: 192.168.1.6
   Storage server type:                                  NFS
   Default gateway:                                      192.168.1.1

Run what is indicated below to install and enable the Xen-plug-in on the openQRM_serve

./bin/qrm-plugin -u qrm -p qrm xen install
./bin/qrm-plugin -u qrm -p qrm xen run_once
/etc/init.d/qrm-server restart

The installation procedure creates the boot-image Xen_kernel_1_0, the storage server NFS server, and the filesystem image Xen_image_1_0.

Please note that filesystem image creation can be time consuming.

In the virtual environment view of the openQRM server, you can create a new virtual environment from the above listed components. Choose a name and mark it to use Xen partitioning. Also, select it to be a Multi-server (same for all). This virtual environment is called Xen host.

Step 2) -- Starting the Xen host virtual environment

Start up the Xen virtual environment created in Step 1 on an available resource in your network.

Determine that the system you start the Xen host virtual environment on contains two network cards. It is also important that the Xen host filesystem Xen_image_1_0 contains a valid network configuration file for the non-PXE network card (in most cases eth1) e.g. using dhcpd.

The Xen host virtual environment starts up the Xen hypervisor and a special Xen linux kernel — Xen_kernel_1_0. While booting up, the Xen tools are automatically installed on the Xen_image_1_0 and Xen is also started. When it is fully up and running, it serves the Xen domain 0. You can determine if everything is working correctly by logging onto the Xen host and running the following Xen command:

xm list

This displays the current active Xen domains and should list the running domain 0.
In the case that domain 0 could not be started, you may need to rebuild the Xen plug-in for the linux distribution/version you selected as the filesystem image for the Xen host virtual environment. For more information on this build procedure, please refer to the appendix.

Step 3) -- Partitioning the resource

Now it is time to virtualize the server and create the partitions. Click on the resource used for the Xen host virtual environment and find the partition tab added by the Xen plug-in. A configuration page for creating partitions is opened when clicking on it. The first field configures the number of partitions to be created on the Xen host. The second field specifies the count of CPU's for each partition; the third sets the CPU speed; and the fourth field is used for configuring the memory.

Configure the parameters to start one partition by using one CPU with e.g. 700MHz CPU-speed and 256 MB RAM. Please make sure that the amount of RAM configured for the partition does not exceed the available memory on the Xen host (which needs about 120 MB RAM itself).

Pressing “create” creates and starts the partition on the Xen host virtual environment. It will become available (idle) in the resource view as a new Xen resource.

Step 4) -- Using the Xen partitions

The available Xen partitions created and started in Step 3 can now be used as a resource for any virtual environment in the openQRM managed network.

To start a virtual environment on a Xen partition, go to its configuration page and select “Xen partition”.. This causes the openQRM server to choose a free Xen partition to start the virtual environment. No further changes are required. You can manage your virtual environment running on Xen partitions in the usual way, i.e. through the Actions menu.

Appendix:

Building the Xen plug-in

To build the Xen plug-in, download the Xen plug-in source package from sourceforge.net and unzip it in your openQRM source directory. Change to the

../src/plugins/xen directory and run:

make clean && make && make install

This will compile the components for the Xen plug-in (i.e.. the Xen hypervisor, the Xen tools and the special Xen linux kernel). Should the Xen compilation fail, please ensure that you have the latest compiler and kernel headers installed on your build system.

Xen host assignment in openQRM

To remote boot a Xen server, a special assignment/de-assignment procedure is needed. For this purpose, the Xen plug-in registers an “event listener” which listens to both assignment and de-assignment in the openQRM server while creating and using the special Xen pxelinux configuration files generated by the Assignment-util attached to the Event-listener.

The Xen “event listener” also takes care of the de-assignment of the Xen Virtual environments (to restore the regular/original netboot-pxelinux configuration).

The tricky thing about booting a Xen server (dom0) on openQRM, is that it generally does not have any ip/network/netboot information in its /proc/cmdline even if it is configured in its pxelinux-configuration file. This is because the "kernel" booted on the Xen server (dom0) is the Xen hypervisor — NOT a linux kernel. The linux kernel is started in the dom0 (management domain) -> after Xen.

To have this special boot mechanism conform with openQRM, the Xen assignment process triggered via the event listener creates the correct + fitting
/proc/cmdline append parameters for the Xen host (dom0) in the pxe-module configuration for the linux-dom0 kernel.

Xen partition management in openQRM

The Xen host receives administrative commands via the qrm-execd from the openQRM-server. According to these commands, it starts/stops/creates/removes/... partitions. Each partition has a separate configuration file

/var/lib/xen/VirtualMachines/[mac-address]/[mac-address].xen

created by the qrm-xen-manage util on the Xen host. The regular Xen util "xm" is then used to manage these Xen partitions. Ip addresses for the Xen partitions are gathered by dhcp on the Xen host on behalf of the partition mac address which then assigns them to the partitions via the Xen-configuration file. The "create" procedure for the Xen partitions also configures an openQRM conform /proc/cmdline so that they are able to boot the regular openQRM-initrd (for domX -> partitions).

You can find more detailed information about the Xen plug-in and its mechanisms in the README.txt file included in the doc directory.

I hope this document was useful and helps you to understand the advantages of openQRM — especially for server virtualization via Xen.

Key URLs:

openQRM - http://sourceforge.net/projects/openqrm
Xen - http://www.cl.cam.ac.uk/Research/SRG/netos/xen/


类别:Openqrm | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码:
 

     

©2008 Baidu