Repository navigation
External SAN arrays for the multi-attach LUN mode: 11 vendor plugins, KMS-wrapped credentials - #1701
Merged
Merged
Conversation
Groundwork for storage-array plugins (provision/resize/delete LUNs): plugins
hold a credential reference and resolve it at call time; secrets never sit in
FoundationDB in clear.
- KMS: generic secret wrap/unwrap (wrap_secret/unwrap_secret) on all three
backends, with a context binding (array identity + endpoint) and an
embedded SHA-256 digest -- KMIP wraps with AES-CBC, so the digest is what
catches tampering there. ensure_key_encryption_key never replaces an
existing KEK (KMIP create was not idempotent).
- Vault: read_kv_secret for customer-managed KV v2 secrets; optional
credentials_cert_role so a separate Vault policy can cover credentials.
- KMIP: get_secret_data for customer-managed SecretData objects.
- simplyblock_core.credentials: CredentialProvider with managed refs
(wrapped under a per-cluster KEK) and external refs (Vault KV path, KMIP
SecretData UID), in-memory TTL cache, invalidate-on-auth-failure.
- LocalKMS (no external KMS) only encodes, so credentials are refused unless
the cluster opts in via allow_local_kms_credentials.
- cluster set: parse bool attributes explicitly; bool("false") was True.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e FlashArray adapter ArrayClient (credential resolution + re-auth retry, sb- naming, size rounding, idempotent create/map/unmap/delete, ownership + WWN checks), RestSession (TLS/CA bundle, retries, error mapping), lazy vendor registry, in-process vendor fakes + HTTPS mock server, shared contract suite with a live tier (SB_ARRAY_LIVE_CONFIG). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ten more adapters behind the ArrayAdapter contract, each with a stateful fake of the vendor REST API and vendor-specific tests: NetApp ONTAP, Dell PowerStore / PowerMax / PowerFlex, HPE WSAPI (Alletra MP, Primera, 3PAR), HPE Nimble (Alletra 5000/6000), IBM FlashSystem, Hitachi VSP, Huawei OceanStor Dorado, Infinidat InfiniBox. Framework follow-ups from integrating them: - Volume.wwn holds any SCSI designator (naa. or eui. for Nimble). - NVMe/FC initiators are NQNs, not WWPNs. - Capabilities.max_initiators_per_host (PowerFlex SDC hosts = 1). - Client pins resize/map/delete to the name derived from the recorded volume UUID (array ids and WWNs can be reused after delete, e.g. VSP). - RestSession.sleep is public (async job polling without real waits). - Fake transport fills the cookie jar like a real response. - Contract: delete_host must not drop live mappings (Pure now checks). Each adapter lists unverified API details under "Verify against a real system"; nothing has run against real hardware yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| except KMSException as e: | ||
| raise CredentialError(f"Storing credential failed: {e.message}") from e | ||
| logger.info("Stored managed credential (backend=%s, fields=%s, context=%s)", | ||
| backend, sorted(secret_fields), context) |
| _self_signed(host, certfile, keyfile) | ||
| ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) | ||
| ctx.load_cert_chain(certfile, keyfile) | ||
| server.socket = ctx.wrap_socket(server.socket, server_side=True) |
Plug the 11 storage_arrays adapters into the multi-attach array LUN mode of #1626 and move its array credentials onto simplyblock_core.credentials. Plugins (simplyblock_core/array/san.py): one ArrayPlugin per array family (pure-flasharray, netapp-ontap, dell-powerstore/-powermax/-powerflex, hpe-wsapi, hpe-nimble, ibm-flashsystem, hitachi-vsp, huawei-dorado, infinidat-infinibox), built in and declared as entry points. Ownership is encoded in the LUN name (sb-<cluster hash><lun hash>): SAN arrays have no tags, and every operation refuses another cluster's LUN. wwn is returned in the form lsblk reports. option `protocol` selects the host initiators. list_luns is not offered; cluster delete deletes the recorded LUNs. Host side: the agent reports its SAN initiators in /info (iSCSI IQN, FC WWPNs, NVMe host NQN, PowerFlex SDC GUID; /host/etc first on Kubernetes) and gets POST /scan_new_luns (SCSI host scan, NVMe namespace rescan). Node add and the attachment reconcile scan while they wait for a LUN; an agent without the endpoint is tolerated. WWN matching accepts naa.<hex>. Credentials: register_array no longer stores plaintext through kms.put_secret. Given credentials are wrapped by the cluster's credentials key (Vault Transit, KMIP, or the local KMS only with allow_local_kms_credentials), bound to array id + endpoint, and kept as Cluster.array_credential_ref; or credential_ref names an external Vault KV / KMIP secret that is only read. Arrays registered before keep working from their KMS path, which a re-registration removes. API/CLI: credential_ref / --credential-ref. CredentialProvider resolves the KMS connection per call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
schmidt-scaled
force-pushed
the
feat/array-credentials
branch
from
November 20, 2026 15:24
677a473 to
144ca37
Compare
| assert any(p.startswith(f"{prefix}/jobs/") for p in paths) | ||
| assert not any(p.startswith("/ConfigurationManager/v1/objects/ldevs") for p in paths) | ||
| finally: | ||
| client.close() |
| with pytest.raises(ArrayError): | ||
| client.get_info() | ||
| finally: | ||
| client.close() |
| client.create_volume(_uuid(), GIB) | ||
| assert 10 <= sum(sleeps) < 20 | ||
| finally: | ||
| client.close() |
| with pytest.raises(ArrayError, match="No free LDEV"): | ||
| client.create_volume(_uuid(), GIB) | ||
| finally: | ||
| client.close() |
| g = next(g for g in fake.groups.values() if g["name"] == "sbtest-vm") | ||
| assert g["mode"] == "VMWARE_EX" and g["modeOptions"] == [54, 63] | ||
| finally: | ||
| client.close() |
| with pytest.raises(ArrayError, match="no configured fc port"): | ||
| client.ensure_host(HostSpec(name="sbtest-fc", initiators=(FC_A,))) | ||
| finally: | ||
| client.close() |
| with pytest.raises(ArrayError, match="not locked"): | ||
| client.create_volume(_uuid(), GIB) | ||
| finally: | ||
| client.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Plug-in framework for provisioning LUNs / NVMe namespaces on external enterprise arrays (create, grow, delete, host mapping), plus the credential store that holds the array logins.
There is no usable cross-vendor standard (SMI-S deprecated, Swordfish barely implemented, CSI is Kubernetes-bound), so each array family gets its own REST adapter behind one contract.
Credentials (
simplyblock_core/credentials.py,simplyblock_core/kms/)array/<id>/<scheme>://<host>:<port>), so rewriting an array's endpoint in FDB cannot redirect its credential to another host.allow_local_kms_credentials).Array framework (
simplyblock_core/storage_arrays/)ArrayClientis the single entry point:sb-<uuid>naming, size rounding to array granularity, idempotent create/map/unmap/delete, and ownership checks before resize/map/delete (name prefix, name derived from the recorded volume UUID, recorded WWN/NGUID). Shrink is refused; deleting a host never drops a live mapping. One re-auth + retry on auth failure.RestSession: pinned CA bundle per array, timeouts, retries for idempotent calls, uniform error mapping.Adapters
Pure FlashArray, NetApp ONTAP, Dell PowerStore / PowerMax / PowerFlex, HPE WSAPI (Alletra MP, Primera, 3PAR), HPE Nimble (Alletra 5000/6000), IBM FlashSystem, Hitachi VSP, Huawei Dorado, Infinidat InfiniBox. Plain
requests, no vendor SDK dependencies.Integration with the multi-attach array LUN mode (#1626)
simplyblock_core/array/san.py: each adapter is anArrayPlugin(built in + entry points), usable withcluster set-array --plugin pure-flasharray .... Ownership is encoded in the LUN name (sb-<cluster hash><lun hash>), since SAN arrays have no tags; any operation on another cluster's LUN raisesForeignLunError. Optionprotocolpicks the initiators the hosts are registered with./inforeportssan_initiators(iSCSI IQN, FC WWPNs, NVMe host NQN, PowerFlex SDC GUID); newPOST /scan_new_luns(SCSI host scan + NVMe rescan). Node add and the attachment reconcile scan while waiting for a LUN.register_arrayno longer stores plaintext throughkms.put_secret. Credentials are wrapped by the cluster's KMS (KMIP now works; the local KMS needsallow_local_kms_credentials), bound to array id + endpoint, and kept asCluster.array_credential_ref. Orcredential_ref/--credential-refnames an external Vault KV / KMIP secret that simplyblock only reads. Registrations from before keep working and are migrated on re-registration.Testing
storage_arrays/testing/<vendor>.py), plugged intorequestsvia a transport adapter.python -m simplyblock_core.storage_arrays.testing --vendor <key>serves any fake as an HTTPS mock array.SB_ARRAY_LIVE_CONFIG=<file>runs the same contract suite against a simulator or real array.test_san_plugin.py: every plugin through the feat: erasure-coding resource floors; multi-attach array LUNs with fast takeover; array adapters #1626 plugin contract against its fake (multi-attach, fence/unfence, grow, delete, cross-cluster refusal).Not verified / follow-ups
🤖 Generated with Claude Code