ɤʤˤϼĤƤäʤ褦ʤΤǡ ʸ⤽Ǥ Xen ƤʸϤʤΤǡƤοͤˤʬŤ餤⤷ޤȤꤢȤ褦ˤʤޤFedora Core 6 ϥǥȥӥ塼Υȡ Xen ΥåȥåפԤɤǤΤǡäˤιܤɬפʤ⤷ޤȤꤢ Xen ʤäɤ⡢ȤɬפʤȤ˻ͤˤʤ뤫ȻפޤäʬäƤʼʬϲǤˤνˤʤäƤޤλ ݥȤϡFedora Core 5 Xen Fedora Core 6 Xen ϰ㤦ΤǤꡢߴʤȤǤϲƤХȥ֥ˤĤʤ뤫Ȼפޤ Fedora Xen å FC6 - ܸ †Xen*1 ˤĤ †Xen ϥץβۥޥۥƥǤXen ˤĤƤξܤ Xen Ȥ http://wiki.xensource.com/xenwiki/ ĺ Fedora Xen ڡ Fedora Core Ǥ Xen 3.0.x ƤޤXen 3.0.0 2005 ǯ 12 ˸줿ΤǤޤ Xen 3.0 Υ OS Xen 2.0 ȤϸߴޤΤǤդ å †Fedora Core 6 ǤС Fedora Core 5 ȤϼۤʤäƤꡢ㴳ν礬ʲäƤޤʲΥɤǤϤɤΤ褦 Xen åȥåפ뤫ơɤΤ褦 GUI ե䥳ޥɥ饤夫饲 OS ֤ۡƴ뤫Ҥ٤Ƥޤ ƥư †
¹Բ(para-virtualized) OS ˤĤ(¹ԲѡPara-virtualized) †x86_64ia64 ƥб CPU ϡɤⲾ¹Բ(para-virtualized) OS βƯǽǤi386 Υ OS Ưˤ CPU PAE ĥ̿å*2ݡȤƤɬפޤǤ¿θŤޥǤ PAE ĥбƤޤʿȤ Pentium Mobile / Centrino бƤޤˤΤդɬפǤPAE ĥбƤ뤫ɤϼΥޥɤ¹ԤĴ٤뤳Ȥޤ $ grep pae /proc/cpuinfo flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow up ts 嵭Ǥ PAE ݡȤʤƤʬޤ⤷ɽƤʤ硢ޥ CPU PAE ĥˤбƤޤ
۴(fully-virtualized) OS ˤĤ(HVM/Intel-V/AMD-V) †۴(fully-virtualized) OS ѤˤϥۥȤȤʤ CPU ۲бƤɬפޤŵŪȤޤƤϡIntel VT AMD-V ǤXen ξ CPU бƤŪ 'HVM' ءʥ쥤䡼ˤѤޤIntel VT ݡȤƤ뤫Ĵ٤ˤ 'vmx' ե饰Ĵ٤ƤߤƤAMD-V ݡȤ 'svm' ե饰Ǥ ....CPU Intel ξ.... # grep vmx /proc/cpuinfo flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm ....CPU AMD ξ.... # grep svm /proc/cpuinfo flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8_legacy †ޥɥ饤 root 桼¤ɬפʾ硢ԤƬʸϡ # ٤ȤʤäƤޤroot 桼ˤʤˤ 'su -' ޥɤȤΤŪǤޥϸ root ѥɤϤƤ Xen Υȡ †Fedora Core 6 ȡ뤹ˤϡXen 礬ߤƤơ Xen ȡ뤹뤫ɤ֤ȤǤޤ ⤦ Fedora Core 6 ȡ뤷ƤޤäƤǤ⡢Xen ͥġ뷲ϰʲΥޥɤ¹Ԥ뤳ȤǥȡǽǤ # yum install kernel-xen xen virt-manager yum ޥɤˤ xen ɬפȤ륫ͥġʤɤΥѥåȡ뤵ޤ'kernel-xen' ѥåˤϥϥѡХǤۥ OS 䥲 OS Ȥư륫ͥ뤬äƤޤƱͤ 'xen' ѥåǤϴץෲåȥåפޤ yum Υȡˤ GRUB ɲäƤޤե /boot/grub/grub.conf ưԽ졢xen ͥ뤬ư褦ʵҤƤޤǤɸǥ֡Ȥ褦ˤꤵƤޤ֡Ȼ xen ͥ뤬Ư褦ˤˤ grub.conf ԽɬפǤ GRUB ǥ֡Ȥݤ xen-kernel ɸǵư褦ˤˤϡե /boot/grub/grub.conf Խơxen ͥ֡Ȥ褦ԽƤ(*2) ʲε /boot/grub/grub.conf Xen ۥޥΥͥ뤬ư褦ˤΤǤ default=1 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Fedora Core (2.6.18-1.2784.fc6) root (hd0,0) kernel /boot/vmlinuz-2.6.18-1.2784.fc6 ro root=LABEL=/1 rhgb quiet initrd /boot/initrd-2.6.18-1.2784.fc6.img title Fedora Core (2.6.18-1.2784.fc6xen) root (hd0,0) kernel /boot/xen.gz-2.6.18-1.2784.fc6 module /boot/vmlinuz-2.6.18-1.2784.fc6xen root=LABEL=/1 module /boot/initrd-2.6.18-1.2784.fc6xen.img Xen ͭˤˡ †Xen ͥǥƥबưˡ˥ͥ뤬 xen бƤ뤫ɤǰΤ˳ǧŤʤޤXen ͥ뤬ưǤСʲΥޥɤ¹Ԥ fc6xen ȤҤ뤫ɤǧƤ # uname -r 2.6.17-1.2600.fc6xen # xm list Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 610 1 r----- 12492.1 νϷ̤ϡXen ͥ뤬ɤ߹ޤƤȡDomain-0 (ۥ OS ) ƯǤʬޤ
Fedora ȡƥι †Fedora Core 6 Ǥ Xen ȡˤĤƤǤFedora Core 6 Υ OS anaconda(ȡ顼)ݡȤƤꡢȾѲǽˤʤäƤޤȡȤԤ xenguest-install ץѤ뤫GUI ե virt-manager Ȥޤ 'xenguest-install' Ѥ Fedora ȡƥι †xenguest-install ץѤȡޥɥ饤Ǥ÷ʥ饯ƥ֡˥ȡȤȤʤޤ # /usr/sbin/xenguest-install OS ݤˤ͡ФƤǤ礦Τ褦ʾΤ --help ץƤޤ®ǥȡȤ餻ʥåȡˤΤΥץ -x ks=options ⤢ޤ
ơºݤΥȡȤϤ줫餬֤Ǥ⤷եʥȡĶѲǽǤ VNC ɥʤɤȤȤޤ⤷եʴĶǤʤȤ⡢ɸŪʥƥȷˤ륤ȡǽǤɤƱͤ˲ۥФ֤ǽǤ 'virt-manager' Ѥ Fedora ȡƥι †Υޥɤ root 桼¤ư뤳ȤˤäơGUI ˤ륰եʲۥޥեȤưǤޤ # virt-manager
ȡκ †OS Υȡ GUI virt-manager ץफޥɥ饤Ǥ xm ޥɤѤƴ뤳Ȥˤʤޤ 'virt-manager' ǥե˲ۥޥ †Υޥɤ¹Ԥ뤳ȤǡGUI Virtual Machine Manager ( OS ޥ͡)ưǤޤ # virt-manager root 桼ưƤʤˤ root ѥɤϤޤѥɤϤʤ֤Ǥѹθ¤ʤƻ⡼ɤȤʤޤ
virt-manager ˴ؤ뵡ǽܺپˤĤƤȯץȤΥ֥ virt-manager ΥХˤĤƤ BugZilla 'virt-manager' 𤤤ȹǤ 'virsh' ǥޥɥ饤鲾ۥޥ †virsh 桼ƥƥϥޥɥ饤DzۥޥδǽȤΤǤvirsh libvirt API ƤΤǡ Xen xm ġ¿Ƥޤ
ۥޥ XML vm եȤäƹۤ뤳ȤǤޤ # virsh create <path to VM xml config> ߲Ưβۥޥɽˤϡ # virsh list OS Ŭڤߤ뤿ˤϡ # virsh shutdown <virtual machine (name | id | uuid)> OS βۥޥΥʥåסå*3¸ˤϡ # virsh save <virtual machine (name | id | uuid)> <filename> ¸Ƥ륹ʥåסåȤ줵ˤϡ # virsh restore <filename> ۥޥ˴Ϣ XML եǽϤˤϡ # virsh dumpxml <virtual machine (name | id | uuid) Τۤvirsh ѤˤäƤΥޥɥ饤Υץɽˤ # virsh help 嵭Υޥɤ¹Ԥ뤫뤤ϥޥ˥奢 virsh(1) ȤƤ$ man virsh ˡ virsh ΥХˤĤƤ BugZilla 'virsh' 𤤤ȹǤ 'xm' ǥޥɥ饤鲾ۥޥ †virsh ޥɰʳˤ⡢ۥޥޥɥ饤Ǵ뤿 xm 桼ƥƥѤ뤳ȤǤޤxm Xen òġǤۥޥ˥ꥢ롦³ˤϡ # /usr/sbin/xm create -c <name of virtual machine> ߲Ưβۥޥɽˤϡ # xm list OS ߤˤϡ # /usr/sbin/xm shutdown <virtual machine name> ե˥ХååפȤƲۥޥΥʥåסåȤ¸ˤϡ # /usr/sbin/xm save <virtual machine name> /<filename> ¸줿ʥåסåȤ줹ˤϡ # /usr/sbin/xm restore /<filename> top ޥɤΤ褦ۥޥξɽˤϡ # /usr/sbin/xm top Τۤxm ѤˤäƤΥޥɥ饤Υץɽˤϡ # /usr/sbin/xm help xm ΥХˤĤƤ BugZilla 'xen' 𤤤ȹǤ ȥ֥륷塼ƥʺäȤϡ †եˤĤ †Xen Ϣ褹뤿ᡢĤΥǥХåϤե뤬Ͽޤ/var/log/xen/xend.log ˤ xm.log Ʊ٤ΥϿޤǯʤ顢ե˵ϿûΤǡʬͤˤǤΤǤʤˤƤûΤǤޤͭѤȤϤʤΤǤʲ NetBSD/xen ͥ뤫饲 OS 褦ȤȤΤΤǤ [2005-06-27 02:23:02 xend] ERROR (SrvBase:163) op=create: Error creating domain:(0, 'Error') Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/xen/xend/server/SrvBase.py", line 107, in _perform val = op_method(op, req) File "/usr/lib/python2.4/site-packages/xen/xend/server/SrvDomainDir.py", line 71, in op_create raise XendError("Error creating domain: " + str(ex)) XendError: Error creating domain: (0, 'Error') Υե /var/log/xen/xend-debug.log ˤʬפܺ٤ʾϿޤNetBSD/xen ͥư褦ȤˤϡΤ褦ɽǤ礦 ERROR: Will only load images built for Xen v3.0 ERROR: Actually saw: 'GUEST_OS=netbsd,GUEST_VER=2.0,XEN_VER=2.0,LOADER=generic,BSD_SYMTAB' ERROR: Error constructing guest OS Xen ˴ؤƲ餫Υ顼ȯȤˤ /var/log/xen/xend.log /var/log/xen/xend-debug.log ˵Ͽޤ ۴(fully-virtualized)줿 OS (ɥᥤ)Ѥ㤨С¹ԻѹԲǽ OS Ѥˡξ /var/log/xen/qemu-dm*.log ȤƴϢ¸ޤ ǸˡϥѡХ¦(ۥ OS Υƥ)ưϼΥޥɤdzǧǽǤ # xm dmesg ꥢ롦 †ۥȤؤΥꥢ롦³ †н褹硢ꥢ롦³˽ȤʤǤ礦Xen ͥ뼫ȤߤƤޤϥѡХ顼ȤʤäƤޤݤʤɡ餫Υ顼롦ۥȾ˵ϿƤޤꥢ롦³ˤäơ⡼ȡۥȤξǧ뤳ȤǤΤǤ Xen ۥ OS Фƥꥢ롦ϤԤϥåȥåȤɬפǤ뤳Ȥǡ⡼ȡۥȤξİǽȤʤޤΤˤ /etc/grub.conf ԽɬפǤʲϵǤ title Fedora Core (2.6.17-1.2600.fc6xen) root (hd0,2) kernel /xen.gz-2.6.17-1.2600.fc6 com1=38400,8n1 sync_console module /vmlinuz-2.6.17-1.2600.fc6xen ro root=LABEL=/ rhgb quiet console=ttyS0 console=tty pnpacpi=off module /initrd-2.6.17-1.2600.fc6xen.img λǤϥꥢ롦 com1 ݡȡLinux /dev/ttyS0ˤФ 38,400 bps ®٤̿ȤԤäƤޤ"sync_console" ϥϥѡХʥۥ OS ˾ΥϤߤƤޤäƤݤͭѤȤʤΤǤ"pnpacpi=off" ϤưԤݤɬפȤʤ ACPI ̵ˤ륪ץǤ"console=ttyS0 console=tty" ΰ̣ϥͥνϤ륨顼å(̾ dmesg ǤǧǤޤˤ VGA ľܷҤ줿ǥץ쥤ȡꥢ롦ФƤƱ˽ϤԤȤԤΤǤκȤѤޤƤСttywatch ץꥱfedora-extras ˼ǼƤޤˤѤơ⡼ȥۥȤΥΥ顼ǥͳǼ뤳ȤǤޤ⡼ȾǤϡ # ttywatch --name myhost --port /dev/ttyS0 뤳ȤǡϤ /dev/ttyS0 ե /var/log/ttywatch/myhost.log ˵Ͽѹ뤳ȤǤޤ ¹Բ OS ξ †¹Բ(para-virtulized) OS ξϡDomain-0 ۥ OS εǽȤƼưŪ˥ꥢ롦ϤƤޤޥɥ饤夫黲ȤˤϡΤ褦Ϥޤ # xm console 뤤ϡե virt-manager ץȤäƥꥢ롦ϤԤȤޤñɽϥ˥塼С "View"(ɽ)"Serial console"(ꥢ롦)'console'()'details'(ܺ)ɥȤƤ ۴ OS ξ †۴(fully-virtualized) OS ξ⼫ưŪ˥ꥢ롦ϤԤȤޤ OS Υͥϴ˥ܥå褦ꤵƤޤäƤ뤿ᡢΤޤޤξ֤ǤϾǧ뤳ȤǤޤLinux ۴줿֤ǤΥȤξ֤ǧ /etc/grub.conf Խ OS δҤ'console=ttyS0 console=tty0'ɲäɬפޤΤȤˤꡢꥢ롦롢ޤϥեʥġ夫ǧǤ褦ˤʤޤǧˡϲ¹Բ OS λƱͤǤ # xm console 뤤ϡե virt-manager ץȤäƥꥢ롦ϤԤȤޤñɽϥ˥塼С "View"(ɽ)"Serial console"(ꥢ롦)'console'()'details'(ܺ)ɥȤƤ OS ΥǥΥǡؤΥ †lomount kpartx Ȥ OS Υǥ˥ݤˤȤƤΩĥġ뤬ޤ OS Domain-0 ưƤ֤ǻѤʤǤ ⤷Ư˻ȤäƤޤȥǡ»뤪줬ޤ줰⤴ղ
# lomount -t ext3 -diskimage /xen/images/fc5-file.img -partition 1 /mnt/boot lomount ϾʥǥȤưƤǤꡢLVM ܥ塼ȤϤǤޤʣԤˤ kpartx (device-mapper-multipath RPM) ѤƤ
# yum install device-mapper-multipath # kpartx -av /dev/xen/guest1 add map guest1p1 : 0 208782 linear /dev/xen/guest1 63 add map guest1p2 : 0 16563015 linear /dev/xen/guest1 208845 ̾Υ֥åǥХФƤΤưΤǡ OS ȡ뤵Ƥ륤եΤǤϤʤȤղե롦갷ˤϡޤ롼ץХåǥХʤƤϤޤ # losetup -f /dev/loop0 # losetup /dev/loop0 /xen/images/fc5-file.img # kpartx -av /dev/loop0 add map loop0p1 : 0 208782 linear /dev/loop0 63 add map loop0p2 : 0 12370050 linear /dev/loop0 208845 Ǥϡɸ Fedora Core ȡ뤵եޥåȤ줿˥Ȥ߹Ǥޤ /boot ȣĤ LVM ܥ塼Ǥˤ /dev/mapper Ȥޤ # ls -l /dev/mapper/ | grep guest1 brw-rw---- 1 root disk 253, 6 Jun 6 10:32 xen-guest1 brw-rw---- 1 root disk 253, 14 Jun 6 11:13 guest1p1 brw-rw---- 1 root disk 253, 15 Jun 6 11:13 guest1p2 # mount /dev/mapper/guest1p1 /mnt/boot/ ܤΥѡƥǤ LVM ܥ塼˥뤿ˤ "vgscan" ȤäƾγǧԤޤɸ "VolGroup00" Ȥѡƥ̾ѹˤ "vgchange -ay" Ѥޤ # kpartx -a /dev/xen/guest1 # vgscan Reading all physical volumes. This may take a while... Found volume group "VolGroup00" using metadata type lvm2 # vgchange -ay VolGroup00 2 logical volume(s) in volume group "VolGroup00" now active # lvs LV VG Attr LSize Origin Snap% Move Log Copy% LogVol00 VolGroup00 -wi-a- 5.06G LogVol01 VolGroup00 -wi-a- 800.00M # mount /dev/VolGroup00/LogVol00 /mnt/ ... # umount /mnt # vgchange -an VolGroup00 # kpartx -d /dev/xen/guest1
FAQ(褯Ȳ) †
ERROR: Could not obtain handle on privileged command interface (2 = No such file or directory) Traceback (most recent call last): File "/usr/sbin/xend", line 33, in ? from xen.xend.server import SrvDaemon File "/usr/lib/python2.4/site-packages/xen/xend/server/SrvDaemon.py", line 21, in ? import relocate File "/usr/lib/python2.4/site-packages/xen/xend/server/relocate.py", line 26, in ? from xen.xend import XendDomain File "/usr/lib/python2.4/site-packages/xen/xend/XendDomain.py", line 33, in ? import XendDomainInfo File "/usr/lib/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 37, in ? import image File "/usr/lib/python2.4/site-packages/xen/xend/image.py", line 30, in ? xc = xen.lowlevel.xc.xc() RuntimeError: (2, 'No such file or directory') ɤ Xen ϥѡХʲ۲бˤǤϤʤ Linux ͥưƤޤä褦˸ޤxen бͥ뤫ɤǧƤߤƤ
Ѥ褦ȤƤ륫ͥΥxen ϥѡХŬʲǽޤ⤷Fedora Core 5 ǺPAE ĥбˤ Fedora Core 6(PAE ĥб)ǻѤ褦ȤȡΥ顼ޤ
linux ͥ RPM ѥåϡ⤷ʤȤ grub.conf ǿΥͥ˽Ƥޤޤǡ/etc/sysconfig/kernel ե 'kernel-xen' ꤷ xen бͥɤ߹ޤ褦 grub.conf ɸȤ뤳ȤǤޤ äȤˤϡ †嵭Υȥ֥롦塼ƥˤĤʤʤ褦Ǥ顢Red Hat Bugzilla Fedora Core 6 ˴ؤ Xen ΥݡȤǧƤߤƤ"Fedora Core" Ǥ xen Υȥ֥ "Linux ͥ" ˵Τȡ"xen" ΤΤ˵Хβǽ뤿ǤХƤȡxen ôԤͭѤʥɥХƤ뤫⤷ޤ ǸդäƤޤȡFedora ץȤǤ Xen ݡȤΤꥹ Fedora Xen Mailing list ߤƤꡢǤˤĤĤʤƤޤ †
|