For the record, lsscsi required additional apparmor policies, and here is the actual output.
[nova-compute.log]
2022-06-24 14:38:41.910 171033 ERROR oslo_messaging.rpc.server [req-2604a2be-8fb0-438c-9c3d-d74106458755 b2062b97055a415eb23484562f0d2fcf 4441eef28bf5454aa7c9cbdd101b9da3 - 66035521156a4f578f43d215ceaf0e7b 66035521156a4f578f43d215ceaf0e7b] Exception during message handling: oslo_concurrency.processutils.ProcessExecutionError: Unexpected error while running command. Command: tee -a /sys/bus/scsi/drivers/sd/None:None:None:None/rescan Exit code: 1 Stdout: '1' Stderr: "tee: '/sys/bus/scsi/drivers/sd/None:None:None:None/rescan': No such file or directory\n"
[running lsscsi by hand]
$ sudo -H -u nova aa-exec -p /usr/bin/nova-compute -- lsscsi -v list_sdevices: scandir: /sys/bus/scsi/devices: Permission denied SCSI mid level module may not be loaded
Jun 25 02:46:14 alert-glider kernel: audit: type=1400 audit(1656125174.802:5399): apparmor="DENIED" operation="open" profile="/usr/bin/nova-compute" name="/sys/bus/scsi/devices/" pid=937955 comm="lsscsi" requested_mask="r" denied_mask="r" fsuid=64060 ouid=0
[after adding /sys/bus/scsi/devices/ r]
$ sudo -H -u nova aa-exec -p /usr/bin/nova-compute -- lsscsi [2:0:0:0] disk LIO-ORG IBLOCK 4.0 -
-> the last column is empty.
Jun 25 02:49:56 alert-glider kernel: audit: type=1400 audit(1656125396.589:5406): apparmor="DENIED" operation="open" profile="/usr/bin/nova-compute" name="/dev/" pid=939829 comm="lsscsi" requested_mask="r" denied_mask="r" fsuid=64060 ouid=0
[after adding /dev/ r]
$ sudo -H -u nova aa-exec -p /usr/bin/nova-compute -- lsscsi [2:0:0:0] disk LIO-ORG IBLOCK 4.0 /dev/sda
-> the iSCSI device is detected.
$ ll /dev/disk/by-path/ | grep sda$ lrwxrwxrwx 1 root root 9 Jun 24 14:31 ip-192.168.151.128:3260-iscsi-iqn.2010-10.org.openstack:volume-f345d1e7-1326-4f7f-a0b9-ed40fe81432a-lun-0 -> ../../sda
https://review.opendev.org/c/openstack/charm-nova-compute/+/847582
For the record, lsscsi required additional apparmor policies, and here is the actual output.
[nova-compute.log]
2022-06-24 14:38:41.910 171033 ERROR oslo_messaging. rpc.server [req-2604a2be- 8fb0-438c- 9c3d-d741064587 55 b2062b97055a415 eb23484562f0d2f cf 4441eef28bf5454 aa7c9cbdd101b9d a3 - 66035521156a4f5 78f43d215ceaf0e 7b 66035521156a4f5 78f43d215ceaf0e 7b] Exception during message handling: oslo_concurrenc y.processutils. ProcessExecutio nError: Unexpected error while running command. scsi/drivers/ sd/None: None:None: None/rescan scsi/drivers/ sd/None: None:None: None/rescan' : No such file or directory\n"
Command: tee -a /sys/bus/
Exit code: 1
Stdout: '1'
Stderr: "tee: '/sys/bus/
[running lsscsi by hand]
$ sudo -H -u nova aa-exec -p /usr/bin/ nova-compute -- lsscsi -v scsi/devices: Permission denied
list_sdevices: scandir: /sys/bus/
SCSI mid level module may not be loaded
Jun 25 02:46:14 alert-glider kernel: audit: type=1400 audit(165612517 4.802:5399) : apparmor="DENIED" operation="open" profile= "/usr/bin/ nova-compute" name="/ sys/bus/ scsi/devices/ " pid=937955 comm="lsscsi" requested_mask="r" denied_mask="r" fsuid=64060 ouid=0
[after adding /sys/bus/ scsi/devices/ r]
$ sudo -H -u nova aa-exec -p /usr/bin/ nova-compute -- lsscsi
[2:0:0:0] disk LIO-ORG IBLOCK 4.0 -
-> the last column is empty.
Jun 25 02:49:56 alert-glider kernel: audit: type=1400 audit(165612539 6.589:5406) : apparmor="DENIED" operation="open" profile= "/usr/bin/ nova-compute" name="/dev/" pid=939829 comm="lsscsi" requested_mask="r" denied_mask="r" fsuid=64060 ouid=0
[after adding /dev/ r]
$ sudo -H -u nova aa-exec -p /usr/bin/ nova-compute -- lsscsi
[2:0:0:0] disk LIO-ORG IBLOCK 4.0 /dev/sda
-> the iSCSI device is detected.
$ ll /dev/disk/by-path/ | grep sda$ 168.151. 128:3260- iscsi-iqn. 2010-10. org.openstack: volume- f345d1e7- 1326-4f7f- a0b9-ed40fe8143 2a-lun- 0 -> ../../sda
lrwxrwxrwx 1 root root 9 Jun 24 14:31 ip-192.
https:/ /review. opendev. org/c/openstack /charm- nova-compute/ +/847582