Files
scadaproj/docs/plans/2026-11-19-prod-scadabridge-mxgw-install.md
T

41 KiB
Raw Blame History

PROD install: ScadaBridge + MxAccessGateway (plan, 2026-11-19)

State: PLAN + STAGED. Nothing has been executed on any prod box. 2026-11-19: the install pack (builds, configs, scripts, SQL) was copied to all four boxes over SMB only, at the owner's request; see docs/deploy/2026-11-19-prod-stage/. This is the first production tier for the family. Until now deployment.md said "no production box has been identified".

The DEPLOY HOLD still applies to PROD (owner, 2026-11-17). DEV and QA have both run the candidate builds with NAM AD login since 2026-11-19 (QA window approved that day). Every phase below that touches a prod box needs its own explicit owner go. LDAP settings for PROD: §3A (added 2026-11-19 after the DEV and QA cutovers).

0. RESUME HERE: run session planned for Sunday 2026-11-22

Written 2026-11-20 at the owner's request ("add a note so this plan can be picked up on sunday when i need to run it"). Read this section first, then the stage pack README (docs/deploy/2026-11-19-prod-stage/README.md), then the phase you are on.

0.1 Where things stand (end of 2026-11-20)

Item State
Builds Chosen and staged, byte-identical to QA: ScadaBridge 2e0ce81e (6c706b0a…), mxgw e74918cc (f0999b75…), Overview 818775b3 (25178c5c…), otelcol 0.162.0, Secrets CLI 0.6.6 (+ SQL build), nssm
On the boxes (SMB only) vp03/vp04: E:\psrem-stage\{prod-common,mxgw-e74918cc,sb-2e0ce81e,otel-54,overview-818775b3} + E:\ApiInstall\_tools\secret-0.6.6[-sql]; par-vp03/04: the same minus overview-*, the SQL files and the SQL CLI. Sizes verified per file; zips re-hashed by pull-back
Executed on any PROD box Nothing. No WinRM command has ever run there (not even winrm test); no service, KEK, secret, DB or firewall change
Pack source scadaproj docs/deploy/2026-11-19-prod-stage/ (commits bfc3690, cf447a8). Edit there, commit, re-push the one changed file + its SHA256SUMS.txt
LDAP decisions Settled (D-P5–D-P7, §3A.1): svc_igntadmin, HIST_ADMIN_PROD→Deployer, RequireHttpsCookie=false

0.2 Go / no-go before anything runs on Sunday

Ask the owner for each of these explicitly; none is implied by the staging requests.

  1. Remote exec on PROD (Q6). The winrm profiles vp03, vp04, parvp03, parvp04 (NAM\adm_dohertj2) exist, but the deploy-only WinRM scope still needs an explicit owner go for these boxes. Whether a corporate change ticket is required is also open. The security software tripped on WinRM before: batch on-box steps, stop at the first alert.
  2. The PROD deploy hold (2026-11-17) must be lifted for the phases you run.
  3. QA soak gate (Phase 1 step 4): Sunday is BEFORE it is met. The 3-working-day soak started 2026-11-19, so the earliest pass is 2026-11-24. Running Phases 3–6 on Sunday needs the owner to waive or shorten it, on the record. Check QA first (§0.4 step 1) either way.
  4. The mxgw repo script fix (Phase 1 step 1) is still unmerged. The staged Upgrade-MxGatewayService.ps1 and Install-MxGatewayService.ps1 are patched copies (marked PROD-STAGE PATCH), so a first install does not need the repo fix. Record that in the deploy record if the owner accepts it.

0.3 Inputs still missing (the install scripts refuse until each is supplied)

Needed for What Question Where it goes
Phase 3, 5 Q1 partly answered 2026-11-20 (owner file ScadaBridge/prod.txt): wondersqlpd.zmr.zimmer.com (= WONDER-SQL-VP03, SQL 2022 CU16), DB ScadaBridge, SQL login wwpdsbrw (db_datareader + db_datawriter, no DDL). The DB was pre-built by a DBA at 2026-11-20 09:37: all 46 tables, PKs, 27 FKs, defaults, computed columns and the AuditLog partition scheme match QA, all tables empty, but none of the 104 nonclustered/unique indexes, no __EFMigrationsHistory rows, no schema_version rows. As is, the central refuses to start (65 pending migrations) and the zbauth migrator's CREATE INDEX is denied. DML half DONE 2026-11-20 19:48Z as wwpdsbrw (sql\prod-app-dml-setup.sql: 65 history rows, both schema_version v1, seed ids 1–5, plus sb-role-mappings-prod.sql → _PROD ids 6–10). ⏰ REMINDER (scadaproj#59): the DBA still owes the 104 indexes → sql\prod-complete-dba-schema.sql (only its CREATE INDEX lines do anything now). Do not start the central until index count = 104. Still open: backup target Q1 value files ScadaBridge__Database__ConfigurationDb.txt and Secrets__SqlServer__ConnectionString.txt (User ID=wwpdsbrw; password from prod.txt, move it to the Keychain)
Phase 4 Prod Galaxy Repository SQL + alarm area Q2 MxGateway__Galaxy__ConnectionString.txt; replace __Q2_ALARM_EXPRESSION__ in mxgw.env (\\<GR node>\Galaxy!<area>)
Phase 6 SiteId Q8 replace __Q8_SITE_ID__ in both appsettings.Site.json.prod-*
Phase 2–6 Firewall: the §4 rows, incl. the Overview rows (5320; centrals → PAR 8084/5130) Q5 IT request; preflight-prod.ps1 shows open / refused / timeout per path
Phase 4 (PAR) WinPlatform deployed from the prod Galaxy onto par-vp03/04 (puts MXAccess there) Q3 gate: LmxProxy.dll 6000.0045.2657.1; until then install mxgw on vp03/vp04 only
Phase 0 T6 membership review of the _PROD groups; tell the Ignition team about svc_igntadmin — owner / IT

Generated on the day (in the Mac Keychain, never in chat, argv or files in the repo; delivered as ACL'd value files and deleted afterwards): ScadaBridge JwtSigningKey (≥ 32 chars) and ApiKeyPepper (one value each, shared by both centrals); mxgw ApiKeyPepper (one shared value for the PAR pair, pattern a; vp03/vp04 own values or shared, record the choice); site GrpcPsk and LocalDb__Replication__ApiKey (one value each, both site nodes, never equal to each other). nam-ldap-svc-password = the svc_igntadmin password from Keychain service btdb-manager/ldap (the value seeded on DEV and QA; §3A.4). The dohertj2 login probe password is Keychain winrm-cli/vq03. KEK files are generated on the box by the install scripts: scadabridge.kek on vp03 only, then carried to vp04 and both PAR boxes with -KekFrom.

0.4 Run order for Sunday (each step: dry run first, read it, then real)

  1. QA health check (no PROD box involved): QA Overview http://wonder-app-vq03.zmr.zimmer.com:5320, all cards Up; no LDAP bind failures in the QA OTel log export since 2026-11-19. If QA is unhealthy, stop.
  2. Phase 2 preflight, all four boxes (read-only): winrm ps <box> '& E:\psrem-stage\prod-common\preflight-prod.ps1 -SqlHost <Q1> -GrHost <Q2>'. Gates: rootca + LDAPS ok, greenfield paths/ports free, paths refused (not timeout), staged hashes ok. Optional: otel-54\Install-OtelCollector.ps1 -StageDir E:\psrem-stage\otel-54 -Tier PROD -NssmPath E:\psrem-stage\prod-common\nssm.exe.
  3. Phase 3 SQL — data rows DONE 2026-11-20; gate: scadaproj#59 closed (DBA indexes) before Phase 5. (DBA, DDL rights; wwpdsbrw has none): the DB already holds the tables, so run sql\prod-complete-dba-schema.sql (indexes + history + schema_version) → gate 65 migrations, 104 nonclustered indexes, LdapGroupMappings ids 1–5; re-run the QA-vs-PROD schema diff (2026-11-20 record) → 0 index differences; (sql\zbsecrets-schema-v1.sql is now redundant: zbsecrets already exists); sql\sb-role-mappings-prod.sql (DML, wwpdsbrw can run it) → 5 _PROD rows after ids 1–5; first backup.
  4. Phase 4 mxgw on vp03, then vp04: mxgw-e74918cc\install-mxgw.ps1 -Mode dry -ValuesDir <dir>, then -Mode real; prod-common\seed-secret-prod.ps1 -Target MxAccessGw -ValueFile <file>; nssm start MxAccessGw; §3A.5 checks; mint client keys (Q4). PAR boxes only after the Q3 gate.
  5. Phase 5 centrals: sb-2e0ce81e\install-sb.ps1 -Role Central -Mode dry|real -ValuesDir <dir> on vp03 (generates the KEK), then vp04 with -KekFrom; seed-secret-prod.ps1 -Target ScadaBridge-Central once on vp03; start vp03, wait for ready 200, start vp04; §3A.5 checks with dohertj2.
  6. Phase 8a Overview on vp03 and vp04: overview-818775b3\install-overview.ps1 -Mode dry, then -Mode real -Start.
  7. Phase 6 sites (needs Q8 + the 8083 paths): Site entity + SB-GRPC-PSK-<siteId> on central; install-sb.ps1 -Role Site on both PAR boxes with -KekFrom; start both together.
  8. Phases 7–8 (content, consumers, drills) are not for Sunday unless the owner says so.

Stop rules: the first LDAP service-account bind failure (§3A.5; svc_igntadmin is Ignition's account); any security-software alert; any timeout on a path the phase needs; any dry run that does not match the expected output. Rollback before Phase 7 step 5 = stop and disable the services (§5).

Records to write as you go: ScadaBridge/docs/deployment/deployment-records/<date>-wonder-app-vp03-vp04-par-vp03-vp04-2e0ce81e.md, mxgw docs/deploy/<date>-prod-e74918cc.md, and the scadaproj deploy folder (Overview, OTel, LDAP).

1. Target topology

Host Role ScadaBridge MxAccessGateway
wonder-app-vp03 Central A ScadaBridge-Central (UI/Management/Inbound API :8085, Akka :8081, central gRPC :8083) MxAccessGw :5120 gRPC / :5130 dashboard
wonder-app-vp04 Central B ScadaBridge-Central (same ports) MxAccessGw (same ports)
WONDER-PAR-VP03 Site node A ScadaBridge-Site (Akka :8082, gRPC :8083, health :8084) MxAccessGw (same ports)
WONDER-PAR-VP04 Site node B ScadaBridge-Site (same ports) MxAccessGw (same ports)

Overview dashboard (owner, 2026-11-20: "also deploy the dashboard and pre-configure it for the mxgateway and scadabridge clusters"): ZbOverview on :5320 on both centrals (app-vp03, app-vp04), each watching the same PROD registry: ScadaBridge central-a/b (:8085), site node-a/b (:8084), and the four mxgw dashboards (:5130). This is the QA pattern (one Overview per pair node). Not on the PAR boxes. Phase 8a.

This differs from QA. On QA, vq03/vq04 each run a central node and a site node. In prod the central pair and the site pair are on different boxes, and possibly on different network segments (app vs PAR). The central↔site gRPC control plane (:8083, both directions, PSK-authenticated) therefore crosses a network boundary for the first time. It is the main new risk in this install.

Decisions recorded (owner, 2026-11-19):

  • D-P1 mxgw on all four boxes. Each box needs AVEVA System Platform with MXAccess registered (LMXProxy.LMXProxyServer). The site pair's MxGateway connections use the PAR gateways. The purpose of the central-box gateways has to be confirmed (see Q4).
  • D-P2 builds: current main, promoted through QA first. ScadaBridge 2e0ce81e (includes #144/#145, which refuse zero-role logins) and mxgw e74918cc. Prod gets the same zips, byte-identical to the ones that soaked on QA.
  • D-P3 NAM AD over LDAPS from day one. This uses _PROD groups only. There is no GLAuth in prod. The settings and the secret handling are in §3A.
  • D-P5–D-P7 (owner, 2026-11-19): "same bind account. do same as qa for the others". PROD binds as svc_igntadmin like DEV and QA, maps UG_WW_HIST_ADMIN_PROD→Deployer as QA does, and runs RequireHttpsCookie=false as QA does (§3A.1).
  • D-P4 content: a signed config bundle from QA, limited to the machines selected for prod. Prod connections are re-pointed at the prod gateways, and prod mints its own inbound API keys.

2. Open questions (each blocks the phase noted)

# Question Blocks
Q1 Which SQL Server hosts the prod ScadaBridge ConfigDb? Who creates the DB and the scadabridge_svc login? Phase 3
Q2 Where is the prod Galaxy Repository (ZB DB) and its GR node, and which alarm area do the gateways subscribe to (\\<GR node>\Galaxy!<area>)? Phase 4
Q3 Partly answered over SMB (2026-11-19, read-only, table below). ⚠ The PAR boxes have no MXAccess. app-vp03/04 have a full Application Server install: ArchestrA\Framework\Bin holds 562 entries, including LmxProxy.dll. PAR-VP03/04 hold only 49 entries there, with no LmxProxy.dll; they carry OI Server, Historian Client and the common components. Reference: prod runtime node wonder-bd5-vp03 has MXAccess with aaEngine.exe and LmxProxy.dll 6000.0045.2657.1 (131 entries), byte-identical to vp03 and to QA vq03; that is the level the PAR boxes need. Owner, 2026-11-19: WinPlatform is not deployed to the PAR boxes yet. Deploying it from the prod Galaxy installs MXAccess there. So mxgw on PAR is gated on that deploy (an AVEVA/Galaxy step, outside this plan). Gate check over SMB: C$\Program Files (x86)\ArchestrA\Framework\Bin\LmxProxy.dll is present at 6000.0045.2657.1 (SHA prefix bd75a2fde222). Until then, mxgw cannot run on the PAR boxes: it needs a WinPlatform deployed to the box. The alternative is to point the site's MxGateway connections at the app-box gateways (see Q4). Still open: NSSM (none found under Program Files) and free disk. Phase 2, Phase 4
Q4 What consumes the gateways on app-vp03/04? ScadaBridge centrals don't talk to mxgw. If the answer is "nothing yet" (for example, a future OtOpcUa), install them but mint no client keys. Phase 4
Q5 Network: DNS resolved from the Mac on 2026-11-19 (table below). The centrals and the sites are on different subnets (10.220.153.x vs 10.201.75.x), so a firewall between them is likely. Find out whether one exists. See the port matrix in §4. Phase 0
Q6 Remote deploy from the Mac: the account is settled (below). Still open: whether WinRM 5985 and SMB 445 are open from the Mac to the four boxes, and whether a prod change needs a corporate change ticket. The security software tripped on WinRM before (2026-09-11). Every phase on a box

Hosts (DNS from the Mac, 2026-11-19):

FQDN IP
wonder-app-vp03.zmr.zimmer.com 10.220.153.205
wonder-app-vp04.zmr.zimmer.com 10.220.153.210
wonder-par-vp03.zmr.zimmer.com 10.201.75.86
wonder-par-vp04.zmr.zimmer.com 10.201.75.87

QA's vq03/vq04 sit on 10.220.158.x.

Remote-access account: QA and PROD boxes outside the wonder DEV/QA set need the admin account NAM\adm_dohertj2. NAM\dohertj2 gets STATUS_ACCESS_DENIED on the C$ share of the DNC QA/PROD boxes. That account is already in the winrm Keychain as profiles dnc-vq01 (dnc-app-vq01) and dnc-vp01 (dnc-app-vp01), both NTLM over HTTP 5985. The prod profiles are vp03, vp04, parvp03 and parvp04, as NAM\adm_dohertj2, with the password copied Keychain→Keychain from winrm-cli/dnc-vp01 (the same method used for sqlvd03). Whether adm_dohertj2 is a local admin on the wonder prod boxes is unverified.

SMB check (2026-11-19, winrm smb ls only, no remote exec):

  • NAM\adm_dohertj2 opens C$ and E$ on all four boxes, so it has admin-share rights. None of them has a D$ share.
  • No E:\ApiInstall exists yet on any box, so this is greenfield. Each box has E:\2023R2Install (AVEVA 2023 R2 media) and E:\Hotfixes. vp03's E: also holds ProdPromotions, ServiceIntegrations and Backups.
  • .NET: only 6.0.25 and 8.0.0, so the builds must be self-contained.
  • Program Files\Microsoft SQL Server is present on vp03 and parvp03. Whether those instances are what Q1/Q2 need is unverified.

DELMIA prod is dnc-app-vp01 (10.201.207.106). For Q8, that box is the prod Delmia caller of ScadaBridge's DelmiaRecipeDownload. Prod runs an older Downloader than QA (delmia project memory), so check the prod integration's shape before you assume it matches QA's. | Q7 | TLS: is there a corporate cert for the Central UI (HTTPS) and for the mxgw dashboard? Not a go-live gate for login: D-P7 runs plain HTTP with RequireHttpsCookie=false as on QA; a later cert flips it to true. LDAPS needs zimmer-rootca in the machine store (cutover-plan D4), and AllowInsecure=false in prod. DEV and QA already had the root CA (thumbprint 78D941D7…, exp 2036) and validated nam1/nam2 over TLS 1.3. | Phases 4–5 | | Q8 | Which machines (SAPIDs / Galaxy objects) go to prod on day one? What is the SiteId? Do the BTDB connection, MES and Delmia endpoints, and SMTP/EWS have prod equivalents? | Phase 7 | | Q9 | Will any machine be driven by two ScadaBridge stacks at once (QA and prod)? Prod writes to the real Galaxy. A machine moved to prod should be undeployed from QA, or QA must be on a different Galaxy. | Phase 7 |

3. Phases

Phase 0: approvals and external prerequisites (owner + IT, before any box work)

  1. Ticket T6 (nam_ad_requests.md §6), filed with IT:
    • A1P svc_zbmomww_prod: the LDAP lookup account, no lockout, read-only. Not a go-live gate (D-P5: PROD starts on svc_igntadmin); it replaces the interim on all three tiers later, under scadaproj#58;
    • A3P svc_zbmomww_auto_prod, if the owner allows PROD automation (plan D3);
    • G3 UG_WW_APP_DEPLOY_PROD. Not a go-live gate (D-P6: HIST_ADMIN_PROD→Deployer until it exists);
    • a membership review of UG_WW_APP_ADMIN_PROD, APP_IDE_PROD, APP_IDE_RO_PROD and BTMGR_RO_PROD. These groups were built for System Platform, so mapping them grants their members app roles in prod. Current members are in §3A.2. Also confirm no NAM group is named SCADA-* (ScadaBridge's seed rows). Tell the Ignition team before go-live: PROD adds the 4 mxgw stores and the ScadaBridge central store that reference their svc_igntadmin password, so a password change or lockout of that account now also breaks PROD logins on these apps (re-seed nam-ldap-svc-password in every store on a rotation).
  2. Extend scadaproj#58 for A1P (comment). File a cross-repo umbrella issue in scadaproj, plus a type:deploy-gate issue in ScadaBridge and in mxaccessgw, cross-linked.
  3. Firewall requests, from the §4 matrix.
  4. SQL (Q1): an empty ScadaBridge DB, the scadabridge_svc login as db_owner, and a backup target.
  5. Certificates (Q7).
  6. Access (Q6). If the Mac path is allowed, add winrm profiles vp03, vp04, parvp03 and parvp04 with Keychain credentials, then run an SMB-only reachability check (winrm smb ls). No remote exec before the owner's go.
  7. Owner go for QA promotion (Phase 1).

Phase 1: candidate builds proven on QA

  1. Fix mxgw scripts/deploy/Upgrade-MxGatewayService.ps1 first. nssm start returning SERVICE_START_PENDING makes it abort and auto-roll-back. The fix is the try/catch and the Wait-State already used on vd03 (memory note). Merge it to mxgw main. If it lands after e74918cc, the candidate SHA moves, and the build is re-proven on DEV first.
  2. Build once, then reuse the outputs for QA and PROD:
    • ScadaBridge Host and CLI: dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=false;
    • mxgw Server: self-contained win-x64;
    • mxgw x86 Worker on windev, at the same SHA (-p:Platform=x86 -p:SourceRevisionId=<sha>). The upgrade script refuses mixed SHAs. Record a SHA-256 for every zip.
  3. Deploy to QA with the existing 061432c8-style pack. ScadaBridge needs no migration (061432c8..2e0ce81e has no migration change; the schema stays at 65). mxgw rolls one box at a time.
  4. Soak on QA for at least 3 working days. The gates are the QA record's set: ready 200 ×4, one active per pair, MxGateway 2196/2196 good, LocalDb sync connected, and zero-role login refused (#144/#145 negative control).
  5. Optionally, do QA's NAM cutover before prod. Done 2026-11-19, in the same window as the QA deploy of these builds (record docs/deploy/2026-11-19-qa-nam-ldap/). The QA soak therefore covers NAM AD over LDAPS on the exact PROD candidates; it started 2026-11-19, so the 3-working-day gate is met on 2026-11-24 at the earliest.

Phase 2: box prep (all four, no service started)

  • Layout as on QA: E:\ApiInstall\{ScadaBridge,MxAccessGateway}\{app,cli|worker,data,logs}, with staging in E:\psrem-stage\<app>-<sha>\.
  • NSSM for mxgw. ScadaBridge services are created with sc.exe (installation guide), env in the service key Environment (REG_MULTI_SZ).
  • KEK folders C:\ProgramData\ZB\kek\ set to Administrators:F + SYSTEM:F, with inheritance off.
  • Inbound firewall rules on each box, per §4.
  • Optional, and recommended for parity: the ZbOtelCollector loopback collector (infra/otel-collector/wonder/).
  • Gate: SHA re-verified on each box, MXAccess COM registered (Q3), and the boxes resolve each other by the FQDN that the config will use.
  • LDAP gate (§3A), read-only, per box: nam1 and nam2 reachable on 636; zimmer-rootca in LocalMachine\Root; an LDAPS handshake to both validates with no policy errors (the QA preflight.ps1 steps 1–2). Stage the Secrets CLI 0.6.6 under E:\ApiInstall\_tools\secret-0.6.6\, plus the SQL-aware build on the centrals.

Phase 3: ConfigDb

  1. Generate a full, non-idempotent script from the empty DB to the last migration at the candidate SHA: dotnet ef migrations script 0 <last> --project src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase. QA learned that a full-history --idempotent script fails at batch compile.
  2. Review it, then run it with sqlcmd -I -b (QUOTED_IDENTIFIER, or the filtered indexes fail with Msg 1934) from a box that has sqlcmd, using the service login. Alternatively, a DBA runs it.
  3. Gate: 65 rows in __EFMigrationsHistory. (Correction 2026-11-19: zbauth and zbsecrets are not EF migrations; the apps create them at first start. zbsecrets is needed earlier, for the §3A.4 seed, so run the staged sql\zbsecrets-schema-v1.sql here; zbauth is left to the first central start.)
  4. First backup: COPY_ONLY, CHECKSUM, COMPRESSION + VERIFYONLY.
  5. Insert the _PROD role rows by SQL (§3A.3). Gate: the rows read back; ids 1–5 (SCADA-*) untouched.

Phase 4: MxAccessGateway ×4

Order: install on app-vp03/04 first, since MXAccess is already there. Install on PAR-VP03/04 only after the WinPlatform deploy puts MXAccess on them (Q3 gate). Until the PAR gateways exist, the site's MxGateway connection can point at the app-box gateways. That needs 5120 open from 10.201.75.x to 10.220.153.x. Afterwards, re-point the connection to the local PAR gateways as a normal connection edit and instance redeploy.

Use Install-MxGatewayService.ps1, always with -DryRun first, and review the masked env before the real run.

  • Environment Production, which requires login on. The LDAP env block and GroupToRole from §3A.3 go into the -EnvFile; delete GwAdmin/GwReader from the base appsettings.json before the first start.
  • Install without -Start, seed nam-ldap-svc-password (§3A.4), review the masked env, then start.
  • Fresh prod secrets on each box: ZB_SECRETS_MASTER_KEY, MxGateway__ApiKeyPepper. Nothing is copied from QA. Choose one of two patterns and record the choice: (a) Recommended: the PAR pair shares one pepper and one API-key store (QA's 2026-08-14 clone pattern), so one client token works on both site gateways; (b) independent stores, with a key per box.
  • Galaxy SQL and the alarm subscription per Q2. SqlitePath values are absolute and outside the content root.
  • Mint client keys: scadabridge-site-prod on the PAR gateways, plus whatever Q4 decides for the app boxes. Tokens go to the Keychain and to ScadaBridge's secret store, and nowhere else.
  • Gates: §3A.5 (dashboard login as dohertj2 → Administrator; bogus refused; no service-bind line); with the client token, galaxy-test-connection returns ok:true, and a session open/close works on each box; a bogus key gets a typed auth error; a worker session reports ready.

Phase 5: ScadaBridge central pair (vp03, vp04)

  • Config, per node:
    • Node:Role=Central, NodeHostname = the FQDN;
    • seed nodes self first (StartupValidator enforces it, with the same spelling as NodeHostname);
    • the ConfigDb connection string; Secrets:Store:Provider=SqlServer (one store shared by both centrals);
    • a shared JwtSigningKey (≥ 32 random characters), shared ASP.NET Data Protection keys, and an ApiKeyPepper;
    • NAM LDAPS: the §3A.3 block in each node's appsettings.Central.json, no Auth block, no LDAP env entry, RequireHttpsCookie=false (D-P7); the secret seeded once into the shared store before the first start (§3A.4);
    • roles come from the LdapGroupMappings rows inserted in Phase 3 (_PROD only, HIST_ADMIN_PROD→Deployer per D-P6; Administrator does not include Deployer);
    • downing leader-auto-down (the shipped default); OTLP to loopback if Phase 2 installed the collector. Start from the QA Central env key names (names only, never values) plus QA's appsettings shape. Write a per-node diff table before anything starts.
  • Recovery, as on QA: restart 5 s / 5 s / 10 s, reset 86 400, failureflag 1 (exit 75 recovers).
  • Bundle signing: generate the prod signing key (docs/operations/bundle-signing-runbook.md), add the QA exporter's fingerprint to the trust list, and turn RequireSignedBundles on (this is the production boundary the runbook describes).
  • Start order: vp03, wait for ready 200, then vp04.
  • Gates: ready 200 on both; active 200 on one node and 503 on the other; required-singletons healthy; bundle-signing-policy healthy; §3A.5 on the active central: dohertj2 in the UI, at /auth/token (role claims) and in the CLI (--url, --password-file), bogus refused, no service-bind line; then the same login against the other central after a failover drill in Phase 8. A zero-role user is refused at /auth/login, /auth/token and /management where §3A.5 item 4 has an account for it.

Phase 6: ScadaBridge site pair (PAR-VP03, PAR-VP04)

  • On the central: create the Site entity (SiteId per Q8), with GrpcNodeAAddress/GrpcNodeBAddress set to http://<PAR-VP0x FQDN>:8083. Write SB-GRPC-PSK-<siteId> through /admin/secrets.
  • Site config:
    • Role=Site, SiteId, seed nodes self first;
    • Communication:CentralGrpcEndpoints = both centrals' :8083; GrpcPsk = ${secret:SB-GRPC-PSK-<siteId>};
    • LocalDb:Replication:ApiKey byte-identical on both nodes; PeerAddress on one node only;
    • absolute paths for AuditLog:SiteWriter:DatabasePath and the LocalDb path (QA once found the site audit DB in System32).
  • Start the pair together, because a site pair cannot be rolled one node at a time.
  • Gates: ready 200 ×2; one node active; site online on the central health dashboard; LocalDb replicationConnected=true with backlog 0; a central→site command round-trip; the site's MxGateway connection to PAR-VP03 is connected.

Phase 7: content and first machines

  1. On QA, export a signed bundle containing only the selected templates, connections, inbound methods and db-connections (Q8).
  2. Import it on prod. Check that no key and no QA hostname came along: re-point each MxGateway connection to PAR-VP03:5120 primary and PAR-VP04 backup, the BTDB db-connection to prod, and any OPC UA connection.
  3. Mint inbound API keys on prod for MES and Delmia (inbound-api-key-reissue.md). Hand them over out of band.
  4. Undeploy the matching machines from QA, or confirm Q9 another way. Then deploy one machine first, during an idle window: verify attributes Good, alarms present, and one read-only inbound call (a {} body returns 400 VALIDATION_FAILED, which proves the key works). Then deploy the rest in batches.
  5. Point MES and Delmia at prod only after step 4 passes. This is the point of no return for consumers. Before it, rollback = stop the prod services.

Phase 8: drills and handover

  • Failover drills on idle machines only, copying the QA #116 procedure: on each pair, a kill drill and a stop-and-hold drill. Expected takeover is about 8 s for a kill and about 27 s for stop-and-hold.
  • Records:
    • ScadaBridge/docs/deployment/deployment-records/<date>-wonder-app-vp03-vp04-par-vp03-vp04-<sha>.md;
    • mxgw docs/deploy/<date>-prod-<sha>.md.
  • Docs to update: deployment.md (§1 inventory, §2.1 hosts, a new §7.2 PROD port map, §9), the CLAUDE.md index (on main, pushed), and the memory notes wonder-environment-tiers and nam-ldap-cutover-handoff.
  • Overview: decided 2026-11-20, see Phase 8a.

Phase 8a: Overview dashboard (vp03, vp04)

  • Build: QA's running 818775b3, byte-identical (copied from vq03's app\ minus the QA overlay and .bak files, zip sha256 25178c5c…), as with D-P2. main has ~20 later Overview commits (Theme 1.0.1 UI, the per-group leader fix scadaproj#43) that no wonder box runs yet; they would be promoted DEV → QA → PROD like any other build. The leader-chip bug in 818775b3 does not show here: the registry uses FQDNs and the Akka addresses use IPs, so chips show raw addresses (QA's documented behaviour).
  • Registry appsettings.Prod.json (ASPNETCORE_ENVIRONMENT=Prod): ScadaBridge central + site groups, MxAccessGateway ×4. Read at startup only; any registry change needs a ZbOverview restart.
  • Service: NSSM ZbOverview, virtual account NT SERVICE\ZbOverview (it holds no credentials, so it needs no LocalSystem), RX on E:\ApiInstall\Overview, Modify on logs\ + data\, auto start. Script install-overview.ps1 -Mode dry|real [-Start] in the stage pack.
  • Can go in any time after Phase 4 (until then every card is Down, which is harmless). The PAR mxgw cards stay Down until the Q3 WinPlatform deploy.
  • Gates: /health/ready 200 on both; ScadaBridge central shows one Active + one Standby, site the same; four mxgw cards (two Down until Q3).

3A. LDAP settings (NAM AD) for PROD

Login is on from the first start (D-P3). This section is the PROD form of the family cutover (2026-11-15-nam-ldap-cutover.md), which already ran on DEV and QA with these exact builds (records docs/deploy/2026-11-19-vd03-nam-ldap/ and docs/deploy/2026-11-19-qa-nam-ldap/). Differences from QA: PROD is greenfield, so there is no GLAuth config to replace, and the settings are written at install time, before the first start.

3A.1 Decisions

# Decision Recommendation
DECIDED (owner, 2026-11-19): "same bind account. do same as qa for the others".
# Decision Consequence
D-P5 Bind account: svc_igntadmin@nam.zimmer.com, the same interim account as DEV and QA. One Ignition-owned password (and one lockout) now spans DEV, QA, PROD and Ignition's own stack. Tell the Ignition team (Phase 0). When scadaproj#58 delivers A1P svc_zbmomww_prod, swap all three tiers together: re-seed nam-ldap-svc-password in every store, change ServiceAccountDn, rolling restart.
D-P6 ScadaBridge Deployer: UG_WW_HIST_ADMIN_PROD→Deployer (the QA interim) until UG_WW_APP_DEPLOY_PROD exists. HIST_ADMIN_PROD (4) is not the same as APP_ADMIN_PROD (5) on 2026-11-19: millerh5 is an Administrator who cannot deploy. Raise it in the T6 membership review. Swap the row when G3 exists (CLI, audited).
D-P7 Plain HTTP, RequireHttpsCookie=false on mxgw and ScadaBridge, as on QA. The auth cookie (and ScadaBridge's cookie-embedded JWT) travels in cleartext; both apps log a startup warning saying so. Recorded as a known gap until Q7 delivers certs; then HTTPS endpoints and true.

3A.2 Directory facts (2026-11-19 dump; re-verify in Phase 0)

Group Members ScadaBridge MxAccessGateway
UG_WW_APP_ADMIN_PROD 5 (chamalas, millerh5, marting4, dohertj2, Luis Bastidas) Administrator Administrator
UG_WW_APP_IDE_PROD 4 (chamalas, marting4, dohertj2, Luis Bastidas) Designer Viewer
UG_WW_APP_DEPLOY_PROD does not exist yet (G3) Deployer, once it exists —
UG_WW_APP_IDE_RO_PROD 1 (oswaltk) Viewer Viewer
UG_WW_BTMGR_RO_PROD 4 (benjamd2, marting4, oswaltk, Luis Bastidas) Viewer —
UG_WW_HIST_ADMIN_PROD 4 (chamalas, marting4, dohertj2, Luis Bastidas) Deployer (interim, D-P6) —

UG_WW_BTMGR_{BE,MC}_PROD and UG_WW_CITRIX_PROD are never mapped here (§4.2 rows wait for later). Each PROD deployment lists only _PROD groups; a _DEV/_QA name in a PROD config is a defect. The T6 membership review must finish before the mapping goes live: BTMGR_RO_PROD gives 4 people ScadaBridge Viewer.

Test identity: NAM\dohertj2 is in APP_ADMIN_PROD and APP_IDE_PROD, so it is the PROD login probe (expected roles: ScadaBridge Administrator+Designer+Deployer, as on QA; mxgw Administrator). Its password is in the Keychain as winrm-cli/vq03. adm_dohertj2 is the box-admin account for winrm/SMB only, never a login probe.

3A.3 The block (identical on every app; only the key prefix differs)

Setting Value
Enabled true
Server / Port / Transport uswap-vdc-nam1.nam.zimmer.com / 636 / Ldaps
FallbackServers[0] uswap-vdc-nam2.nam.zimmer.com:636
AllowInsecure false (needs zimmer-rootca in LocalMachine\Root; Phase 2 gate)
SearchBase DC=nam,DC=zimmer,DC=com
ServiceAccountDn svc_igntadmin@nam.zimmer.com (D-P5; A1P later, all tiers together)
ServiceAccountPassword ${secret:nam-ldap-svc-password}, never a literal
UserNameAttribute / DisplayNameAttribute / GroupAttribute sAMAccountName / name / memberOf
BindMode ServiceAccount

MxAccessGateway (×4): NSSM env, through Install-MxGatewayService.ps1 -EnvFile (the QA pattern; the upgrade script never writes the env, so it survives every redeploy):

MxGateway__Ldap__Enabled=true
MxGateway__Ldap__Server=uswap-vdc-nam1.nam.zimmer.com
MxGateway__Ldap__Port=636
MxGateway__Ldap__Transport=Ldaps
MxGateway__Ldap__AllowInsecure=false
MxGateway__Ldap__FallbackServers__0=uswap-vdc-nam2.nam.zimmer.com:636
MxGateway__Ldap__SearchBase=DC=nam,DC=zimmer,DC=com
MxGateway__Ldap__ServiceAccountDn=svc_igntadmin@nam.zimmer.com
MxGateway__Ldap__ServiceAccountPassword=${secret:nam-ldap-svc-password}
MxGateway__Ldap__UserNameAttribute=sAMAccountName
MxGateway__Ldap__DisplayNameAttribute=name
MxGateway__Ldap__GroupAttribute=memberOf
MxGateway__Ldap__BindMode=ServiceAccount
MxGateway__Dashboard__GroupToRole__UG_WW_APP_ADMIN_PROD=Administrator
MxGateway__Dashboard__GroupToRole__UG_WW_APP_IDE_PROD=Viewer
MxGateway__Dashboard__GroupToRole__UG_WW_APP_IDE_RO_PROD=Viewer
MxGateway__Dashboard__RequireHttpsCookie=false

Plus, in the base app\appsettings.json, delete MxGateway:Dashboard:GroupToRole (GwAdmin/GwReader) before the first start: configuration merges the file map with the env map, so the GLAuth names would otherwise stay mapped. The upgrade script carries the edited file forward on later upgrades.

ScadaBridge Central (×2): app\appsettings.Central.json, section ScadaBridge:Security:Ldap (the QA shape; each node's file is written separately, never copied over the other), with no Auth block (DisableLogin / AllowOutsideDevelopment absent) and ScadaBridge:Security:RequireHttpsCookie=false (D-P7). No ScadaBridge__Security__Ldap__* env entry: an env password would override the ${secret:} reference. Sites have no login and get no LDAP settings.

ScadaBridge role rows, in dbo.LdapGroupMappings (the central database, not config). With login on from the first start nobody can sign in until they exist, so insert them by SQL after Phase 3 with the idempotent script docs/deploy/2026-11-19-vd03-nam-ldap/sb-role-mappings.ps1 retargeted to these rows: UG_WW_APP_ADMIN_PROD→Administrator, UG_WW_APP_IDE_PROD→Designer, UG_WW_APP_IDE_RO_PROD→Viewer, UG_WW_BTMGR_RO_PROD→Viewer, UG_WW_HIST_ADMIN_PROD→Deployer (D-P6; APP_DEPLOY_PROD replaces it later). Later changes go through the CLI (audited). The migration seeds five SCADA-* rows (ids 1–5); they grant nothing unless a NAM group with that exact name exists, which Phase 0 checks (LdapProbe -g 'SCADA-*' returns none).

3A.4 The secret, before the first start

Each app's pre-host expander fails closed on a missing ${secret:}, so nam-ldap-svc-password must be in the store before the service is started for the first time:

Store Where How
mxgw ×4 each box's Secrets__SqlitePath (absolute, outside the content root), KEK per that service's env Install-MxGatewayService.ps1 without -Start, then seed-secret.ps1 (the QA one; it reads the store path and KEK from the service env), then start
ScadaBridge centrals the shared SQL Server store (zbsecrets, Secrets:Store:Provider=SqlServer), once the SQL-aware Secrets CLI build (the headless 0.6.6 CLI writes SQLite only; QA finding 2). Both centrals must hold the same KEK file (check the hash on both)

The value goes Keychain → 0600 temp file → SMB → ACL'd file → CLI stdin → deleted; read back and compared on the box. It is never on argv, in chat or in a log. Use the Secrets CLI 0.6.6 (stdin); 0.6.2 stores "-" literally.

3A.5 Verification and stop rule (after each app's first start)

  1. Anonymous GET / → 302 /login.
  2. A bogus user is refused, with no system-side / service-bind line in the log.
  3. dohertj2 signs in with the expected roles (ScadaBridge: cookie, /auth/token claims, and the CLI over HTTP Basic against the active central; mxgw: dashboard).
  4. Zero-role refusal: needs a NAM account the operator controls that is in no _PROD group. If there is none, rely on the DEV/QA proofs of #144/#145 and say so in the record.
  5. Logs: the app's own log or the ZbOtelCollector export if Phase 2 installed it (HG-style empty app logs happened on DEV).

Stop at the first service-account bind failure (svc_igntadmin is Ignition's account: ask IT for its lockout state before any retry), not the second. No LDAP DC-failover drill (blocking nam1 or pointing at a closed port) and no ad-hoc firewall rules for testing (owner, 2026-11-19, for the DEV/QA cutover; carried over here). The §4 inbound rules are a separate, planned change.

3A.6 Rollback

PROD is greenfield until Phase 7 step 5, so an LDAP problem before then means: stop the service, fix the env, file or rows, start again. There is no GLAuth to fall back to and none is installed.

4. Port and firewall matrix (to request in Phase 0)

From To Port Purpose
vp03 ↔ vp04 each other 8081 TCP Central Akka remoting
PAR-VP03 ↔ PAR-VP04 each other 8082 TCP Site Akka remoting
PAR-VP03 ↔ PAR-VP04 each other 8083 TCP (h2c) LocalDb sync stream (rides the site gRPC listener)
PAR-VP0x vp03, vp04 8083 TCP (h2c) Site → CentralControlService
vp03, vp04 PAR-VP0x 8083 TCP (h2c) Central → SiteCommandService, streaming, audit pull
PAR-VP0x (Site) PAR-VP03/04 5120 TCP ScadaBridge MxGateway adapter
vp03, vp04 prod SQL 1433 TCP ConfigDb, Secrets, zbauth
all four GR node SQL 1433 TCP mxgw Galaxy browse (Q2)
vp03, vp04, all mxgw nam1/nam2 636 TCP NAM LDAPS
users, MES, Delmia vp03, vp04 8085 (or 443 with TLS) Central UI, Management, Inbound API
admins all four 5130 mxgw dashboard
users, admins vp03, vp04 5320 Overview dashboard
vp03, vp04 (Overview) PAR-VP03/04 8084, 5130 Overview health probes (site /health/*, mxgw /health/*)
vp03, vp04 (Overview) each other 8085, 5130 Overview health probes
central and site SMTP or EWS 587 / 443 Notifications, if in scope
Mac (deploy) all four 5985, 445 WinRM deploy scope + SMB (only if Q6 allows)

The LocalDb sync row is verified: the rig's site-a-node-a uses PeerAddress: http://scadabridge-site-a-b:8083, the existing site gRPC listener.

5. Rollback

  • Before Phase 7 step 5, prod is greenfield. Rollback = stop and disable the services. QA keeps serving every consumer.
  • After consumers are cut over, rollback = point MES and Delmia back at QA, and redeploy the moved machines on QA. The .bak folders and DB backup follow the same pattern as QA (binaries + COPY_ONLY backup per window).
  • Every later prod upgrade uses the QA pack pattern: stop both sites, stop both centrals, migrate, swap, start the centrals, start the sites.

6. Risks

Risk Mitigation
The central↔site boundary (8083) is blocked or filtered in one direction only. QA never exercised it, because it was co-located Phase 0 firewall ticket; Phase 6 round-trip gate in both directions
One machine driven by two stacks (Q9) Undeploy from QA before the prod deploy
_PROD groups grant wider access than intended T6 membership review before mapping
A service-account lockout or password change breaks every app on every tier, and Ignition D-P5 accepted by the owner. Stop at the first bind failure (§3A.5); the Ignition team knows to warn before a rotation; A1P (#58) later removes the coupling
${secret:nam-ldap-svc-password} missing at first start (the expander fails closed and the service will not boot) Seed before the first start (§3A.4); install mxgw without -Start
A _DEV/_QA group name in a PROD config grants lower-tier admins PROD roles §3A.2 rule; review the env file and the role rows against §3A.3 before the start
The mxgw upgrade script aborts on a slow start Phase 1 step 1 fix
The security software flags remote exec Q6. Batch the on-box steps into a few scripts per phase, and stop at the first alert