Part 3: Three Shared-Storage Designs in Two Weeks, and the Brownfield Firewall Bug Hiding Underneath
The Storage Architecture Dilemma: Pivoting from ANF to Azure Files NFS
1. Picking Up Where We Left Off
At the end of Part 2, our Control Plane was in good shape. The Ubuntu Deployer ran Terraform and Ansible with no friction, the User-Assigned Managed Identity held only the least-privilege roles it needed, and Azure Bastion tunnels gave operators access without exposing a single public IP. The Deployer VNet (10.x.100.0/25) was peered to the vendor's brownfield workload network.
That gave us a way to reach the SAP virtual machines. It didn't give them anywhere to share files.
In Part 1 we summed up shared storage as Gotcha #3: Azure NetApp Files (ANF) wasn't available, so we set NFS_provider = "AFS" and moved on. That's an accurate summary of where we ended up. It skips over how we got there. Between 29 December 2025 and 14 January 2026 we went through three shared-storage architectures, raised a change request against the vendor's landing-zone code, hit two Ansible mount bugs, and only weeks later found a Terraform bug in SDAF's own storage module that quietly locked our HANA server out of its NFS shares.
This article walks through that sequence and explains the reasoning behind each decision.
2. Why SAP Needs Shared POSIX Filesystems
A distributed SAP NetWeaver / S/4HANA system isn't a set of independent servers. Several directories have to be identical and writable across hosts, with POSIX semantics (UID/GID ownership, file locking, symbolic links):
| Mount Point | Purpose | Who Mounts It | Consequence If Missing |
|---|---|---|---|
/sapmnt/<SID> | SAP kernel executables, instance profiles, global configuration (DEFAULT.PFL) | ASCS, ERS, PAS, AAS | Instances can't start; SWPM aborts at the profile phase |
/usr/sap/trans | Transport Management System (TMS) directory: cofiles, data files, logs | All application servers in the transport domain | Transports can't be imported or released between DEV → QAS → PRD |
/usr/sap/install | Staged SAP installation media (SWPM, kernel, HANA, export DVDs) | Every host that runs an installer | Ansible playbooks 03–07 can't find media |
/hana/shared | HANA binaries and trace/config for scale-out | HANA nodes (shared only in scale-out / HSR setups) | Scale-out nodes can't join the landscape |
For SDAF, this is more than documentation. The Ansible role roles-sap-os/2.6-sap-mounts reads three required parameters from sap-parameters.yaml: sap_mnt, sap_trans, and usr_sap_install_mountpoint. It mounts them according to the NFS_provider value (ANF, AFS, or NONE). Without a working NFS provider, the 8-stage installation pipeline (covered in Part 6) stops at stage 02.
NOTE
What does not belong on NFS here: HANA's performance-critical /hana/data and /hana/log volumes. On Azure these go on Premium SSD (with Write Accelerator on M-series) or ANF. Azure Files NFS is not a supported target for HANA data/log. In our single-node DEV system they stayed on striped Premium SSD managed disks, which is the subject of Part 7.
3. The Surprise Roadblock: indonesiacentral Has No ANF
The original blueprint was the standard SAP-on-Azure reference design: Azure NetApp Files for every shared volume. ANF gives sub-millisecond latency, snapshots, cross-zone replication, and first-class SDAF support (NFS_provider = "ANF").
On 29 December 2025, the first attempt to create a NetApp account failed immediately:
textThe provided location 'indonesiacentral' is not available for resource type'Microsoft.NetApp/netAppAccounts'
This wasn't a quota we could request an increase for. The resource provider wasn't deployed in the region at all. indonesiacentral is one of Azure's newer regions, and service availability arrives there in waves. The error listed the nearest ANF regions:
| Nearest ANF Region | Approx. Distance | Implication |
|---|---|---|
southeastasia (Singapore) | ~900 km | Lowest latency option, but cross-region |
eastasia (Hong Kong) | ~3,300 km | Unsuitable |
australiaeast (Sydney) | ~5,700 km | Unsuitable |
Why "just use Singapore" was rejected
Mounting /sapmnt across a region boundary would have:
- Added WAN round-trip latency to every file operation. That includes
sapstartsrvreading profiles, work processes writing to/usr/sap/trans, and SWPM extracting thousands of small files. - Added cross-region data-transfer charges for every byte of media and transport traffic.
- Undermined the reason for deploying in
indonesiacentralin the first place. That decision was about data residency and latency to Indonesian users.
Why waiting was rejected
There was no published date for ANF in the region. Holding the SAP build for an unknown hardware rollout would have blocked the Ansible pipeline, the BOM media staging (Part 5), and everything downstream. The project needed shared storage this week, not at some unannounced point in the future.
4. Detour #1: The VM-Hosted NFS Server (NFS_provider = NONE)
Our first fallback, decided the same day (STORAGE_DECISION.md), was the cheapest and fastest option we could think of:
- DEV/QAS: Turn the existing application server (
erpdevapp1) into an NFS server using local LVM volumes (/dev/vg_sap/lv_sapmnt,/dev/vg_sap/lv_usrsapinstall). - Production (planned): A self-built two-node NFS HA cluster (Pacemaker + DRBD + Azure Standard Load Balancer + Azure Fence Agent) across Availability Zones 1 and 3.
The cost comparison at the time made the custom cluster look attractive:
| Option | Est. Monthly Cost | Setup Effort | HA | Region |
|---|---|---|---|---|
ANF (cross-region, southeastasia) | ~$3,000 | ~2 hours | ✅ | Singapore |
| Azure Files Premium NFS | ~$300–350 | ~2 hours | ✅ (ZRS) | indonesiacentral |
| Custom Pacemaker/DRBD NFS cluster | ~$400 | 2–3 days + ongoing ops | ✅ | indonesiacentral |
The DEV exports were simple enough:
text# /etc/exports on erpdevapp1 (10.x.1.x)/export/sapmnt 10.x.1.0/24(rw,no_root_squash,sync,no_subtree_check)/export/saptrans 10.x.1.0/24(rw,no_root_squash,sync,no_subtree_check)/usr/sap/install *(rw,sync,no_wdelay,no_root_squash)
It ran into problems within 24 hours.
Bug A: Misnamed and missing SDAF parameters
Microsoft's SDAF documentation lists three mandatory NFS parameters. Our first sap-parameters.yaml had one right, one misnamed, and one missing:
yaml# BEFORE # AFTERNFS_provider: NONE NFS_provider: NONEsap_mnt: 10.x.1.x:/export/sapmnt sap_mnt: 10.x.1.x:/export/sapmntsap_transport: 10.x.1.x:/export/saptrans sap_trans: 10.x.1.x:/export/saptrans # renamedusr_sap_install_mountpoint: 10.x.1.x:/usr/sap/install # added
SDAF doesn't validate unknown keys, so sap_transport was silently ignored. Nothing failed at parse time. The playbooks just behaved as if no transport share existed.
Bug B: The NFS server trying to mount itself
With the parameters fixed and defined globally in the Ansible inventory, Playbook 02 failed on the NFS server itself:
textTASK [roles-sap-os/2.6-sap-mounts : 2.6.0 AFS Mounts - sap_mnt (preparation)] ***fatal: [erpdevapp1]: FAILED! =>msg: Error mounting /saptmp: mount.nfs4: Operation not permittedfor 10.x.1.x:/export/sapmnt on /saptmp
The cause is in how the 2.6-sap-mounts role decides each host's role: if sap_mnt is defined, the host is treated as an NFS client. The role doesn't check whether the host is the server, so erpdevapp1 tried to NFS-mount its own export.
The fix was to scope the variables per inventory group instead of globally:
yaml# inventory: NFS client parameters only on the HANA host groupD01_DB:hosts:teldevhana:vars:node_tier: hanasap_mnt: "10.x.1.x:/export/sapmnt"sap_trans: "10.x.1.x:/export/saptrans"usr_sap_install_mountpoint: "10.x.1.x:/usr/sap/install"# D01_SCS / D01_PAS (erpdevapp1): no NFS vars, so the role mounts local LVs instead
That got the DEV pilot moving, but the remaining problems were clear:
- Single point of failure. Rebooting
erpdevapp1for kernel patches would freeze/sapmnton every other host (with ahardmount, processes block inDstate until the server comes back). - Inventory drift risk. Correct behaviour now depended on where variables were declared in the inventory. That's easy to break during a later refactor.
- The production plan was heavy. A Pacemaker/DRBD cluster is two more VMs to patch, a STONITH configuration to test, and a runbook the SAP Basis team would have to own permanently.
5. Architecture Comparison: ANF vs. Azure Files Premium NFS 4.1
Once the stopgap was running, we stepped back and compared the realistic managed options properly instead of relying on rough cost estimates:
| Dimension | Azure NetApp Files (Premium tier) | Azure Files Premium (NFS 4.1) |
|---|---|---|
Availability in indonesiacentral | ❌ Not available (Dec 2025) | ✅ Available |
| Protocol | NFSv3, NFSv4.1, SMB, dual-protocol | NFSv4.1 (no NFSv3 on Premium file shares) |
| Latency profile | Sub-millisecond | Low single-digit milliseconds |
| Performance model | Per capacity pool: ~64 MiB/s per provisioned TiB (Premium), ~128 MiB/s per TiB (Ultra) | Per share (provisioned v1): baseline IOPS = 3,000 + 1 × GiB; throughput ≈ 100 + 0.04 × GiB + 0.06 × GiB MiB/s; burst to ≥10,000 IOPS |
| Minimum footprint | Capacity pool commitment (TiB-granular) | 100 GiB per share |
| Billing | Provisioned pool size | Provisioned share size (not used capacity) |
| Redundancy | LRS within zone; cross-zone/cross-region replication as add-ons | Premium_LRS or Premium_ZRS (synchronous, 3 zones) |
| Supported SAP uses | /sapmnt, /usr/sap/trans, /hana/shared, /hana/data, /hana/log | /sapmnt, /usr/sap/trans, /usr/sap/install, /hana/shared. Not HANA data/log |
| Provisioning velocity | NetApp account → capacity pool → delegated subnet → volumes | Storage account → shares (minutes); no delegated subnet |
| Network model | Delegated subnet in the VNet (private IP) | Public endpoint restricted by VNet service-endpoint rules, or a Private Endpoint |
| SDAF support | NFS_provider = "ANF" | NFS_provider = "AFS" |
Plugging in our share sizes makes the performance numbers concrete. A 1,024 GiB install share gets a baseline of about 4,000 IOPS and ~200 MiB/s. That's plenty for extracting SAR archives into /usr/sap/install. A 128 GiB transport share gets about 3,100 IOPS and ~110 MiB/s. TMS traffic in DEV is a small fraction of that.
IMPORTANT
The decision: We didn't need ANF's sub-millisecond latency, because HANA data and log weren't going on NFS. We did need same-region placement, zone redundancy, zero cluster maintenance, and native SDAF support. Azure Files Premium NFS 4.1 provided all four for roughly a tenth of the cross-region ANF estimate, and without the two to three days of build time (plus ongoing ownership) the Pacemaker/DRBD cluster would have needed.
6. Detour #2: Proving AFS by Hand (4 January 2026)
Before changing any SDAF Terraform, we wanted evidence that Azure Files NFS would actually mount from the vendor's subnets. We wrote two Deployer-side helper scripts.
6.1 Discovering the subnets of running VMs (get_subnet_ids_for_nfs.sh)
In a brownfield landing zone, the subnet a VM is actually attached to matters more than what the design document says. The helper resolves it from the NIC:
bash# get_subnet_ids_for_nfs.sh (excerpt)for VM_NAME in erpdevapp1 teldevhana; doVM_ID=$(az vm list --query "[?name=='$VM_NAME'].id | [0]" -o tsv)NIC_ID=$(az vm show --ids "$VM_ID" --query 'networkProfile.networkInterfaces[0].id' -o tsv)SUBNET_ID=$(az network nic show --ids "$NIC_ID" --query 'ipConfigurations[0].subnet.id' -o tsv)echo "$VM_NAME -> $SUBNET_ID"done
6.2 Creating the Premium FileStorage account (create_azure_files_nfs_manual.sh)
bash# create_azure_files_nfs_manual.sh (condensed)SUBSCRIPTION_ID="<your-subscription-id>"RESOURCE_GROUP="rg-sap-paas-shared"LOCATION="indonesiacentral"STORAGE_ACCOUNT_NAME="stsapnfsdev01"declare -A FILE_SHARES=( ["sapmnt"]="256" ["sap-trans"]="256" ["sap-install-media"]="500" )# 1. NFS requires the FileStorage kind on the Premium tier. StorageV2 won't do.az storage account create \--name "$STORAGE_ACCOUNT_NAME" --resource-group "$RESOURCE_GROUP" --location "$LOCATION" \--kind FileStorage --sku Premium_ZRS \--https-only false \--default-action Allow# 2. Create NFS-protocol sharesfor SHARE in "${!FILE_SHARES[@]}"; doaz storage share-rm create \--storage-account "$STORAGE_ACCOUNT_NAME" --resource-group "$RESOURCE_GROUP" \--name "$SHARE" --quota "${FILE_SHARES[$SHARE]}" --enabled-protocols NFSdone# 3. Lock down to the SAP subnets (this step turns out to be mandatory, see below)az storage account update --name "$STORAGE_ACCOUNT_NAME" --resource-group "$RESOURCE_GROUP" \--default-action Deny --bypass AzureServices Logging Metricsfor SUBNET_ID in "${ALLOWED_SUBNET_IDS[@]}"; doaz storage account network-rule add --account-name "$STORAGE_ACCOUNT_NAME" \--resource-group "$RESOURCE_GROUP" --subnet "$SUBNET_ID"done
6.3 What the manual run taught us
The first mount attempt failed, and the Azure Portal explained why:
"The storage account is currently not configured for use from a virtual network. The NFS protocol can only be used from a machine inside of a virtual network."
That gave us a checklist of Azure Files NFS requirements that aren't obvious from the CLI defaults:
| Requirement | Setting | Why |
|---|---|---|
| Account kind | FileStorage on Premium_LRS / Premium_ZRS | NFS shares exist only on Premium FileStorage accounts |
| Secure transfer | https_traffic_only = false | NFS 4.1 on Azure Files is not wrapped in HTTPS; with secure transfer enforced, mounts are refused |
| Network default action | Deny | NFS uses network identity rather than keys, so Azure insists the account be VNet-restricted |
| Subnet service endpoint | Microsoft.Storage on each client subnet | Required for the VNet rule to match traffic from that subnet |
| VNet rules | Every client subnet's ARM ID | Unlisted subnets get access denied by server |
| Shared key | Irrelevant to NFS | NFS 4.1 here uses sec=sys (UID/GID), not storage keys |
With those settings in place, the test mount from erpdevapp1 succeeded:
bashsudo mount -t nfs -o noresvport,vers=4,minorversion=1,sec=sys \stsapnfsdev01.file.core.windows.net:/stsapnfsdev01/sapmnt /mnt/test-nfsdf -h /mnt/test-nfs# Filesystem Size Used Avail Use% Mounted on# stsapnfsdev01.file.core.windows.net:/stsapnfsdev01/sapmnt 256G 0 256G 0% /mnt/test-nfs
6.4 Respecting the vendor boundary
The landing zone already contained a shared-services storage account, but the vendor had built it as Standard / StorageV2 with SMB shares. Rather than editing vendor code ourselves (it's an external boundary, per Part 1), we sent the landing-zone team a written change request (TERRAFORM_CHANGES_FOR_AFS_NFS.md) listing what NFS needs:
| Vendor Module Setting | Current | Required for NFS |
|---|---|---|
account_tier | Standard | Premium |
account_kind | StorageV2 | FileStorage (immutable, so this means a new account) |
access_tier | Hot / TransactionOptimized | Not applicable on Premium (null) |
blob_properties | Configured | Must be conditional (FileStorage has no blob service) |
Share protocol | SMB | NFS |
network_rules.default_action | Allow | Deny + virtual_network_subnet_ids |
WARNING
account_kind can't be changed in place. Converting an existing StorageV2 account to FileStorage forces Terraform to destroy and recreate it, data included. Ask for a new account name so the switch is side-by-side and reversible.
The manual account unblocked the pilot in under an hour. It also showed that managing it by hand, outside Terraform, wasn't something we wanted to keep doing. The next step was to let SDAF own it.
7. The Final State: SDAF-Native Azure Files (NFS_provider = "AFS")
SDAF already supports AFS as a first-class provider. The ownership is split across two layers, which matters when you're debugging:
| Share | Created By (SDAF Layer) | Terraform Resource | Size Variable (Default) | Mounted At |
|---|---|---|---|---|
install | Workload Zone (sap_landscape) | azurerm_storage_account.install + azurerm_storage_share.install | install_volume_size (1024 GiB) | /usr/sap/install |
transport | Workload Zone (sap_landscape) | azurerm_storage_account.transport + azurerm_storage_share.transport | transport_volume_size (128 GiB) | /usr/sap/trans |
sapmnt | SAP System (sap_system/common_infrastructure) | azurerm_storage_account.sapmnt + azurerm_storage_share.sapmnt | sapmnt_volume_size | /sapmnt/<SID> |
The install and transport shares are landscape-wide: every SID in the workload zone shares one transport directory and one media cache. /sapmnt belongs to a single SID, so it's created with the system. All three accounts are FileStorage, Premium, ZRS, with https_traffic_only_enabled = false and enabled_protocol = "NFS".
7.1 Workload Zone configuration
In DEV-IDCE-SAP01-INFRASTRUCTURE.tfvars:
terraform# ============================================================================# NFS CONFIGURATION - Azure Files Premium# ============================================================================NFS_provider = "AFS" # Azure Files Premium with NFS 4.1# Optional overrides (SDAF defaults shown)# install_volume_size = 1024# transport_volume_size = 128# ============================================================================# NETWORK ACCESS: required for AFS NFS# ============================================================================use_private_endpoint = false # DEV: service endpoints instead of PEsuse_service_endpoint = true # adds Microsoft.Storage SE to subnetspublic_network_access_enabled = true # public endpoint, but...enable_firewall_for_keyvaults_and_storage = true # ...default_action = Deny + VNet rules
And in the SAP System DEV-IDCE-SAP01-D01.tfvars:
terraformNFS_provider = "AFS" # Consume install/transport from the Workload Zone, create /sapmnt here
The Workload Zone run on 14 January 2026 created the install and transport accounts and returned their NFS paths as outputs. Those outputs flow automatically into the generated sap-parameters.yaml:
textinstall_path = "devidcesap01install<rnd>.file.core.windows.net:/devidcesap01install<rnd>/install"saptransport_path = "devidcesap01transport<rnd>.file.core.windows.net:/devidcesap01transport<rnd>/transport"
NOTE
A connection to Part 1: that first successful run actually produced names like devunknsap01install…. The UNKN was the region code SDAF fell back to before we patched deploy_utils.sh to map indonesiacentral to IDCE. Storage account names are global and built from that prefix, which is one more reason to fix region codes before creating stateful storage. Renaming a storage account means recreating it.
7.2 What Ansible does with it
In Playbook 02, the 2.6.0-afs-mounts.yaml task file takes over. Our run logs show the sequence on both d01scs00l… (ASCS/PAS) and d01dhdb00l… (HANA):
- Temporarily mounts the
sapmntshare at/saptmp, creates the per-SID directory tree (/sapmnt/D01,ASCS00,ERS01), then unmounts. - Mounts
installat/usr/sap/installon all nodes. - Mounts
sapmntat/sapmnt/D01on non-HANA nodes (or every node in a single-server layout). - Mounts
transportat/usr/sap/transonscs,ers,pas, andapptiers only. - On HANA nodes, writes an AFS-specific sysctl block to
/etc/sysctl.d/ms-az.conf.
ini# BEGIN HANA AFS optimizations (written by SDAF 2.6.0)net.ipv6.conf.all.disable_ipv6 = 1net.ipv4.tcp_max_syn_backlog = 16348net.ipv4.conf.all.rp_filter = 0sunrpc.tcp_slot_table_entries = 128vm.swappiness=10# END HANA AFS optimizations
sunrpc.tcp_slot_table_entries = 128 is the important one. It raises the number of concurrent in-flight RPC requests per NFS TCP connection, which matters on Azure Files because each connection is limited to a fixed throughput.
8. Mount Parameters on SLES 15 SP5: What SDAF Actually Uses
Generic NFS tuning guides recommend all kinds of options. Here's what SDAF writes to /etc/fstab for AFS, taken from the role and our logs:
text# /usr/sap/install: large sequential reads/writes during media extractiondevidcesap01install<rnd>.file.core.windows.net:/devidcesap01install<rnd>/install /usr/sap/install nfs4 rw,hard,rsize=1048576,wsize=1048576,noresvport,actimeo=60,vers=4,minorversion=1,sec=sys 0 0# /usr/sap/trans and /sapmnt/D01devidcesap01transport<rnd>.file.core.windows.net:/devidcesap01transport<rnd>/transport /usr/sap/trans nfs4 noresvport,vers=4,minorversion=1,sec=sys 0 0
| Option | Meaning | Why It Matters on Azure Files |
|---|---|---|
vers=4,minorversion=1 | NFS 4.1 | The only NFS version Azure Files Premium supports |
sec=sys | AUTH_SYS (UID/GID) | No Kerberos; access control comes from the network rules plus POSIX permissions. UIDs for <sid>adm / sapsys must match across hosts, which SDAF enforces via sidadm_uid / sapsys_gid |
noresvport | Use a non-privileged source port on reconnect | Microsoft-recommended for Azure Files. Lets the client re-establish a dropped TCP connection on a new port after a front-end failover, instead of hanging |
hard | Retry I/O indefinitely | Prevents silent data corruption during transient outages. Processes wait instead of getting EIO |
rsize/wsize=1048576 | 1 MiB I/O size | Maximises throughput for SAR/ZIP extraction on /usr/sap/install |
actimeo=60 | Cache attributes for 60 s | Fewer GETATTR round-trips while walking large media trees |
proto=tcp | TCP transport | Implicit for NFS 4.1; Azure Files uses TCP port 2049 only |
TIP
nconnect is an option to evaluate, not a default. Azure Files NFS supports nconnect (multiple TCP connections per mount) on Linux kernels ≥ 5.3, and SLES 15 SP5's 5.14 kernel qualifies. nconnect=4 can raise single-client throughput a lot for parallel workloads such as large SWPM exports. We deliberately kept SDAF's defaults for DEV so our configuration stayed identical to upstream. Benchmark it before adding it to production fstab.
9. The Bug Underneath: Brownfield Subnets Missing from Storage ACLs
For a while, everything worked. Then, at the end of January, the workload zone was redeployed with the storage firewall enabled (enable_firewall_for_keyvaults_and_storage = true, replacing the more permissive setting used in early DEV runs). Shortly afterwards the HANA server could no longer mount /usr/sap/install:
textmount.nfs4: access denied by server while mountingdevidcesap01install<rnd>.file.core.windows.net:/devidcesap01install<rnd>/install
Inspecting the storage account showed only the Deployer subnet in its VNet rules:
bashaz storage account show --name devidcesap01install<rnd> --resource-group <workload-zone-rg> \--query "networkRuleSet.virtualNetworkRules[].virtualNetworkResourceId" -o tsv# .../virtualNetworks/<deployer-vnet>/subnets/DeployerSubnet <-- only this one
9.1 Root cause #1: defined vs. exists
SDAF models every subnet with two booleans in run/sap_landscape/transform.tf:
terraformsubnet_db = {id = var.db_subnet_arm_iddefined = length(var.db_subnet_arm_id) > 0 ? false : length(var.db_subnet_address_prefix) > 0exists = length(var.db_subnet_arm_id) > 0}
| Scenario | db_subnet_arm_id | defined | exists |
|---|---|---|---|
| Greenfield (SDAF creates the subnet) | — | true | false |
| Brownfield (our case: ARM ID supplied) | Provided | false | true |
The storage network rules in terraform-units/modules/sap_landscape/storage_accounts.tf only check defined:
terraform# BEFORE: install, transport, witness and boot-diag accounts all share this patternvirtual_network_subnet_ids = compact([var.infrastructure.virtual_networks.sap.subnet_db.defined ? (var.infrastructure.virtual_networks.sap.subnet_db.exists ? var.infrastructure.virtual_networks.sap.subnet_db.id: azurerm_subnet.db[0].id) : null,# ... same for subnet_app ...length(local.deployer_subnet_management_id) > 0 ? local.deployer_subnet_management_id : null])
In a brownfield deployment defined is false, so the expression returns null, compact() removes it, and the subnet SDAF was told to use is silently left out of the firewall. The inner exists check, which was clearly meant for this case, is never reached. In the witness account the inner check also tests .defined twice, which looks like a copy-paste mistake.
The fix is a one-token change in the outer condition:
terraform# AFTER(var.infrastructure.virtual_networks.sap.subnet_db.defined ||var.infrastructure.virtual_networks.sap.subnet_db.exists) ? (var.infrastructure.virtual_networks.sap.subnet_db.exists ? var.infrastructure.virtual_networks.sap.subnet_db.id: azurerm_subnet.db[0].id) : null
9.2 Root cause #2: subnets_to_add_to_firewall_for_keyvaults_and_storage only applies to Key Vaults
In Part 1 we used subnets_to_add_to_firewall_for_keyvaults_and_storage to allow-list vendor subnets. Despite the name, the sap_landscape module only passes that list to the Key Vault network_acls. None of the four storage accounts use it. That explains why Key Vault access worked while NFS access didn't, even though both are configured by the same parameter.
9.3 Root cause #3: lifecycle { ignore_changes } hides the drift
The install account's azurerm_storage_account_network_rules resource also has:
terraformlifecycle {ignore_changes = [virtual_network_subnet_ids]}
This was probably added so that manual allow-list edits survive later terraform apply runs. The side effect is that fixing the module code doesn't repair accounts that already exist. The ACL is only computed correctly when the account is created. It's a one-way door, and it's a preview of the state-drift problems we cover in Part 4.
9.4 Remediation path
| Option | Action | Trade-off |
|---|---|---|
| 1. Patch the module (preferred, upstream issue raised) | defined || exists in all four accounts; concat subnets_to_add_to_firewall_for_keyvaults_and_storage into storage rules | Needs a fork until merged; existing accounts still need option 2 once |
| 2. Post-deploy CLI rule (what unblocked us) | az storage account network-rule add --subnet <db-subnet-arm-id> per account | Survives re-applies thanks to ignore_changes; lost if the account is recreated |
| 3. Private Endpoints | use_private_endpoint = true | Bypasses service-endpoint ACLs entirely; needs private DNS (privatelink.file.core.windows.net) to resolve in the brownfield VNet |
enable_firewall_for_keyvaults_and_storage = false | Not viable: NFS requires default_action = Deny anyway |
The workaround we scripted:
bash#!/bin/bash# Re-add brownfield workload subnets to every SDAF landscape storage accountWZ_RG="<workload-zone-rg>"SUBNETS=("/subscriptions/<your-subscription-id>/resourceGroups/rg-sap-network-dev/providers/Microsoft.Network/virtualNetworks/vnet-sap-workload-dev/subnets/ApplicationSubnet""/subscriptions/<your-subscription-id>/resourceGroups/rg-sap-network-dev/providers/Microsoft.Network/virtualNetworks/vnet-sap-workload-dev/subnets/DatabaseSubnet")for SA in $(az storage account list -g "$WZ_RG" --query "[].name" -o tsv); dofor SUBNET in "${SUBNETS[@]}"; doaz storage account network-rule add -g "$WZ_RG" --account-name "$SA" --subnet "$SUBNET" -o nonedoneecho "✓ $SA"done
CAUTION
The same .defined-only pattern may exist in the sap_system (the sapmnt account) and sap_library modules. If you run SDAF in a brownfield VNet, check the networkRuleSet of every storage account SDAF creates, not just the ones that are currently failing.
10. Shared Storage Verification Checklist
Run these checks after the Workload Zone and SAP System deployments, and before starting the Ansible pipeline:
| Stage | Command / Test | Acceptance Criteria |
|---|---|---|
| 1. Account shape | az storage account show -n <sa> --query "{kind:kind, sku:sku.name, https:enableHttpsTrafficOnly}" | FileStorage, Premium_ZRS, false |
| 2. Shares | az storage share-rm list --storage-account <sa> -g <rg> --query "[].{n:name,p:enabledProtocols,q:shareQuota}" | Protocol NFS, quota ≥ 100 GiB |
| 3. Firewall | az storage account show -n <sa> --query networkRuleSet.defaultAction | Deny |
| 4. VNet rules | ... --query "networkRuleSet.virtualNetworkRules[].virtualNetworkResourceId" | App, DB and Deployer subnets all present |
| 5. Service endpoints | az network vnet subnet show ... --query "serviceEndpoints[].service" | Includes Microsoft.Storage |
| 6. DNS & port | nslookup <sa>.file.core.windows.net && nc -zvw3 <sa>.file.core.windows.net 2049 | Resolves; TCP 2049 open |
| 7. In-guest mounts | ansible all -i inventory -m shell -a "df -hT -t nfs4" | /usr/sap/install on all; /sapmnt/D01, /usr/sap/trans on app tier |
| 8. Ownership | ls -ln /sapmnt/D01 on every host | Identical numeric UID/GID for d01adm:sapsys |
11. Summary & Key Takeaways
| Challenge | Anti-Pattern | What We Did |
|---|---|---|
| ANF missing in region | Mount ANF cross-region, or pause the project | Moved to Azure Files Premium NFS 4.1 in-region |
| Interim NFS server | Define NFS vars globally; let the server mount itself | Scoped vars per inventory group, then retired the VM-hosted NFS server |
| Production HA | Build and own a Pacemaker/DRBD NFS cluster | Premium_ZRS: synchronous 3-zone redundancy as a managed service |
| Vendor storage account | Edit vendor IaC directly, or convert StorageV2 in place | Formal change request; new FileStorage account side by side |
| NFS connectivity | Leave default_action = Allow and HTTPS-only on | Deny + service endpoints + VNet rules; https_traffic_only = false |
| Brownfield ACL bug | Assume subnets_to_add_to_firewall_… covers storage | Patched defined || exists; scripted network-rule add; audit every account |
| Mount tuning | Copy options from generic NFS blogs | Kept SDAF's tested options (noresvport, hard, 1 MiB I/O, actimeo=60); treat nconnect as a benchmarked opt-in |
The broader lesson is that in a new cloud region, a reference architecture tells you what to aim for, not what's actually available. The managed service you planned around may not exist yet, and the fallback you choose under pressure (a VM-hosted NFS server) creates its own problems. The final design came from evaluating requirements honestly. We didn't need sub-millisecond NFS, because HANA's hot data stayed on block storage. We did need zone-redundant, same-region, zero-maintenance shared files that SDAF could manage, and the cheaper managed option met all of those needs.
With shared storage working, the Workload Zone had been applied, destroyed, and re-applied several times during these two weeks. Each of those cycles left something behind in Terraform state and in Azure Key Vault's soft-delete bin.
Coming Up in Part 4:
Resolving Terraform State Drift & Key Vault Bugs in SDAF v2: Why redeploying a control plane triggers 409 Conflict errors from soft-deleted, purge-protected Key Vaults, how a keyvault variable-scoping bug broke metadata flow between SDAF modules, and how we reconciled drifted state with surgical terraform state operations and safe blob-lease recovery.
Comments