fix: Correctly handle sg devices for iSCSI LUNs
This commit is contained in:
11
dist/adastra-vtl-installer/web-ui/api.php
vendored
11
dist/adastra-vtl-installer/web-ui/api.php
vendored
@@ -325,11 +325,18 @@ function addLun($params) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine backing store type
|
||||
$bstypeParam = '';
|
||||
if (strpos($device, '/dev/sg') === 0) {
|
||||
$bstypeParam = '--bstype sg'; // Use sg (passthrough) for generic scsi devices
|
||||
}
|
||||
|
||||
$command = sprintf(
|
||||
'sudo tgtadm --lld iscsi --mode logicalunit --op new --tid %d --lun %d --backing-store %s 2>&1',
|
||||
'sudo /usr/sbin/tgtadm --lld iscsi --mode logicalunit --op new --tid %d --lun %d --backing-store %s %s 2>&1',
|
||||
$tid,
|
||||
$lun,
|
||||
escapeshellarg($device)
|
||||
escapeshellarg($device),
|
||||
$bstypeParam
|
||||
);
|
||||
|
||||
$output = [];
|
||||
|
||||
Reference in New Issue
Block a user