關於xen的雜七雜八 (DomU安裝)

來源:互聯網
上載者:User

DomU就是guest domain,安裝一個domU基本上是個體力活,我自己好久不做了幾乎都忘了,最近要測試幾個系統所以又撿起來,這裡把流程記錄下,以後用臉滾鍵盤就行了。。。DomU分為兩種:para-virtualization 和 hardware-virtualization,具體的解釋去xen.org上看去。這兩種DomU安裝方法是不同的。

Para-Virtualization(類虛擬化):

pvm的啟動目前需要pvgrub的支援(http://wiki.xen.org/wiki/PVGrub_HowTo),在設定檔裡指定為

kernel=/usr/lib/xen/boot/pv-grub-x86_64.gz

extra=(hd0,0)/boot/grub/menu.lst

Hardware-Virtualization(硬體輔助虛擬化):

hvm的domU需要通過hvmloader啟動(http://wiki.xen.org/wiki/Hvmloader),如果你安裝了xen,可以好好看下/etc/xen/xmexample.hvm的設定檔

下面是xen wiki摘錄下來的一個例子

Example HVM guest configuration file for PVHVM use

Example configuration file ("/etc/xen/f16hvm") for Xen 4.x HVM guest VM using Linux PVHVM paravirtualized optimized drivers for disks and network:

kernel = "hvmloader"builder='hvm'device_model = 'qemu-dm'name = "f16pvhvm"memory = 1024vcpus=1pae=1acpi=1apic=1vif = [ 'mac=00:16:4f:02:02:15, bridge=virbr0, model=e1000' ]disk = [ 'phy:/dev/vg01/f16pvhvm-disk0,hda,w', 'file:/root/iso/Fedora-16-x86_64-DVD.iso,hdc:cdrom,r' ]boot='cd'xen_platform_pci=1on_poweroff = 'destroy'on_reboot   = 'restart'on_crash    = 'restart'sdl=0vnc=1vncpasswd=''stdvga=0serial='pty'tsc_mode=0usb=1usbdevice='tablet'keymap='en'

This example has been tested and is working on Fedora 16 Xen dom0 host using the included Xen 4.1.2 and Linux 3.1 kernel in dom0, and Fedora 16 Xen PVHVM guest VM, also using the stock F16 Linux 3.1 kernel with the out-of-the-box included PVHVM drivers.

pvm安裝還有個注意的地方是pv driver的安裝,請參考xen wiki

http://wiki.xen.org/wiki/Using_Xen_PV_Drivers_on_HVM_Guest

http://wiki.xen.org/wiki/XenLinuxPVonHVMdrivers

比如看如下一個配置 

disk = [ 'file:/system.img,hda,w', 'file:/disk1.img,sda,w', 'file:/disk2.img,xvda,w', ]

對於hda,比如要在啟動dom0時指定ide0=noprobe,這樣就不會用qemu-dm來類比hda;對於sda一般不指定,不然qemu會把sda用sym53c8xx的驅動來類比;而xvda這類裝置是不會用qemu-dm來類比的,如果使用pv driver,指定xvda, xvdb這類裝置是最好的選擇

202 blockXen Virtual Block Device  0 = /dev/xvda       First Xen VBD whole disk  16 = /dev/xvdb      Second Xen VBD whole disk  32 = /dev/xvdc      Third Xen VBD whole disk    ...  240 = /dev/xvdp     Sixteenth Xen VBD whole disk                Partitions are handled in the same way as for IDE                disks (see major number 3) except that the limit on                partitions is 15.

如果pv driver正確安裝,dmesg | egrep -i 'xen|front'可以看到如下資訊

[    0.000000] Xen Platform PCI: I/O protocol version 1[    0.000000] Netfront and the Xen platform PCI driver have been compiled for this kernel: unplug emulated NICs.[    0.000000] Blkfront and the Xen platform PCI driver have been compiled for this kernel: unplug emulated disks[    0.000000] Xen HVM callback vector for event delivery is enabled[    2.377167] vbd vbd-5632: 19 xenbus_dev_probe on device/vbd/5632[    2.378134] blkfront: xvda: flush diskcache: enabled[    6.266448] Initialising Xen virtual ethernet driver.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.