






















Red Hat Ceph Storage integrates with RHEL virtualization (KVM/libvirt) through the QEMU RBD driver. This lets you store VM disk images directly in Ceph RBD, enabling live migration, high availability, and centralized storage management.
qemu-kvm and libvirt installeddnf install -y ceph-commonCopy the cluster config and keyring from the Ceph admin node:
scp ceph-admin:/etc/ceph/ceph.conf /etc/ceph/ceph.conf
scp ceph-admin:/etc/ceph/ceph.client.admin.keyring /etc/ceph/On the Ceph cluster:
ceph osd pool create vms 128
rbd pool init vms
ceph auth get-or-create client.libvirt \
mon 'profile rbd' \
osd 'profile rbd pool=vms' \
-o /etc/ceph/ceph.client.libvirt.keyringCreate an XML secret for libvirt:
<secret ephemeral='no' private='no'>
<usage type='ceph'>
<name>client.libvirt secret</name>
</usage>
</secret>SECRET_UUID=$(virsh secret-define --file ceph-secret.xml | awk '{print $2}')
CEPH_KEY=$(ceph auth get-key client.libvirt)
virsh secret-set-value --secret "$SECRET_UUID" --base64 "$CEPH_KEY"rbd create vms/vm1-disk --size 20G
rbd info vms/vm1-diskIn the VM XML definition, replace the disk section:
<disk type='network' device='disk'>
<driver name='qemu' type='raw'/>
<auth username='libvirt'>
<secret type='ceph' uuid='YOUR_SECRET_UUID'/>
</auth>
<source protocol='rbd' name='vms/vm1-disk'>
<host name='192.168.1.10' port='6789'/>
<host name='192.168.1.11' port='6789'/>
<host name='192.168.1.12' port='6789'/>
</source>
<target dev='vda' bus='virtio'/>
</disk>virsh define vm1.xml
virsh start vm1Because the disk is in Ceph, live migration requires no disk copy:
virsh migrate --live vm1 qemu+ssh://hypervisor2/systemIntegrating RHCS with RHEL virtualization enables centralized VM disk storage in Ceph RBD pools. The QEMU RBD driver accesses disks directly over the Ceph network, allowing live migration and removing dependency on local storage. The key setup steps are installing the ceph-common packages on hypervisors and configuring a libvirt secret for authentication.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。