Comment 19 for bug 1939390

Revision history for this message
Nobuto Murata (nobuto) wrote :

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