tasks(iis-migration-to-ruvds): pause после failed-robocopy + ingest SMB-default finding
Temp admin (2026-05-23 09:37-18:08) начал импл iis-migration-to-ruvds, не закончил bootstrap, упал на UNC robocopy (exit 16) и dropped tree dirty. Session recovery: - secrets leak fix: `.secrets/ruvds-iis.env` → `pass show ruvds-iis/full-env` (etap-2 discipline restored). `.secrets/` + `*.env` + `*-log.txt` + `*-size.txt` added to `.gitignore` чтобы не повторилось. - root cause зафиксирован: TCP/445 closed по дефолту на fresh Win Server 2025 Core + SMB share не создан → UNC robocopy не работает без RUVDS bootstrap. - new concept `windows-server-2025-core-bootstrap.md` — default-blockers table + transfer-методов матрица (RDP-redirect / SMB / WinRM / SFTP) + bootstrap-чеклист 12 шагов. Recommendation = SMB inbound с source-IP whitelist. - task ⚪ → 🟡 paused с concrete next-step (capacity audit, transfer-method confirm, RUVDS bootstrap, backup source, recreate IIS sites + conn-string swap, pilot kupimknigi + DNS swap). - Open question raised: source 11 sites сумма vs RUVDS 30 GB HDD — capacity blocker possible (snolla одна 8.66 GB). Не push'нуто — ждёт user grant per project-discipline Rule 4. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
104
.wiki/concepts/windows-server-2025-core-bootstrap.md
Normal file
104
.wiki/concepts/windows-server-2025-core-bootstrap.md
Normal file
@@ -0,0 +1,104 @@
|
||||
---
|
||||
title: Windows Server 2025 Core — bootstrap для IIS-хоста (RUVDS-сценарий)
|
||||
status: live
|
||||
tags: [windows, iis, ruvds, bootstrap, smb, ops]
|
||||
related: [[iis-migration-2026-05-19-postmortem]], [[recovery-architecture-snapshot]], [[future-resilient-architecture-goals]]
|
||||
---
|
||||
|
||||
# Windows Server 2025 Core — bootstrap для IIS-хоста
|
||||
|
||||
Из коробки на RUVDS (2GB RAM, 30GB HDD, Win Server 2025 Core, RDP-only) машина **не готова** ни принимать файлы по SMB, ни хостить IIS — стандартный сценарий «купил, RDP'нулся, robocopy'нул» не работает. Документ фиксирует дефолтное состояние, default-blockers, и матрицу transfer-методов для переноса content'а с windows-recovery-host.
|
||||
|
||||
## Дефолтное состояние fresh Win Server 2025 Core
|
||||
|
||||
| Компонент | Дефолт | Нужно для IIS-host'инга |
|
||||
|---|---|---|
|
||||
| GUI / Server Manager desktop | нет (Core SKU) | PowerShell-only management |
|
||||
| IIS (Web-Server feature) | не установлен | `Install-WindowsFeature Web-Server -IncludeAllSubFeature -IncludeManagementTools` |
|
||||
| .NET Framework 4.8 | varies (бывает pre-bundled, бывает нет) | `Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\'` — Release ≥ 528040 |
|
||||
| URL Rewrite Module 2.1 | нет | download + `msiexec /i rewrite_amd64_en-US.msi /quiet` |
|
||||
| Defender Firewall inbound 80/443 | closed | `New-NetFirewallRule -DisplayName "HTTP" -Direction Inbound -Protocol TCP -LocalPort 80 -Action Allow` (+443) |
|
||||
| **SMB inbound 445** | **closed** | для UNC robocopy — открывать profile-specific rule |
|
||||
| **File and Printer Sharing service / share** | **off, no share** | для UNC robocopy — `Set-NetFirewallRule -DisplayGroup "File and Printer Sharing" -Enabled True -Profile Any` + `New-SmbShare` |
|
||||
| WinRM / PSRemoting | enabled (домен / private) | для PSSession-based transfer — verify `Enable-PSRemoting -SkipNetworkProfileCheck` |
|
||||
| RDP 3389 | open | работает из коробки |
|
||||
|
||||
## Гочa: UNC robocopy на fresh Core → exit 16
|
||||
|
||||
**Симптом:** `robocopy C:\sites\snolla\ \\<ruvds-ip>\sites\snolla\ *.* /S /E /DCOPY:DA /COPY:DAT /Z /MT:8 /R:2 /W:5` → `2026/05/23 18:08:29 ERROR 53 (0x00000035) Создание папки назначения … Не найден сетевой путь.`
|
||||
|
||||
**Root cause:** на RUVDS:
|
||||
1. TCP/445 закрыт в Defender Firewall (public profile по дефолту).
|
||||
2. SMB share `sites$` не создан (`Get-SmbShare` показывает только админскую `C$`, доступную только Administrator).
|
||||
3. Authentication через UNC требует Windows credentials — `net use \\<ip>\C$ /user:Administrator <pass>` сначала.
|
||||
|
||||
Проверка с source (windows-recovery-host):
|
||||
```powershell
|
||||
Test-NetConnection -ComputerName <ruvds-ip> -Port 445
|
||||
# TcpTestSucceeded : False ← вот корень
|
||||
```
|
||||
|
||||
## Матрица transfer-методов (source → RUVDS)
|
||||
|
||||
| Метод | Setup на RUVDS | Pros | Cons |
|
||||
|---|---|---|---|
|
||||
| **RDP local-drive redirection** | nothing — mstsc `/admin` → Local Resources → Drives → C: | zero-config, через 3389 (уже открыт) | drag-n-drop вручную, не batch; explorer-через-RDP slow для >1 GB; не подходит для 8 GB+ snolla |
|
||||
| **SMB inbound (recommended для batch)** | open FW 445 + `New-SmbShare -Name sites -Path C:\sites -FullAccess Administrator` + `net use` с source | robocopy native, /MT:8 параллелизм, resume через `/Z` | exposed SMB — должен быть либо в private network, либо VPN, либо source-IP firewall whitelist |
|
||||
| **WinRM PSSession + Copy-Item** | `Enable-PSRemoting`, добавить source IP в `TrustedHosts`, FW 5985/5986 | encrypted, не нужен SMB, скрипт-friendly | медленнее SMB на больших файлах; HTTP-default; HTTPS требует cert setup |
|
||||
| **SFTP** (OpenSSH server feature) | `Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0` + start sshd + FW 22 | works с любого Linux/Mac source; ключи безопасно | extra service surface; sshd default config иногда permissive |
|
||||
| **HTTP PUT через временный traefik+webdav** | overkill для bootstrap | reusable для последующих deploy'ев | сначала нужен IIS/nginx running — но IIS ещё не deployed → chicken-and-egg |
|
||||
|
||||
**Recommendation для IIS migration:** SMB inbound с source-IP whitelist. Самый быстрый для 11 sites × ~1 GB; native robocopy /Z поддерживает interrupt-resume; FW rule убирается после migration cutover.
|
||||
|
||||
```powershell
|
||||
# На RUVDS (RDP-сессия, PowerShell):
|
||||
Set-NetFirewallRule -DisplayGroup "File and Printer Sharing" -Enabled True
|
||||
New-NetFirewallRule -DisplayName "SMB-from-source" -Direction Inbound `
|
||||
-Protocol TCP -LocalPort 445 -RemoteAddress <source-public-ip> -Action Allow
|
||||
New-Item -ItemType Directory -Path C:\sites -Force
|
||||
New-SmbShare -Name sites -Path C:\sites -FullAccess Administrator
|
||||
```
|
||||
|
||||
Source-side (windows-recovery-host):
|
||||
```powershell
|
||||
net use \\<ruvds-ip>\sites /user:Administrator <pass>
|
||||
robocopy C:\sites\snolla \\<ruvds-ip>\sites\snolla *.* /S /E /DCOPY:DA /COPY:DAT /Z /MT:8 /R:2 /W:5
|
||||
net use \\<ruvds-ip>\sites /delete
|
||||
```
|
||||
|
||||
После cutover — `Remove-SmbShare -Name sites` + удалить FW rule.
|
||||
|
||||
## Bootstrap-чеклист (порядок)
|
||||
|
||||
1. RDP в RUVDS (3389 уже открыт, creds в `pass show ruvds-iis/full-env`).
|
||||
2. `Install-WindowsFeature Web-Server -IncludeAllSubFeature -IncludeManagementTools` — установить IIS.
|
||||
3. Verify .NET 4.8: `(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\').Release` ≥ 528040. Если нет — установить через RUVDS Server Manager (web) или offline-installer + RDP-drop.
|
||||
4. Install URL Rewrite 2.1: download `https://download.microsoft.com/.../rewrite_amd64_en-US.msi`, `msiexec /i ... /quiet`.
|
||||
5. Open FW 80/443: `New-NetFirewallRule -DisplayName "HTTP" -Direction Inbound -Protocol TCP -LocalPort 80,443 -Action Allow`.
|
||||
6. Open SMB rule (см. блок выше) — **только на время migration**.
|
||||
7. Verify external connectivity:
|
||||
- MSSQL: `Test-NetConnection mssql.kzntsv.site -Port 1433`
|
||||
- MinIO: `Test-NetConnection minio.kzntsv.site -Port 443` (если CMS pipeline остаётся на windows-host — не нужно; см. [[iis-cutover-to-vds-services]] §MinIO phase)
|
||||
8. Backup source IIS state с windows-recovery-host:
|
||||
```powershell
|
||||
& "$env:SystemRoot\system32\inetsrv\appcmd.exe" list site -config > C:\Users\vitya\sites-backup.txt
|
||||
Copy-Item C:\Windows\System32\inetsrv\config\applicationHost.config C:\Users\vitya\applicationHost.config.bak
|
||||
```
|
||||
9. Transfer 11 sites через robocopy/SMB (см. метод выше).
|
||||
10. Recreate sites через `appcmd add site` или `New-IISSite`, копировать bindings.
|
||||
11. Update Web.config conn-strings → `mssql.kzntsv.site,1433;TrustServerCertificate=True` (как в `[mssql-vds-migration]`).
|
||||
12. Pilot на kupimknigi.spb.ru через hosts-file DNS override, 24h soak, потом DNS A swap.
|
||||
|
||||
## Gotcha-fineprint
|
||||
|
||||
- **2GB RAM tight:** IIS + 11 worker pools = легко уйдёт в paging. Рекомендую установить `IIS:\AppPools\<name> -RecyclingPeriodicRestartMemory 200MB` per-pool + monitor через `Get-Counter '\Process(w3wp*)\Working Set'`.
|
||||
- **Windows Server 2025 Core нет explorer.exe:** drag-n-drop не работает в RDP без redirect drives — закладывай SMB или SFTP заранее.
|
||||
- **LE certs:** если IIS будет terminate'ить TLS напрямую — `win-acme` (wacs.exe) standalone-friendly на Core. Альтернатива — traefik-on-RUVDS перед IIS, но это лишняя layer для 11 sites.
|
||||
- **Backup strategy для RUVDS:** unsolved — RUVDS native snapshots = VDS-snapshot-level, не file-level. Daily rsync sites+IIS config → kreknin (расширить `vds-backup-rsync-kreknin` на источник RUVDS) — отдельная chore-task после успешного cutover.
|
||||
|
||||
## Cross-refs
|
||||
|
||||
- Driver для миграции: [[future-resilient-architecture-goals]] §Workshop pass 1 → IIS-track «вынести IIS с windows-recovery-host чтобы убрать SPOF домашней машины».
|
||||
- Vendor selection: `.tasks/windows-hosting-vendor-research.md` (🟢 closed 2026-05-22 — RUVDS выбран).
|
||||
- Mid-impl task: `.tasks/iis-migration-to-ruvds.md` (🟡 paused 2026-05-23 — этот концепт зафиксирован после failed-robocopy инцидента).
|
||||
- Source-host postmortem: [[iis-migration-2026-05-19-postmortem]] — что было при первой миграции снолла-recovery → нативный IIS.
|
||||
Reference in New Issue
Block a user