[[PageOutline]]
{{{
#!html
libvirt
}}}
----
= 【libvirt 介紹】 =
* libvirt 支援各種 VMM 程序(Xen, KVM, VirtualBox, Qemu, OpenVZ, UML, LXC...),以提供統一的虛擬化上層管理介面
* libvirt 有兩種運作模式:
1. '''local''': 直接使用 libvirt API [[BR]] [[Image(http://www.ibm.com/developerworks/cn/linux/l-libvirt/figure1.gif)]]
2. '''Remote''': 必須額外啟動 libvirtd 來 remote communication [[BR]] [[Image(http://www.ibm.com/developerworks/linux/library/l-libvirt/figure2.gif)]]
* '''libvirt API''' 主要可分為五種類型:
1. VMM 連接 API
2. Domain 管理 API
3. 網路管理 API
4. Storage volume API
5. Storage pool API
* libvirt API 支援的語言
* python
* C/C++
* Ruby
* JAVA
* perl
* variety of scripting languages, and even a unified functional language (Objective caml)
----
= 【libvirt 操作】 =
* 使用 virsh (虛擬 shell,基於 shell 的互動方式操作)
{{{
# virsh create xen-vm01.xml
(設定檔為 xml 格式)
# virsh list
# virsh suspend 1
# virsh resume 1
}}}
----
= 【使用 libvirt 開發的應用】 =
* virt-install
* virt-clone
* virt-manager
* virt-viewer
* oVirt
----
= 【References】 =
* [http://libvirt.org/ libvirt 官網]
* [http://www.ibm.com/developerworks/cn/linux/l-libvirt/ Libvirt 虛擬化庫解析]
* [http://l10n.ubuntu.tla.ro/ubuntu-8.10/html/serverguide/zh_CN/libvirt.html Ubuntu 關於 libvirt 的介紹]
* 安裝&配置
* [http://bderzhavets.wordpress.com/2010/05/18/set-up-libvirt-0-7-7xen-4-0-on-top-fedora-13-rc2/ Set up Libvirt 0.7.7&Xen 4.0 Dom0 (2.6.32.13 pvops) on top of Fedora 13 RC2]
* [http://blog.penumbra.be/2010/02/xen-libvirt-debian-lenny/ Install Xen and libvirt on Debian Lenny]
* Xen
* [http://blog.csdn.net/guxn25/archive/2008/05/25/2479745.aspx 基于libvirt API监测xen初探]
* KVM
* [http://heprc.phys.uvic.ca/sites/heprc.phys.uvic.ca/files/reports/vliet-wtr.pdf Creating and Controlling KVM Guests using libvirt]