[Bug 1988366] Re: python-rtslib-fb needs to handle new attribute cpus_allowed_list
Nobuto Murata
1988366 at bugs.launchpad.net
Sat Jul 13 15:09:03 UTC 2024
The test case in the description succeeded for both the GA kernel and
HWE kernel for jammy.
[GA kernel]
ubuntu at rtslib-fb-sru-testing-ga:~$ apt policy python3-rtslib-fb
python3-rtslib-fb:
Installed: 2.1.74-0ubuntu4.1
Candidate: 2.1.74-0ubuntu4.1
Version table:
*** 2.1.74-0ubuntu4.1 500
500 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages
100 /var/lib/dpkg/status
2.1.74-0ubuntu4 500
500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
ubuntu at rtslib-fb-sru-testing-ga:~$ ## create the test iSCSI target based on the quickstart guide in targetcli(8)
## https://manpages.ubuntu.com/manpages/jammy/en/man8/targetcli.8.html
cat <<EOF | sudo targetcli
backstores/fileio create test /tmp/test.img 100m
iscsi/ create iqn.2006-04.com.example:test-target
cd iscsi/iqn.2006-04.com.example:test-target/tpg1/
luns/ create /backstores/fileio/test
set attribute generate_node_acls=1
EOF
Warning: Could not load preferences file /root/.targetcli/prefs.bin.
targetcli shell version 2.1.53
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.
/> Created fileio test with size 104857600
/> Created target iqn.2006-04.com.example:test-target.
Created TPG 1.
Global pref auto_add_default_portal=true
Created default portal listening on all IPs (0.0.0.0), port 3260.
/> /iscsi/iqn.20...t-target/tpg1> Created LUN 0.
/iscsi/iqn.20...t-target/tpg1> Parameter generate_node_acls is now '1'.
/iscsi/iqn.20...t-target/tpg1> exit
Global pref auto_save_on_exit=true
Configuration saved to /etc/rtslib-fb-target/saveconfig.json
ubuntu at rtslib-fb-sru-testing-ga:~$ ## confirm the test iSCSI target is discoverable locally and confirm the discovered one is output in the terminal
sudo iscsiadm --mode discoverydb --type sendtargets \
--portal 127.0.0.1 --discover
127.0.0.1:3260,1 iqn.2006-04.com.example:test-target
ubuntu at rtslib-fb-sru-testing-ga:~$ ## tear down the test iSCSI target and confirm there is no error returned
sudo targetcli clearconfig confirm=True
All configuration cleared
[HWE kernel]
ubuntu at rtslib-fb-sru-testing-hwe:~$ apt policy python3-rtslib-fb
python3-rtslib-fb:
Installed: 2.1.74-0ubuntu4.1
Candidate: 2.1.74-0ubuntu4.1
Version table:
*** 2.1.74-0ubuntu4.1 500
500 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages
100 /var/lib/dpkg/status
2.1.74-0ubuntu4 500
500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
ubuntu at rtslib-fb-sru-testing-hwe:~$ ## create the test iSCSI target based on the quickstart guide in targetcli(8)
## https://manpages.ubuntu.com/manpages/jammy/en/man8/targetcli.8.html
cat <<EOF | sudo targetcli
backstores/fileio create test /tmp/test.img 100m
iscsi/ create iqn.2006-04.com.example:test-target
cd iscsi/iqn.2006-04.com.example:test-target/tpg1/
luns/ create /backstores/fileio/test
set attribute generate_node_acls=1
EOF
Warning: Could not load preferences file /root/.targetcli/prefs.bin.
targetcli shell version 2.1.53
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.
/> Created fileio test with size 104857600
/> Created target iqn.2006-04.com.example:test-target.
Created TPG 1.
Global pref auto_add_default_portal=true
Created default portal listening on all IPs (0.0.0.0), port 3260.
/> /iscsi/iqn.20...t-target/tpg1> Created LUN 0.
/iscsi/iqn.20...t-target/tpg1> Parameter generate_node_acls is now '1'.
/iscsi/iqn.20...t-target/tpg1> exit
Global pref auto_save_on_exit=true
Configuration saved to /etc/rtslib-fb-target/saveconfig.json
ubuntu at rtslib-fb-sru-testing-hwe:~$ ## confirm the test iSCSI target is discoverable locally and confirm the discovered one is output in the terminal
sudo iscsiadm --mode discoverydb --type sendtargets \
--portal 127.0.0.1 --discover
127.0.0.1:3260,1 iqn.2006-04.com.example:test-target
ubuntu at rtslib-fb-sru-testing-hwe:~$ ## tear down the test iSCSI target and confirm there is no error returned
sudo targetcli clearconfig confirm=True
All configuration cleared
ubuntu at rtslib-fb-sru-testing-hwe:~$ uname -a
Linux rtslib-fb-sru-testing-hwe 6.5.0-41-generic #41~22.04.2-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun 3 11:32:55 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
** Tags removed: verification-needed verification-needed-jammy
** Tags added: verification-done verification-done-jammy
--
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to python-rtslib-fb in Ubuntu.
https://bugs.launchpad.net/bugs/1988366
Title:
python-rtslib-fb needs to handle new attribute cpus_allowed_list
Status in python-rtslib-fb package in Ubuntu:
Fix Released
Status in python-rtslib-fb source package in Jammy:
Fix Committed
Bug description:
[ Impact ]
* getting information about "attached_luns" fails via python3-rtslib-
fb when running the HWE kernel on jammy due to the new kernel module
attribute cpus_allowed_list
* As a consequence, the following operations on jammy fails:
- creating an iSCSI target with Ceph-iSCSI service
https://docs.ceph.com/en/quincy/rbd/iscsi-target-cli/
(LUN.allocate) created test-iscsi-pool/disk_1 successfully
(LUN.add_dev_to_lio) Adding image 'test-iscsi-pool/disk_1' to LIO backstore user:rbd
tcmu-runner: tcmu_rbd_open:1162 rbd/test-iscsi-pool.disk_1: address: {172.16.12.185:0/2337103748}
(LUN.add_dev_to_lio) Successfully added test-iscsi-pool/disk_1 to LIO
LUN alloc problem - Delete from LIO/backstores failed - [Errno 20] Not a directory: '/sys/kernel/config/target/iscsi/cpus_allowed_list'
- targetcli clearconfig confirm=True
[Errno 20] Not a directory:
'/sys/kernel/config/target/iscsi/cpus_allowed_list'
- targetctl clear
$ sudo targetctl clear
Traceback (most recent call last):
File "/usr/bin/targetctl", line 82, in <module>
main()
File "/usr/bin/targetctl", line 79, in main
funcs[sys.argv[1]](savefile)
File "/usr/bin/targetctl", line 57, in clear
RTSRoot().clear_existing(confirm=True)
File "/usr/lib/python3/dist-packages/rtslib_fb/root.py", line 318, in clear_existing
so.delete()
File "/usr/lib/python3/dist-packages/rtslib_fb/tcm.py", line 269, in delete
for lun in self._gen_attached_luns():
File "/usr/lib/python3/dist-packages/rtslib_fb/tcm.py", line 215, in _gen_attached_luns
for tpgt_dir in listdir(tpgts_base):
NotADirectoryError: [Errno 20] Not a directory: '/sys/kernel/config/target/iscsi/cpus_allowed_list'
[ Test Plan ]
## create two VMs, one for the GA kernel and the other for the HWE kernel
for kernel in ga hwe; do
uvt-kvm create \
--cpu=4 --memory=4096 \
rtslib-fb-sru-testing-$kernel \
release=jammy
uvt-kvm wait rtslib-fb-sru-testing-$kernel
uvt-kvm ssh rtslib-fb-sru-testing-$kernel 'sudo apt-get update && sudo apt-get upgrade -y'
uvt-kvm ssh rtslib-fb-sru-testing-$kernel 'sudo apt-get install -y python3-rtslib-fb targetcli-fb'
done
## Install the HWE kernel and reboot
uvt-kvm ssh rtslib-fb-sru-testing-hwe 'sudo apt-get install -y linux-generic-hwe-22.04 && sudo reboot'
## Upgrade python3-rtslib-fb to the -proposed one
## create the test iSCSI target based on the quickstart guide in targetcli(8)
## https://manpages.ubuntu.com/manpages/jammy/en/man8/targetcli.8.html
cat <<EOF | sudo targetcli
backstores/fileio create test /tmp/test.img 100m;
iscsi/ create iqn.2006-04.com.example:test-target;
cd iscsi/iqn.2006-04.com.example:test-target/tpg1/;
luns/ create /backstores/fileio/test;
set attribute generate_node_acls=1;
EOF
## confirm the test iSCSI target is discoverable locally and confirm the discovered one is output in the terminal
sudo iscsiadm --mode discoverydb --type sendtargets \
--portal 127.0.0.1 --discover
## tear down the test iSCSI target and confirm there is no error returned
sudo targetcli clearconfig confirm=True
[ Where problems could occur ]
The worst case scenario is it could cause a regression to the
environment where the GA kernel is still running since the fix is for
newer kernels.
To mitigate the risk, the same test case will be run for both GA
kernel and HWE kernel machines with -proposed package.
[ Other Info ]
* upstream fix https://github.com/open-iscsi/rtslib-fb/commit/8d2543c4da62e962661011fea5b19252b9660822
====
python-rtslib-fb needs to properly handle the new kernel module attribute cpus_allowed_list.
This is causing a problem during targetcli-fb's autopkgtest on s390x:
https://autopkgtest.ubuntu.com/results/autopkgtest-
kinetic/kinetic/s390x/t/targetcli-fb/20220830_075622_04113@/log.gz
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-rtslib-fb/+bug/1988366/+subscriptions
More information about the Ubuntu-openstack-bugs
mailing list