libvirt(一)

 参考文档:

http://www.ibm.com/developerworks/cn/linux/l-libvirt/

http://libvirt.org

libvirt 提供一种虚拟机监控程序不可知的 API 来安全管理运行于主机上的来宾操作系统。支持kvm/qemu、zen、ESX等。

在libvirt中要支持QEMU,必须打开libvirtd daemon。

libvirtd --daemon --config /etc/libvirt/libvirtd.conf --listen

connection URIs: 

qemu:///session                      (local access to per-user instance)
qemu+unix:///session                 (local access to per-user instance)

qemu:///system                       (local access to system instance)
qemu+unix:///system                  (local access to system instance)
qemu://example.com/system            (remote access, TLS/x509)
qemu+tcp://example.com/system        (remote access, SASl/Kerberos)
qemu+ssh://[email protected]/system   (remote access, SSH tunnelled)

有可能在环境变量中LIBVIRT_DEFAULT_URI

virsh -c test:///default list
virt-manager -c test:///default
virt-install --connect=test:///default [other options]

Command line tools

guestfish
Guestfish is an interactive shell and command-line tool for examining and modifying virtual machine filesystems. It uses libvirt to find guests and their associated disks.
virsh
An interactive shell, and batch scriptable tool for performing management tasks on all libvirt managed domains, networks and storage. This is part of the libvirt core distribution.
virt-clone
Allows the disk image(s) and configuration for an existing virtual machine to be cloned to form a new virtual machine. It automates copying of data across to new disk images, and updates the UUID, MAC address, and name in the configuration.
virt-df
Examine the utilization of each filesystem in a virtual machine from the comfort of the host machine. This tool peeks into the guest disks and determines how much space is used. It can cope with common Linux filesystems and LVM volumes.
virt-image
Provides a way to deploy virtual appliances. It defines a simplified portable XML format describing the pre-requisites of a virtual machine. At time of deployment this is translated into the domain XML format for execution under any libvirt hypervisor meeting the pre-requisites.
virt-install
Provides a way to provision new virtual machines from a OS distribution install tree. It supports provisioning from local CD images, and the network over NFS, HTTP and FTP.
virt-top
Watch the CPU, memory, network and disk utilization of all virtual machines running on a host.
virt-what
virt-what is a shell script for detecting if the program is running in a virtual machine. It prints out a list of facts about the virtual machine, derived from heuristics.

猜你喜欢

转载自crystalrain0.iteye.com/blog/1724656