hwameistor / drbd-adapter

A DRBD kernel loader that auto-adapts OS distros
Apache License 2.0
4 stars 6 forks source link

redhat 8.5 not install drbd-utils #79

Closed san3Xian closed 3 days ago

san3Xian commented 1 month ago

https://github.com/hwameistor/drbd-adapter/blob/ce5fbe22815cfc0a916c0569683722b3432f29df/docker-drbd9/entry.sh#L360-L361

https://github.com/hwameistor/drbd-adapter/blob/b838b7565e1fa97e1d740c0e2b479740fa069af3/docker-drbd9/entry.sh#L170-L185 In redhat 8.5 system environment, drbd-adapter will install kmod-drbd from "${PKGS}/${family}" such as lbdisttool.py --force-name rhel8.5 -k /pkgs/rhel8.5/kmod-drbd-9.0.32_4.18.0_348-1.x86_64.rpm

https://github.com/hwameistor/drbd-adapter/blob/b838b7565e1fa97e1d740c0e2b479740fa069af3/docker-drbd9/entry.sh#L6 https://github.com/hwameistor/drbd-adapter/blob/b838b7565e1fa97e1d740c0e2b479740fa069af3/docker-drbd9/entry.sh#L251-L260

However, when installing drbd utils, drbd-adapter only searches the /pkgs/drbd-rpms/ directory for rpm packages corresponding to the kernel version, which can cause the *{kernel_version}.rpm file not to be found under /pkgs/drbd-rpms/, resulting in the installation of drbd utils not proceeding.

The following is the running log of the rhel8 container:

[root@mitqadaocappn02 etc]# kubectl logs -n hwameistor drbd-adapter-mitqadaocappn02-rhel8-dllgh -c rhel8
+ which lbdisttool.py
/usr/local/bin/lbdisttool.py
++ lbdisttool.py -l
++ awk -F. '{print $1}'
+ image_dist=rhel8
++ lbdisttool.py -l --os-release /etc/host-release
++ awk -F. '{print $1}'
+ host_dist=rhel8
+ '[' -z rhel8 ']'
+ '[' -z rhel8 ']'
+ [[ rhel8 != rhel8 ]]
++ cat /proc/drbd
++ awk '/^version:/ {print $2}'
cat: /proc/drbd: No such file or directory
+ RUNNING_DRBD_VERSION=
+ '[' -z ']'
+ echo 'No DRBD Module is loaded'
No DRBD Module is loaded
OS_KERNEL:4.18.0-348.2.1.el8_5.x86_64
+ echo OS_KERNEL:4.18.0-348.2.1.el8_5.x86_64
+ export DRBD_EXIST=no
+ DRBD_EXIST=no
+ export DRBD_RMP_INSTALL=no
+ DRBD_RMP_INSTALL=no
+ export OS_KERNEL=4.18.0-348.2.1.el8_5.x86_64
+ OS_KERNEL=4.18.0-348.2.1.el8_5.x86_64
+ [[ rhel8 == \k\y\l\i\n\1\0 ]]
+ LB_HOW=shipped_modules
+ [[ shipped_modules == \s\h\i\p\p\e\d\_\m\o\d\u\l\e\s ]]
+ source /entry.sh
++ SIGN_KEY=https://packages.linbit.com/package-signing-pubkey.asc
++ PKGS=/pkgs
++ HOSTRELEASE=/etc/host-release
++ RPMDIR=/pkgs/drbd-rpms/
++ DEBDIR=/pkgs/drbd-debs/
++ HOW_DEPSONLY=deps_only
++ HOW_REPOFILE=repo_file
++ HOW_HASH=node_hash
++ HOW_FROMSRC=compile
++ HOW_FROMSHIPPED=shipped_modules
++ HOW_LOAD_FROM_RAM=RAM
++ HOW_INSTALL=install
++ modprobe_deps
++ local s
++ for m in libcrc32c nvmet_rdma nvme_rdma loop dm_writecache dm_cache dm_thin_pool dm_snapshot dm_crypt
++ modprobe libcrc32c
++ s=success
++ debug 'Loading libcrc32c: success'
++ '[' -n '' ']'
++ return 0
++ for m in libcrc32c nvmet_rdma nvme_rdma loop dm_writecache dm_cache dm_thin_pool dm_snapshot dm_crypt
++ modprobe nvmet_rdma
++ s=success
++ debug 'Loading nvmet_rdma: success'
++ '[' -n '' ']'
++ return 0
++ for m in libcrc32c nvmet_rdma nvme_rdma loop dm_writecache dm_cache dm_thin_pool dm_snapshot dm_crypt
++ modprobe nvme_rdma
++ s=success
++ debug 'Loading nvme_rdma: success'
++ '[' -n '' ']'
++ return 0
++ for m in libcrc32c nvmet_rdma nvme_rdma loop dm_writecache dm_cache dm_thin_pool dm_snapshot dm_crypt
++ modprobe loop
++ s=success
++ debug 'Loading loop: success'
++ '[' -n '' ']'
++ return 0
++ for m in libcrc32c nvmet_rdma nvme_rdma loop dm_writecache dm_cache dm_thin_pool dm_snapshot dm_crypt
++ modprobe dm_writecache
++ s=success
++ debug 'Loading dm_writecache: success'
++ '[' -n '' ']'
++ return 0
++ for m in libcrc32c nvmet_rdma nvme_rdma loop dm_writecache dm_cache dm_thin_pool dm_snapshot dm_crypt
++ modprobe dm_cache
++ s=success
++ debug 'Loading dm_cache: success'
++ '[' -n '' ']'
++ return 0
++ for m in libcrc32c nvmet_rdma nvme_rdma loop dm_writecache dm_cache dm_thin_pool dm_snapshot dm_crypt
++ modprobe dm_thin_pool
++ s=success
++ debug 'Loading dm_thin_pool: success'
++ '[' -n '' ']'
++ return 0
++ for m in libcrc32c nvmet_rdma nvme_rdma loop dm_writecache dm_cache dm_thin_pool dm_snapshot dm_crypt
++ modprobe dm_snapshot
++ s=success
++ debug 'Loading dm_snapshot: success'
++ '[' -n '' ']'
++ return 0
++ for m in libcrc32c nvmet_rdma nvme_rdma loop dm_writecache dm_cache dm_thin_pool dm_snapshot dm_crypt
++ modprobe dm_crypt
++ s=success
++ debug 'Loading dm_crypt: success'
++ '[' -n '' ']'
++ return 0
++ return 0
++ [[ shipped_modules == \d\e\p\s\_\o\n\l\y ]]
++ grep -q '^drbd ' /proc/modules
++ '[' -z 4.18.0-348.2.1.el8_5.x86_64 ']'
++ var1=4.18.0-348.2.1.el8_5.x86_64
++ matchvar=4.18.0-348.2.1.el8_5.x86_64.rpm
+++ find /pkgs/drbd-rpms/ -type f -name '*4.18.0-348.2.1.el8_5.x86_64.rpm' -print -quit
++ drbd_rpm=
++ '[' -n '' ']'
++ matchvar=4.18.0-348.2.1.el8_5.x86_64.deb
+++ find /pkgs/drbd-debs/ -type f -name '*4.18.0-348.2.1.el8_5.x86_64.deb' -print -quit
++ drbd_deb=
+++ find /pkgs/drbd-debs/ -type f -name 'drbd-utils*' -print -quit
++ utils_deb=/pkgs/drbd-debs/drbd-utils_9.27.0-1ppa1~focal1_amd64.deb
++ [[ -n '' ]]
++ debug 'There is no corresponding kernel version deb package or drbd-utils deb package'
++ '[' -n '' ']'
++ return 0
++ pkgdir=/tmp/pkg
++ kodir=/tmp/ko
++ rm -rf /tmp/pkg /tmp/ko
++ mkdir -p /tmp/pkg /tmp/ko
++ fmt=rpm
+++ type -p dpkg
++ '[' -n '' ']'
+++ type -p emerge
++ '[' -n '' ']'
++ case $fmt in
+++ repo::rpm::getrepofile
+++ echo /etc/yum.repos.d/linbit.repo
++ repo=/etc/yum.repos.d/linbit.repo
+++ how_to_get /etc/yum.repos.d/linbit.repo
+++ local repo=/etc/yum.repos.d/linbit.repo
+++ local how=
+++ '[' -n shipped_modules ']'
+++ how=shipped_modules
+++ echo shipped_modules
+++ return 0
++ how_get=shipped_modules
++ debug 'Detected kmod method: "shipped_modules"'
++ '[' -n '' ']'
++ return 0
++ dist=we_do_not_care
+++ needs_dist shipped_modules
+++ local how=shipped_modules
+++ local needsdist=n
+++ [[ shipped_modules == \n\o\d\e\_\h\a\s\h ]]
+++ echo n
+++ return 0
++ need_dist=n
++ debug 'Needs host distribution info: "n"'
++ '[' -n '' ']'
++ return 0
++ [[ n == y ]]
++ case $how_get in
++ kos::rpm::fromshipped /tmp/pkg
++ local pkgdir=/tmp/pkg
++ local family
++ local best
+++ lbdisttool.py --os-release /etc/host-release -l
++ family=rhel8.5
+++ lbdisttool.py --force-name rhel8.5 -k /pkgs/rhel8.5/kmod-drbd-9.0.32_4.18.0_348-1.x86_64.rpm
++ best=/pkgs/rhel8.5/kmod-drbd-9.0.32_4.18.0_348-1.x86_64.rpm
++ '[' -n /pkgs/rhel8.5/kmod-drbd-9.0.32_4.18.0_348-1.x86_64.rpm ']'
++ debug 'Best kernel module package: "/pkgs/rhel8.5/kmod-drbd-9.0.32_4.18.0_348-1.x86_64.rpm"'
++ '[' -n '' ']'
++ return 0
++ cp /pkgs/rhel8.5/kmod-drbd-9.0.32_4.18.0_348-1.x86_64.rpm /tmp/pkg
++ kos::rpm::extract /tmp/pkg
++ local pkgdir=/tmp/pkg
++ cd /tmp/pkg
++ rpm2cpio ./kmod-drbd-9.0.32_4.18.0_348-1.x86_64.rpm
++ cpio -idmv
+++ how_to_load
+++ [[ '' == yes ]]
+++ echo RAM
+++ return 0
++ how_load=RAM
++ debug 'Detected load method: "RAM"'
++ '[' -n '' ']'
++ return 0
++ [[ shipped_modules == \c\o\m\p\i\l\e ]]
++ load_from_ram /tmp/pkg /tmp/ko
++ local pkgdir=/tmp/pkg
++ local kodir=/tmp/ko
++ find /tmp/pkg -name '*.ko' -exec cp '{}' /tmp/ko ';'
++ cd /tmp/ko
++ '[' '!' -f drbd.ko ']'
++ '[' '!' -f drbd_transport_tcp.ko ']'
++ insmod ./drbd.ko usermode_helper=disabled
++ insmod ./drbd_transport_tcp.ko
++ insmod ./drbd_transport_rdma.ko
++ true
++ grep -q '^drbd_transport_tcp' /proc/modules
++ cp /config-drbd.sh /pkgs_root/config-drbd.sh
++ nsenter --target 1 --mount --uts --ipc --net --pid chmod +x /root/config-drbd.sh
++ nsenter --target 1 --mount --uts --ipc --net --pid /root/config-drbd.sh
Content successfully written to /etc/drbd.conf.
Content successfully written to /etc/drbd.d/global_common.conf.
++ print_drbd_version_and_exit
++ print_drbd_version
++ echo
++ echo 'DRBD version loaded:'
++ cat /proc/drbd
DRBD version loaded:
version: 9.0.32-1 (api:2/proto:86-121)
GIT-hash: 7d2933d5a3764fcc5e0bf54b71fd9cfb0363be1a build by @buildkitsandbox, 2024-04-25 10:48:55
Transports (api:17): tcp (9.0.32-1)
++ exit 0
peng9808 commented 1 month ago

Can you give me the log of the shipper container?Thanks ! @san3Xian

san3Xian commented 1 month ago

Thanks to hwameistor operator, all logs were cleaned up because the job was deleted😑. @peng9808

peng9808 commented 1 month ago

Got it. I will revise this part of the question this month.

san3Xian commented 1 month ago

What's a bit strange is that I've just realised that it's actually a temporary insmod, restarting the os drbd module is gone, it's not a direct install of the rpm