fix: Correctly handle sg devices for iSCSI LUNs
This commit is contained in:
BIN
dist/adastra-vtl-installer-1.0.0.tar.gz
vendored
BIN
dist/adastra-vtl-installer-1.0.0.tar.gz
vendored
Binary file not shown.
2
dist/adastra-vtl-installer/VERSION
vendored
2
dist/adastra-vtl-installer/VERSION
vendored
@@ -1,4 +1,4 @@
|
||||
Adastra VTL Installer
|
||||
Version: 1.0.0
|
||||
Build Date: 2025-12-09 18:33:03
|
||||
Build Date: 2025-12-10 12:05:52
|
||||
Build Host: vtl-dev
|
||||
|
||||
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 = [];
|
||||
|
||||
@@ -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