Bug 1802215

Summary: Add support for newer glusterfs
Product: Red Hat Enterprise Linux 7 Reporter: Miroslav Rezanina <mrezanin>
Component: qemu-kvmAssignee: Maxim Levitsky <mlevitsk>
Status: CLOSED ERRATA QA Contact: CongLi <coli>
Severity: high Docs Contact:
Priority: high    
Version: 7.9CC: coli, jinzhao, juzhang, mtessun, virt-maint
Target Milestone: rcKeywords: RFE, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-1.5.3-174.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1802216 1822235 (view as bug list) Environment:
Last Closed: 2020-09-29 19:50:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1802216, 1821669, 1822235    

Description Miroslav Rezanina 2020-02-12 15:55:14 UTC
New glusterfs version will be shipped in RHEL-7.9. This version changes some of the api so we have to update qemu-kvm to support this api. This was done upstream by following patches:

e014dbe74e0484188164c61ff6843f8a04a8cb9d   gluster: Handle changed glfs_ftruncate signature
0e3b891fefacc0e49f3c8ffa3a753b69eb7214d2   gluster: the glfs_io_cbk callback function pointer adds pre/post stat args

As 1.5.3 version is too old we may need more stuff to be backported.

Comment 8 Tingting Mao 2020-03-20 10:04:58 UTC
Tried to verify this bug as below.


Tested with:
qemu-kvm-1.5.3-174.el7.x86_64
kernel-3.10.0-1129.el7.x86_64

# rpm -qa | grep glusterfs
glusterfs-libs-6.0-30.1.el7rhgs.x86_64
glusterfs-devel-6.0-30.1.el7rhgs.x86_64
glusterfs-geo-replication-6.0-30.1.el7rhgs.x86_64
glusterfs-cloudsync-plugins-6.0-30.1.el7rhgs.x86_64
glusterfs-6.0-30.1.el7rhgs.x86_64
glusterfs-api-6.0-30.1.el7rhgs.x86_64
glusterfs-fuse-6.0-30.1.el7rhgs.x86_64
glusterfs-server-6.0-30.1.el7rhgs.x86_64
glusterfs-events-6.0-30.1.el7rhgs.x86_64
glusterfs-rdma-6.0-30.1.el7rhgs.x86_64
glusterfs-debuginfo-6.0-30.1.el7rhgs.x86_64
glusterfs-client-xlators-6.0-30.1.el7rhgs.x86_64
glusterfs-cli-6.0-30.1.el7rhgs.x86_64
glusterfs-api-devel-6.0-30.1.el7rhgs.x86_64


Steps:
1. Setup gluster server in the host.
1.1 Installed the rpm packages as above.
1.2 Import volume.
# systemctl enable --now glusterd

# systemctl status glusterd
● glusterd.service - GlusterFS, a clustered file-system server
   Loaded: loaded (/usr/lib/systemd/system/glusterd.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-03-19 03:41:39 EDT; 6s ago
     Docs: man:glusterd(8)
  Process: 10669 ExecStart=/usr/sbin/glusterd -p /var/run/glusterd.pid --log-level $LOG_LEVEL $GLUSTERD_OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 10670 (glusterd)
   CGroup: /system.slice/glusterd.service
           └─10670 /usr/sbin/glusterd -p /var/run/glusterd.pid --log-level INFO

Mar 19 03:41:38 hp-dl388pg8-01.lab.eng.pek2.redhat.com systemd[1]: Starting GlusterFS, a clustered fi....
Mar 19 03:41:39 hp-dl388pg8-01.lab.eng.pek2.redhat.com systemd[1]: Started GlusterFS, a clustered fil....
Hint: Some lines were ellipsized, use -l to show in full.

# mkdir /home/brick

# gluster volume create gv0 hp-dl388pg8-01.lab.eng.pek2.redhat.com:/home/brick force
volume create: gv0: success: please start the volume to access data

# gluster volume start gv0
volume start: gv0: success

2. Do tests.
2.1 Create images with different formats.
Qcow2:
# qemu-img create -f qcow2 gluster://hp-dl388pg8-01.lab.eng.pek2.redhat.com/gv0/base.qcow2 20G
Formatting 'gluster://hp-dl388pg8-01.lab.eng.pek2.redhat.com/gv0/base.qcow2', fmt=qcow2 size=21474836480 encryption=off cluster_size=65536 lazy_refcounts=off debug=0 
[2020-03-20 09:48:59.165361] I [io-stats.c:4027:fini] 0-gv0: io-stats translator unloaded
[2020-03-20 09:49:00.933693] I [io-stats.c:4027:fini] 0-gv0: io-stats translator unloaded
[2020-03-20 09:49:02.931814] I [io-stats.c:4027:fini] 0-gv0: io-stats translator unloaded

# qemu-img info gluster://hp-dl388pg8-01.lab.eng.pek2.redhat.com/gv0/base.qcow2
[2020-03-20 09:49:11.914998] I [io-stats.c:4027:fini] 0-gv0: io-stats translator unloaded
image: gluster://hp-dl388pg8-01.lab.eng.pek2.redhat.com/gv0/base.qcow2
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 193K
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false


Raw:
# qemu-img create -f raw gluster://hp-dl388pg8-01.lab.eng.pek2.redhat.com/gv0/base.raw 2G
Formatting 'gluster://hp-dl388pg8-01.lab.eng.pek2.redhat.com/gv0/base.raw', fmt=raw size=2147483648 debug=0 
[2020-03-20 09:49:52.849656] I [io-stats.c:4027:fini] 0-gv0: io-stats translator unloaded

# qemu-img info gluster://hp-dl388pg8-01.lab.eng.pek2.redhat.com/gv0/base.raw
[2020-03-20 09:50:03.693029] I [io-stats.c:4027:fini] 0-gv0: io-stats translator unloaded
image: gluster://hp-dl388pg8-01.lab.eng.pek2.redhat.com/gv0/base.raw
file format: raw
virtual size: 2.0G (2147483648 bytes)
disk size: 0
[root@hp-dl388pg8-


2.2 Install guest over a image with qcow2 format, reboot, and shutdown.
# /usr/libexec/qemu-kvm \
        -name 'guest-rhel' \
        -machine q35 \
        -nodefaults \
        -vga qxl \
        -drive id=drive_cd1,if=none,snapshot=off,aio=threads,cache=unsafe,media=cdrom,file=RHEL7.8-Server-x86_64.iso  \
        -device ide-cd,id=cd1,drive=drive_cd1,bus=ide.0,unit=0 \
        -drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=qcow2,file=gluster://hp-dl388pg8-01.lab.eng.pek2.redhat.com/gv0/base.qcow2 \
        -device virtio-blk-pci,id=virtio_blk_pci0,drive=drive_image1,bus=pcie.0,addr=05 \
        -vnc :0 \
        -monitor stdio \
        -m 8192 \
        -smp 8 \
        -device virtio-net-pci,mac=9a:b5:b6:b1:b2:b3,id=idMmq1jH,vectors=4,netdev=idxgXAlm,bus=pcie.0,addr=0x9  \
        -netdev tap,id=idxgXAlm \
        -chardev socket,id=qmp_id_qmpmonitor1,path=/var/tmp/timao/monitor-qmpmonitor1-20180220-094308-h9I6hRsI,server,nowait \
        -mon chardev=qmp_id_qmpmonitor1,mode=control  \

Result:
Creation works fine, and install,reboot, shutdown all work fine.

Comment 14 errata-xmlrpc 2020-09-29 19:50:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Low: qemu-kvm security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:3906