libvirt
【libvirt 介紹】
- libvirt 支援各種 VMM 程序(Xen, KVM, VirtualBox, Qemu, OpenVZ, UML, LXC...),以提供統一的虛擬化上層管理介面
- libvirt API 主要可分為五種類型:
- VMM 連接 API
- Domain 管理 API
- 網路管理 API
- Storage volume API
- Storage pool API
- libvirt API 支援的語言
- python
- C/C++
- Ruby
- JAVA
- perl
- variety of scripting languages, and even a unified functional language (Objective caml)
- 使用 libvirt 開發的應用
- virt-install
- virt-clone
- virt-manager
- virt-viewer
- oVirt
【libvirt 測試】
[安裝]
- 從 source 安裝
$ wget http://libvirt.org/sources/libvirt-0.8.4.tar.gz ; tar zxvf libvirt-0.8.4.tar.gz ; cd libvirt-0.8.4 $ ./configure --with-xen --prefix=/usr $ make $ make install
- configure 遇到缺少某套件時
$ sudo aptitude install libxml2-dev libgnutls-dev libdevmapper-dev libxen-dev
- configure 遇到缺少某套件時
- 從套件檔安裝
$ aptitude search libvirt p libvirt-bin - the programs for the libvirt library p libvirt-dev - development files for the libvirt library p libvirt-doc - documentation for the libvirt library p libvirt-ocaml - OCaml bindings for libvirt p libvirt-ocaml-dev - OCaml bindings for libvirt p libvirt0 - library for interfacing with different virtualization system p libvirt0-dbg - library for interfacing with different virtualization system p python-libvirt - libvirt Python bindings v python2.5-libvirt -
[操作]
- 使用 virsh (虛擬 shell,基於 shell 的互動方式操作)
# virsh create xen-vm01.xml (設定檔為 xml 格式) # virsh list # virsh suspend 1 # virsh resume 1
[使用 API]
【References】
Last modified 14 years ago
Last modified on Sep 29, 2010, 4:37:28 PM