FreeNAS/freenas bbdf864src/middlewared/middlewared/etc_files scst.conf.mako, src/middlewared/middlewared/plugins/failover_ event.py

NAS-140407 / 26.0.0-BETA.2 / Fix FC/iSCSI path availability during ALUA failover (by bmeagherix) (by bugclerk) (#18585)

Fixes FC/iSCSI path availability during HA failover when ALUA is
enabled.

Four independent problems caused paths to drop or I/O to fail during the
`dev_disk` -> `dev_vdisk` LUN swap window:

- **FC path death**: HA iSCSI session logout cascaded through SCST and
removed LUN mappings before the LUN swap, destroying the ALUA tgt_dev
filter and causing LUN NOT SUPPORTED on FC. Fixed by deferring
`reset_active` to after `become_active` has replaced all LUN mappings.

- **90-second global drain**: `activate_extents` wrote `active=1` via
sysfs, triggering `scst_suspend_activity(90s)`. Fixed by removing the
job entirely - `bind_alua_state=1` already handles dev_vdisk file-open
drain-free via `blockio_on_alua_state_change_finish`.

- **LUN replace blocks on in-flight commands**: `scst_acg_repl_lun`

    [34 lines not shown]
DeltaFile
+74-83src/middlewared/middlewared/plugins/iscsi_/scst.py
+16-66src/middlewared/middlewared/plugins/failover_/event.py
+4-66src/middlewared/middlewared/plugins/iscsi_/alua.py
+12-0src/middlewared/middlewared/etc_files/scst.conf.mako
+2-2tests/sharing_protocols/iscsi/test_262_iscsi_alua.py
+108-2175 files

FreeNAS/freenas 4923d94

Empty commit to create PR on github.

You should reset it
DeltaFile
+0-00 files

FreeNAS/freenas 23216fbsrc/middlewared/middlewared/etc_files scst.conf.mako, src/middlewared/middlewared/plugins/failover_ event.py

NAS-140407 / 27.0.0-BETA.1 / Fix FC/iSCSI path availability during ALUA failover (by bmeagherix) (#18576)

Fixes FC/iSCSI path availability during HA failover when ALUA is
enabled.

Four independent problems caused paths to drop or I/O to fail during the
`dev_disk` -> `dev_vdisk` LUN swap window:

- **FC path death**: HA iSCSI session logout cascaded through SCST and
removed LUN mappings before the LUN swap, destroying the ALUA tgt_dev
filter and causing LUN NOT SUPPORTED on FC. Fixed by deferring
`reset_active` to after `become_active` has replaced all LUN mappings.

- **90-second global drain**: `activate_extents` wrote `active=1` via
sysfs, triggering `scst_suspend_activity(90s)`. Fixed by removing the
job entirely - `bind_alua_state=1` already handles dev_vdisk file-open
drain-free via `blockio_on_alua_state_change_finish`.

- **LUN replace blocks on in-flight commands**: `scst_acg_repl_lun`

    [21 lines not shown]
DeltaFile
+74-83src/middlewared/middlewared/plugins/iscsi_/scst.py
+16-66src/middlewared/middlewared/plugins/failover_/event.py
+4-66src/middlewared/middlewared/plugins/iscsi_/alua.py
+12-0src/middlewared/middlewared/etc_files/scst.conf.mako
+2-2tests/sharing_protocols/iscsi/test_262_iscsi_alua.py
+108-2175 files

FreeNAS/freenas bb98768src/middlewared/middlewared/api/v27_0_0 zpool_create.py __init__.py, src/middlewared/middlewared/plugins/zpool create_impl.py crud.py

WIP
DeltaFile
+167-0src/middlewared/middlewared/plugins/zpool/create_impl.py
+72-0src/middlewared/middlewared/api/v27_0_0/zpool_create.py
+42-1src/middlewared/middlewared/plugins/zpool/crud.py
+2-0src/middlewared/middlewared/plugins/zpool/__init__.py
+1-0src/middlewared/middlewared/api/v27_0_0/__init__.py
+284-15 files

FreeNAS/freenas 1b81664src/middlewared/middlewared/api/v27_0_0 zpool_scrub.py __init__.py, src/middlewared/middlewared/plugins/pool_ scrub.py

WIP
DeltaFile
+87-45src/middlewared/middlewared/plugins/pool_/scrub.py
+111-0src/middlewared/middlewared/plugins/zpool/scrub.py
+29-0src/middlewared/middlewared/api/v27_0_0/zpool_scrub.py
+13-3src/middlewared/middlewared/plugins/zpool/query_impl.py
+7-0src/middlewared/middlewared/plugins/zpool/exceptions.py
+1-0src/middlewared/middlewared/api/v27_0_0/__init__.py
+248-486 files

FreeNAS/freenas e70c1fbsrc/middlewared/middlewared/plugins/zpool scrub_impl.py exceptions.py

add do_scan_action and exceptions
DeltaFile
+96-0src/middlewared/middlewared/plugins/zpool/scrub_impl.py
+59-1src/middlewared/middlewared/plugins/zpool/exceptions.py
+155-12 files

FreeNAS/freenas 7051018src/middlewared/middlewared/plugins/pool_ dataset.py dataset_encryption_info.py

Include internal datasets in encrypted dataset queries for unlock
DeltaFile
+4-1src/middlewared/middlewared/plugins/pool_/dataset.py
+1-1src/middlewared/middlewared/plugins/pool_/dataset_encryption_info.py
+5-22 files

FreeNAS/freenas cf4cf19src/middlewared/middlewared/alembic/versions/26.0 2026-03-27_16-24_container_name.py, src/middlewared/middlewared/migration 0019_container_name.py

Improve container name validation
DeltaFile
+58-0src/middlewared/middlewared/alembic/versions/26.0/2026-03-27_16-24_container_name.py
+45-0src/middlewared/middlewared/migration/0019_container_name.py
+12-2src/middlewared/middlewared/plugins/container/container.py
+1-1tests/api2/test_container.py
+116-34 files

FreeNAS/freenas da27646src/middlewared/middlewared/plugins/zpool crud.py

get rid of unnecessary function
DeltaFile
+9-19src/middlewared/middlewared/plugins/zpool/crud.py
+9-191 files

FreeNAS/freenas 6e2fb9csrc/middlewared/middlewared/plugins/zpool crud.py

remove superfluous comments
DeltaFile
+4-5src/middlewared/middlewared/plugins/zpool/crud.py
+4-51 files

FreeNAS/freenas 73f0ec2src/middlewared/middlewared/plugins/zpool crud.py

simplify
DeltaFile
+12-24src/middlewared/middlewared/plugins/zpool/crud.py
+12-241 files

FreeNAS/freenas 04c55b6tests/api2 test_300_nfs.py test_200_ftp.py

rm bulk tests
DeltaFile
+0-2,090tests/api2/test_300_nfs.py
+0-1,411tests/api2/test_200_ftp.py
+0-701tests/api2/test_011_user.py
+0-565tests/api2/test_audit_websocket.py
+0-495tests/api2/test_440_snmp.py
+0-488tests/api2/test_420_smb.py
+0-5,750259 files not shown
+0-31,553265 files

FreeNAS/freenas f3b0296src/middlewared/middlewared/api/v26_0_0 zpool_query.py, src/middlewared/middlewared/api/v27_0_0 zpool_query.py

better type annotations
DeltaFile
+53-5src/middlewared/middlewared/api/v26_0_0/zpool_query.py
+53-5src/middlewared/middlewared/api/v27_0_0/zpool_query.py
+0-1src/middlewared/middlewared/plugins/pool_/pool.py
+106-113 files

FreeNAS/freenas dcc0493tests/sharing_protocols/iscsi test_262_iscsi_alua.py

Fix test_failover_complex_alua_config: ALUA -> TPGS
DeltaFile
+2-2tests/sharing_protocols/iscsi/test_262_iscsi_alua.py
+2-21 files

FreeNAS/freenas 9b43668src/middlewared/middlewared/api/v26_0_0 zpool_query.py, src/middlewared/middlewared/api/v27_0_0 zpool_query.py

make zpool.query behave like pool.query
DeltaFile
+150-0tests/api2/test_zpool_query.py
+110-6src/middlewared/middlewared/plugins/zpool/crud.py
+3-3src/middlewared/middlewared/api/v27_0_0/zpool_query.py
+3-3src/middlewared/middlewared/api/v26_0_0/zpool_query.py
+266-124 files

FreeNAS/freenas b855532src/middlewared/middlewared/plugins/iscsi_ scst.py

Suspend iscsi-scstd logins during ALUA failover transition

During failover, iscsi-scstd may accept connections before its
configuration is fully applied, causing permanent rejections. Send
SIGUSR1 before the ALUA transition begins and SIGUSR2 after
clear_suspend completes, ensuring initiators that arrive in the window
receive a retriable error instead.
DeltaFile
+22-0src/middlewared/middlewared/plugins/iscsi_/scst.py
+22-01 files

FreeNAS/freenas 774448esrc/middlewared/middlewared/etc_files scst.conf.mako, src/middlewared/middlewared/plugins/failover_ event.py

NAS-140407 / 25.10.2.2 / Fix FC/iSCSI path availability during ALUA failover (#18568)

Fixes FC/iSCSI path availability during HA failover when ALUA is
enabled.

Four independent problems caused paths to drop or I/O to fail during the
`dev_disk` -> `dev_vdisk` LUN swap window:

- **FC path death**: HA iSCSI session logout cascaded through SCST and
removed LUN mappings before the LUN swap, destroying the ALUA tgt_dev
filter and causing LUN NOT SUPPORTED on FC. Fixed by deferring
`reset_active` to after `become_active` has replaced all LUN mappings.

- **90-second global drain**: `activate_extents` wrote `active=1` via
sysfs, triggering `scst_suspend_activity(90s)`. Fixed by removing the
job entirely - `bind_alua_state=1` already handles dev_vdisk file-open
drain-free via `blockio_on_alua_state_change_finish`.

- **LUN replace blocks on in-flight commands**: `scst_acg_repl_lun`

    [16 lines not shown]
DeltaFile
+52-83src/middlewared/middlewared/plugins/iscsi_/scst.py
+16-66src/middlewared/middlewared/plugins/failover_/event.py
+4-66src/middlewared/middlewared/plugins/iscsi_/alua.py
+12-0src/middlewared/middlewared/etc_files/scst.conf.mako
+84-2154 files

FreeNAS/freenas 912b435src/middlewared/middlewared/pytest/unit/utils test_disk_vpd_serial.py, src/middlewared/middlewared/utils/disks_ disk_class.py

NAS-139966 / 26.0.0-BETA.2 / Strip double-quote and backslash from VPD serial numbers (by Qubad786) (#18580)

## Problem

Disk serial numbers may contain special characters (e.g., double quotes
or backslashes) due to unusual hardware encodings. These characters were
not removed during serial sanitization and were propagated into Netdata
chart and dimension identifiers.

The presence of unescaped quote or backslash characters resulted in
malformed JSON output and downstream parsing errors when consuming
metrics.

## Solution

Extended the serial sanitization logic to also strip double-quote (`"`)
and backslash (`\`) characters. This guarantees that disk identifiers
passed to Netdata are always JSON-safe.


    [2 lines not shown]
DeltaFile
+9-6src/middlewared/middlewared/utils/disks_/disk_class.py
+3-2src/middlewared/middlewared/pytest/unit/utils/test_disk_vpd_serial.py
+12-82 files

FreeNAS/freenas e723c96src/middlewared pyproject.toml, src/middlewared/debian control

Replace pysnmp with truenas_pysnmp C extension for SNMP traps

Rewrites snmp_trap.py to use the truenas_pysnmp C extension and replaces
the python3-pysnmp4 dependency with python3-truenas-pysnmp.
DeltaFile
+23-104src/middlewared/middlewared/alert/service/snmp_trap.py
+2-2src/middlewared/debian/control
+1-1src/middlewared/pyproject.toml
+26-1073 files

FreeNAS/freenas 4440c24src/middlewared/middlewared/plugins failover.py, src/middlewared/middlewared/plugins/system product.py

WIP
DeltaFile
+39-44src/middlewared/middlewared/plugins/system/product.py
+26-35src/middlewared/middlewared/plugins/truenas/license.py
+42-2src/middlewared/middlewared/plugins/truenas/license_utils.py
+3-0src/middlewared/middlewared/plugins/failover.py
+110-814 files

FreeNAS/freenas c458448src/middlewared pyproject.toml, src/middlewared/debian control

Replace pysnmp with truenas_pysnmp C extension for SNMP traps

Rewrites snmp_trap.py to use the truenas_pysnmp C extension and replaces
the python3-pysnmp4 dependency with python3-truenas-pysnmp.
DeltaFile
+23-104src/middlewared/middlewared/alert/service/snmp_trap.py
+2-2src/middlewared/debian/control
+1-1src/middlewared/pyproject.toml
+26-1073 files

FreeNAS/freenas 75c638esrc/middlewared/middlewared/alembic/versions/26.0 2026-03-27_16-24_container_name.py, src/middlewared/middlewared/migration 0019_container_name.py

Improve container name validation
DeltaFile
+58-0src/middlewared/middlewared/alembic/versions/26.0/2026-03-27_16-24_container_name.py
+50-0src/middlewared/middlewared/migration/0019_container_name.py
+13-3src/middlewared/middlewared/plugins/container/container.py
+121-33 files

FreeNAS/freenas ce50172src/middlewared pyproject.toml, src/middlewared/debian control

Replace pysnmp with truenas_pysnmp C extension for SNMP traps
DeltaFile
+23-104src/middlewared/middlewared/alert/service/snmp_trap.py
+2-2src/middlewared/debian/control
+1-1src/middlewared/pyproject.toml
+26-1073 files

FreeNAS/freenas 1fbf75csrc/middlewared/middlewared/plugins/failover_ event.py

Comment out iscsi.scst.suspend_logins for now
DeltaFile
+2-2src/middlewared/middlewared/plugins/failover_/event.py
+2-21 files

FreeNAS/freenas da5f23csrc/middlewared/middlewared/etc_files scst.conf.mako, src/middlewared/middlewared/plugins/failover_ event.py

NAS-140407 / 25.10.2.2 / Fix FC/iSCSI path availability during ALUA failover (#18568)

Fixes FC/iSCSI path availability during HA failover when ALUA is
enabled.

Four independent problems caused paths to drop or I/O to fail during the
`dev_disk` -> `dev_vdisk` LUN swap window:

- **FC path death**: HA iSCSI session logout cascaded through SCST and
removed LUN mappings before the LUN swap, destroying the ALUA tgt_dev
filter and causing LUN NOT SUPPORTED on FC. Fixed by deferring
`reset_active` to after `become_active` has replaced all LUN mappings.

- **90-second global drain**: `activate_extents` wrote `active=1` via
sysfs, triggering `scst_suspend_activity(90s)`. Fixed by removing the
job entirely - `bind_alua_state=1` already handles dev_vdisk file-open
drain-free via `blockio_on_alua_state_change_finish`.

- **LUN replace blocks on in-flight commands**: `scst_acg_repl_lun`

    [16 lines not shown]
DeltaFile
+52-83src/middlewared/middlewared/plugins/iscsi_/scst.py
+16-66src/middlewared/middlewared/plugins/failover_/event.py
+4-66src/middlewared/middlewared/plugins/iscsi_/alua.py
+12-0src/middlewared/middlewared/etc_files/scst.conf.mako
+84-2154 files

FreeNAS/freenas 598a3bcsrc/middlewared/middlewared/pytest/unit/utils test_disk_vpd_serial.py, src/middlewared/middlewared/utils/disks_ disk_class.py

Strip double-quote and backslash from VPD serial numbers

(cherry picked from commit 373fce520aea2e368e1d218f9e910e284fbe9ccf)
DeltaFile
+9-6src/middlewared/middlewared/utils/disks_/disk_class.py
+3-2src/middlewared/middlewared/pytest/unit/utils/test_disk_vpd_serial.py
+12-82 files

FreeNAS/freenas 3f5a6d0src/middlewared/middlewared/pytest/unit/utils test_disk_vpd_serial.py, src/middlewared/middlewared/utils/disks_ disk_class.py

NAS-139966 / 27.0.0-BETA.1 / Strip double-quote and backslash from VPD serial numbers (#18579)

## Problem

Disk serial numbers may contain special characters (e.g., double quotes
or backslashes) due to unusual hardware encodings. These characters were
not removed during serial sanitization and were propagated into Netdata
chart and dimension identifiers.

The presence of unescaped quote or backslash characters resulted in
malformed JSON output and downstream parsing errors when consuming
metrics.

## Solution

Extended the serial sanitization logic to also strip double-quote (`"`)
and backslash (`\`) characters. This guarantees that disk identifiers
passed to Netdata are always JSON-safe.
DeltaFile
+9-6src/middlewared/middlewared/utils/disks_/disk_class.py
+3-2src/middlewared/middlewared/pytest/unit/utils/test_disk_vpd_serial.py
+12-82 files

FreeNAS/freenas 373fce5src/middlewared/middlewared/pytest/unit/utils test_disk_vpd_serial.py, src/middlewared/middlewared/utils/disks_ disk_class.py

Strip double-quote and backslash from VPD serial numbers
DeltaFile
+9-6src/middlewared/middlewared/utils/disks_/disk_class.py
+3-2src/middlewared/middlewared/pytest/unit/utils/test_disk_vpd_serial.py
+12-82 files

FreeNAS/freenas bfe955csrc/middlewared/middlewared/pytest/unit/utils test_disk_sysfs_properties.py

NAS-140429 / 27.0.0-BETA.1 / Add unit tests for disk class utils (#18577)

## Context

Add unit tests overing DiskEntry properties that read from sysfs.
DeltaFile
+391-0src/middlewared/middlewared/pytest/unit/utils/test_disk_sysfs_properties.py
+391-01 files

FreeNAS/freenas bca1171src/middlewared pyproject.toml

NAS-140427 / 26.0.0-BETA.2 / Fix deprecated license format in `pyproject.toml` (by creatorcary) (#18578)

Replace deprecated `license = {text = "BSD-3-Clause"}` TOML table format
with the plain SPDX string `license = "BSD-3-Clause"` in
`pyproject.toml`, per current setuptools/packaging standards.

This was causing the following warning on `make reinstall`:

```
* Building wheel...
/usr/lib/python3/dist-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated
!!

        ********************************************************************************
        Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0).

        This deprecation is overdue, please update your project and remove deprecated
        calls to avoid build errors in the future.


    [8 lines not shown]
DeltaFile
+1-1src/middlewared/pyproject.toml
+1-11 files