libivrtd fork qemu to create vm ,which start with ceph rbd device, after vm status:runing , the qemu stuck at booting from hard disk....
Description of problem:
[root@ceph-client ceph]# virsh list --all
Id Name State
----------------------------------------------------
19 c7_ceph running
the vm qemu stuck at booting from hard disk.....
Steps to reproduce:
1. use ceph-deploy deploy a ceph distribute storage, which use to store vm's qcow2 files,this ceph has 3 osd node
2. refer the link https://docs.ceph.com/en/quincy/rbd/libvirt/ create a ceph user :client.libvirt
3. import a exists qcow2 file into ceph libvit-pool, then start vm
[root@ceph-1 ~]# ceph -s
cluster:
id: 3fbbf51f-88fd-4883-9f24-595bf853c5f2
health: HEALTH_OK
services:
mon: 1 daemons, quorum ceph-1
mgr: ceph-1(active)
osd: 3 osds: 3 up, 3 in
data:
pools: 1 pools, 128 pgs
objects: 940 objects, 3.6 GiB
usage: 31 GiB used, 209 GiB / 240 GiB avail
pgs: 128 active+clean
[root@ceph-1 ~]#ceph auth ls
client.libvirt
key: AQD/XwFkq7kHMhAA1OmPtKPVno6gjmZleOevOA==
caps: [mon] allow r
caps: [osd] allow class-read object_prefix rbd_children, allow rwx pool=libvirt-pool
[root@ceph-client ceph]# cat ceph.conf
[global]
fsid = 3fbbf51f-88fd-4883-9f24-595bf853c5f2
mon_initial_members = ceph-1
mon_host = 172.24.193.62
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
osd_pool_default_size = 2
[root@ceph-client ceph]#
[root@ceph-client ceph]# virsh start c7_ceph
Domain c7_ceph started
[root@ceph-client ceph]#
[root@ceph-client ceph]# virsh list --all
Id Name State
----------------------------------------------------
19 c7_ceph running
/usr/local/qemu-3.0/bin/qemu-system-x86_64
========================
[root@ceph-client ceph]# cat /run/libvirt/qemu/c7_ceph.xml
Broadwellc7_cephff08671e-824c-4939-80ec-602235c0662e419430441943042/machinehvmBroadwelldestroyrestartdestroy/usr/local/qemu-3.0/bin/qemu-system-x86_64/dev/urandomsystem_u:object_r:svirt_image_t:s0:c99,c659+107:+107
[root@ceph-client ceph]#
/usr/local/qemu-3.0/bin/qemu-system-x86_64 which is build by qemu-3.0 source code , first i build qemu-3.0 source with --enable-rbd ,
later i rebuild qemu-3.0 source with more config paramter from centos7-2009 qemu, those config paramter from qemu-kvm-1.5.3-175.el7.src.rpm ,which has those paramters:
# QEMU configure log Fri Mar 3 18:22:31 CST 2023
# Configured with: './configure' '--prefix=/usr' '--libdir=/usr/lib64' '--sysconfdir=/etc' '--interp-prefix=/usr/qemu-%M' '--audio-drv-list=pa,alsa' '--with-confsuffix=/qemu-kvm' '--localstatedir=/var' '--libexecdir=/usr/libexec' '--wit
h-pkgversion=qemu-kvm-1.5.3-175.el7' '--disable-strip' '--disable-qom-cast-debug' '--extra-ldflags=-Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now' '--extra-cflags=-O2 -g -pipe -Wall -fexceptions -fstack-protector-strong --param=ssp-buffer
-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIE -DPIE' '--enable-trace-backend=dtrace' '--enable-werror' '--disable-xen' '--disable-virtfs' '--enable-kvm' '--enable-libusb' '--enable-spice' '--enable-seccomp' '--disable-fdt' '--
enable-docs' '--disable-sdl' '--disable-debug-tcg' '--disable-sparse' '--disable-brlapi' '--disable-bluez' '--disable-vde' '--disable-curses' '--enable-curl' '--enable-libssh2' '--enable-vnc-tls' '--enable-vnc-sasl' '--enable-linux-aio'
'--enable-smartcard-nss' '--enable-lzo' '--enable-snappy' '--enable-usb-redir' '--enable-vnc-png' '--disable-vnc-jpeg' '--enable-vnc-ws' '--enable-uuid' '--disable-vhost-scsi' '--disable-guest-agent' '--disable-live-block-ops' '--disab
le-live-block-migration' '--enable-rbd' '--enable-glusterfs' '--enable-tcmalloc' '--block-drv-rw-whitelist=qcow2,raw,file,host_device,blkdebug,nbd,iscsi,gluster,rbd' '--block-drv-ro-whitelist=vmdk,vhdx,vpc,ssh,https' '--iasl=/bin/false'
'--target-list=x86_64-softmmu'
, after rebuild the qemu-system-x86_64 :
virsh start c7_ceph
[root@ceph-client ceph]# virsh list --all
Id Name State
----------------------------------------------------
19 c7_ceph running
qemu still stuck at booting from hard disk...
to my surprised if the libvirtd xml file if i replace /usr/local/qemu-3.0/bin/qemu-system-x86_64 with /usr/libexec/bin/qemu-kvm , then the vm
can start successfully .