« PreviousNext »

仮想システムXen導入

30 11 月 2007

まずXenサーバーをインストールする

# vi /etc/modprobe.conf    

alias net-pf-10 off
alias eth0 pcnet32
alias scsi_hostadapter xenblk  ← 最終行に追加    

# yum -y install xen kernel-xen
Loading "installonlyn" plugin
Loading "fastestmirror" plugin
Setting up Install Process
Setting up repositories
base                      100% |=========================| 1.1 kB    00:00
updates                   100% |=========================|  951 B    00:00
addons                    100% |=========================|  951 B    00:00
extras                    100% |=========================| 1.1 kB    00:00
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for kernel-xen to pack into transaction set.
kernel-xen-2.6.18-8.1.15. 100% |=========================| 208 kB    00:02
---> Package kernel-xen.i686 0:2.6.18-8.1.15.el5 set to be installed
---> Downloading header for xen to pack into transaction set.
xen-3.0.3-25.0.4.el5.i386 100% |=========================|  82 kB    00:03
---> Package xen.i386 0:3.0.3-25.0.4.el5 set to be updated
--> Running transaction check
--> Processing Dependency: libxenguest.so.3.0 for package: xen
--> Processing Dependency: libxenstore.so.3.0 for package: xen
--> Processing Dependency: xen-libs = 3.0.3-25.0.4.el5 for package: xen
--> Processing Dependency: libSDL-1.2.so.0 for package: xen
--> Processing Dependency: libxenctrl.so.3.0 for package: xen
--> Processing Dependency: python-virtinst for package: xen
--> Processing Dependency: bridge-utils for package: xen
--> Processing Dependency: libblktap.so.3.0 for package: xen
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for bridge-utils to pack into transaction set.
bridge-utils-1.1-2.i386.r 100% |=========================| 4.9 kB    00:00
---> Package bridge-utils.i386 0:1.1-2 set to be updated
---> Downloading header for xen-libs to pack into transaction set.
xen-libs-3.0.3-25.0.4.el5 100% |=========================|  23 kB    00:01
---> Package xen-libs.i386 0:3.0.3-25.0.4.el5 set to be updated
---> Downloading header for python-virtinst to pack into transaction set.
python-virtinst-0.99.0-2. 100% |=========================| 6.7 kB    00:00
---> Package python-virtinst.noarch 0:0.99.0-2.el5.centos set to be updated
---> Downloading header for SDL to pack into transaction set.
SDL-1.2.10-8.el5.i386.rpm 100% |=========================|  12 kB    00:00
---> Package SDL.i386 0:1.2.10-8.el5 set to be updated
--> Running transaction check
--> Processing Dependency: libvirt-python >= 0.1.4-4 for package: python-virtinst
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for libvirt-python to pack into transaction set.
libvirt-python-0.1.8-15.e 100% |=========================|  11 kB    00:00
---> Package libvirt-python.i386 0:0.1.8-15.el5 set to be updated
--> Running transaction check
--> Processing Dependency: libvirt.so.0 for package: libvirt-python
--> Processing Dependency: libvirt = 0.1.8 for package: libvirt-python
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for libvirt to pack into transaction set.
libvirt-0.1.8-15.el5.i386 100% |=========================|  14 kB    00:00
---> Package libvirt.i386 0:0.1.8-15.el5 set to be updated 

--> Running transaction check    

Dependencies Resolved    

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 kernel-xen              i686       2.6.18-8.1.15.el5  updates            13 M
 xen                     i386       3.0.3-25.0.4.el5  updates           1.8 M
Installing for dependencies:
 SDL                     i386       1.2.10-8.el5     base              233 k
 bridge-utils            i386       1.1-2            base               27 k
 libvirt                 i386       0.1.8-15.el5     base              308 k
 libvirt-python          i386       0.1.8-15.el5     base               42 k
 python-virtinst         noarch     0.99.0-2.el5.centos  base               31 k
 xen-libs                i386       3.0.3-25.0.4.el5  updates            86 k    

Transaction Summary
=============================================================================
Install      8 Package(s)
Update       0 Package(s)
Remove       0 Package(s)             

Total download size: 16 M
Downloading Packages:
(1/8): kernel-xen-2.6.18- 100% |=========================|  13 MB    06:10
(2/8): bridge-utils-1.1-2 100% |=========================|  27 kB    00:00
(3/8): libvirt-python-0.1 100% |=========================|  42 kB    00:00
(4/8): xen-libs-3.0.3-25. 100% |=========================|  86 kB    00:01
(5/8): python-virtinst-0. 100% |=========================|  31 kB    00:01
(6/8): libvirt-0.1.8-15.e 100% |=========================| 308 kB    00:05
(7/8): SDL-1.2.10-8.el5.i 100% |=========================| 233 kB    00:03
(8/8): xen-3.0.3-25.0.4.e 100% |=========================| 1.8 MB    00:58
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: xen-libs                     ######################### [1/8]
  Installing: SDL                          ######################### [2/8]
  Installing: bridge-utils                 ######################### [3/8]
  Installing: kernel-xen                   ######################### [4/8]
  Installing: xen                          ######################### [5/8]
  Installing: libvirt-python               ######################### [6/8]
  Installing: python-virtinst              ######################### [7/8]
  Installing: libvirt                      ######################### [8/8]     

Installed: kernel-xen.i686 0:2.6.18-8.1.15.el5 xen.i386 0:3.0.3-25.0.4.el5
Dependency Installed: SDL.i386 0:1.2.10-8.el5 bridge-utils.i386 0:1.1-2 li
bvirt.i386 0:0.1.8-15.el5 libvirt-python.i386 0:0.1.8-15.el5 python-virtin
st.noarch 0:0.99.0-2.el5.centos xen-libs.i386 0:3.0.3-25.0.4.el5
Complete!

設定ファイルを編集する

デフォルトの起動をXenカーネルにする。①
# vi /etc/grub.conf
default=0     ←  0 に変更
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-8.1.15.el5xen)
        root (hd0,0)
        kernel /xen.gz-2.6.18-8.1.15.el5
        module /vmlinuz-2.6.18-8.1.15.el5xen ro root=/dev/VolGroup00/LogVol00
        module /initrd-2.6.18-8.1.15.el5xen.img
title CentOS (2.6.18-8.1.15.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-8.1.15.el5 ro root=/dev/VolGroup00/LogVol00
        initrd /initrd-2.6.18-8.1.15.el5.img
title CentOS (2.6.18-8.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-8.el5 ro root=/dev/VolGroup00/LogVol00
        initrd /initrd-2.6.18-8.el5.img    

デフォルトの起動をXenカーネルにする。②
# vi /etc/sysconfig/kernel    

# UPDATEDEFAULT specifies if new-kernel-pkg should make
# new kernels the default
UPDATEDEFAULT=yes    

# DEFAULTKERNEL specifies the default kernel package type
DEFAULTKERNEL=kernel-xen     ←  -xen を追加    

再起動する
# reboot

Xenの確認をする

起動中のカーネルの確認
# uname -r
2.6.18-8.1.15.el5xen    

Xenのリストを確認
# xm list
Name                                      ID Mem(MiB) VCPUs State   Time(s)
Domain-0                                   0      462     1 r-----    248.6    

自動起動の確認
# chkconfig --list xend
xend            0:off   1:off   2:on    3:on    4:on    5:on    6:off
# chkconfig --list xendomains
xendomains      0:off   1:off   2:off   3:on    4:on    5:on    6:off

Posted in CentOS 5 | Trackback | del.icio.us | Top Of Page

Comments are closed.