为块设备安装虚拟化支持

If you intend to use Ceph Block Devices and the Ceph Storage Cluster as abackend for Virtual Machines (VMs) or Cloud Platforms the QEMU/KVM andlibvirt packages are important for enabling VMs and cloud platforms.Examples of VMs include: QEMU/KVM, XEN, VMWare, LXC, VirtualBox, etc. Examplesof Cloud Platforms include OpenStack, CloudStack, OpenNebula, etc.

作为虚拟化的块设备 - 图1

安装 QEMU

QEMU KVM 能通过 librbd 库使用 Ceph 块设备,这对云平台是否能采用 Ceph 来说很重要。装好 QEMU 后,可以参考 QEMU 和块设备把它用起来。

Debian 软件包

QEMU 二进制包从 Ubuntu 12.04 Precise Pangolin 版起就被合并到了 Ubuntu 官方库。执行下面的命令安装 QEMU :

  1. sudo apt-get install qemu

RPM 软件包

要安装 QEMU ,可按如下步骤:

  • 更新软件库:
  1. sudo yum update
  • 安装能和 Ceph 对接的 QEMU :
  1. sudo yum install qemu-kvm qemu-kvm-tools qemu-img
  • 安装其它的 QEMU 软件包(可选的):
  1. sudo yum install qemu-guest-agent qemu-guest-agent-win32

构建 QEMU

To build QEMU from source, use the following procedure:

  1. cd {your-development-directory}
  2. git clone git://git.qemu.org/qemu.git
  3. cd qemu
  4. ./configure --enable-rbd
  5. make; make install

安装 libvirt

To use libvirt with Ceph, you must have a running Ceph Storage Cluster, andyou must have installed and configured QEMU. See Using libvirt with Ceph BlockDevice for usage.

Debian 软件包

libvirt 软件包从 Ubuntu 12.04 Precise Pangolin 起就被并入了 Ubuntu 官方库。要在这些发行版上安装 libvirt ,可用下面的命令:

  1. sudo apt-get update && sudo apt-get install libvirt-bin

RPM 软件包

要通过 libvirt 使用 Ceph 存储集群,你必须有个正常运行的 Ceph 集群、还必须安装支持 rbd 格式的 QEMU 。详情见 安装 QEMU

近期的 CentOS/RHEL 发行版都集成了 libvirt 软件包。可执行如下命令安装 libvirt

  1. sudo yum install libvirt

构建 libvirt

To build libvirt from source, clone the libvirt repository and useAutoGen to generate the build. Then, execute make and makeinstall tocomplete the installation. For example:

  1. git clone git://libvirt.org/libvirt.git
  2. cd libvirt
  3. ./autogen.sh
  4. make
  5. sudo make install

详情见 libvirt 安装手册