docs(linux): resolve 4 open questions in Deploy plan (EFI, vdiskmanager, growpart, transport scope)
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
| `template/Deploy-LinuxBuild2404.ps1` | **Host** (PS) | Crea VM da cloud image VMDK, genera seed ISO cloud-init, avvia, aspetta SSH |
|
||||
| `template/Prepare-LinuxBuild2404.ps1` | **Host** (PS) | Copia + esegue setup via SSH, valida stato, prende snapshot |
|
||||
| `template/Setup-LinuxBuild2404.sh` | **Guest** (Bash) | Installa toolchain CI, dirs, hardening, gate finale |
|
||||
| `scripts/_Transport.psm1` | **Host** (PS) | Interfaccia comune WinRM/SSH per Invoke-CIJob e script CI |
|
||||
| `scripts/_Transport.psm1` | **Host** (PS) | Funzioni SSH-only per il branch Linux (WinRM esistente invariato per ora) |
|
||||
|
||||
Perche tre script separati (non tutto-in-uno): cloud-init copre solo il bootstrap OS
|
||||
(utente, SSH key, pacchetti base). Il toolchain CI e le validazioni per step sono piu
|
||||
@@ -66,10 +66,13 @@ Script host-side. Produce una VM pronta con cloud-init completato e SSH raggiung
|
||||
Non richiede installazione OS parte dal cloud VMDK pre-built.
|
||||
|
||||
- [ ] **Step 1 Validate prerequisites**
|
||||
- `vmrun.exe` presente nel path atteso
|
||||
- Parametro `-VMwareWorkstationDir` (default `C:\Program Files (x86)\VMware\VMware Workstation`) — stesso pattern di Deploy-WinBuild2025.ps1
|
||||
- `vmrun.exe` presente in `$VMwareWorkstationDir`
|
||||
- `vmware-vdiskmanager.exe` presente in `$VMwareWorkstationDir`
|
||||
(`$vdiskMgr = Join-Path $VMwareWorkstationDir 'vmware-vdiskmanager.exe'`)
|
||||
- SSH key `F:\CI\keys\ci_linux.pub` presente
|
||||
- Cartella destinazione VMX non gia occupata (o `-Force` per sovrascrivere)
|
||||
- (il VMDK viene gestito in Step 1b — nessun prerequisito manuale)
|
||||
- (il VMDK sorgente viene gestito in Step 1b — nessun prerequisito manuale)
|
||||
|
||||
- [ ] **Step 1b Download cloud VMDK se assente** (`F:\CI\ISO\` come cache locale)
|
||||
```powershell
|
||||
@@ -114,12 +117,16 @@ Non richiede installazione OS parte dal cloud VMDK pre-built.
|
||||
- Output: `F:\CI\Templates\LinuxBuild2404\cloud-init-seed.iso`
|
||||
|
||||
- [ ] **Step 4 Copia e ridimensiona cloud VMDK**
|
||||
- Copia `ubuntu-24.04-server-cloudimg-amd64.vmdk` `LinuxBuild2404.vmdk`
|
||||
- Ridimensiona a 40 GB: `vmware-vdiskmanager -x 40GB LinuxBuild2404.vmdk`
|
||||
- Copia `ubuntu-24.04-server-cloudimg-amd64.vmdk` → `LinuxBuild2404.vmdk`
|
||||
- Ridimensiona a 40 GB: `& $vdiskMgr -x 40GB LinuxBuild2404.vmdk`
|
||||
(stessa variabile `$vdiskMgr` di Deploy-WinBuild2025.ps1, valorizzata in Step 1)
|
||||
- Il resize avviene PRIMA del primo boot: l'immagine Ubuntu 24.04 ha i moduli
|
||||
cloud-init `growpart` + `resizefs` abilitati di default — espandono automaticamente
|
||||
la partizione root e il filesystem durante il primo avvio, senza `runcmd` aggiuntivi
|
||||
|
||||
- [ ] **Step 5 Genera .vmx**
|
||||
- `guestOS = "ubuntu-64"`, BIOS (cloud image Ubuntu compatibile entrambi;
|
||||
BIOS piu semplice per lab)
|
||||
- `guestOS = "ubuntu-64"`, `firmware = "efi"`
|
||||
(Ubuntu 24.04 cloud image usa GPT con partizione EFI; il boot sotto BIOS legacy fallirebbe)
|
||||
- NIC: `vmxnet3`, VMnet8
|
||||
- Disco: `LinuxBuild2404.vmdk` (scsi0:0)
|
||||
- CD-ROM secondario: `cloud-init-seed.iso` (connesso)
|
||||
@@ -308,18 +315,25 @@ Helper `assert_step()`: stampa `[OK] [Step N] desc` su successo, `exit 1` su fal
|
||||
- `swapon --show` vuoto
|
||||
- `sshd` attivo
|
||||
- `PasswordAuthentication no` in sshd_config
|
||||
- Root filesystem >= 38 GB (verifica che cloud-init `growpart` abbia funzionato):
|
||||
```bash
|
||||
df -BG / | awk 'NR==2{gsub("G","",$2); if ($2+0 < 38) {print "FAIL: root fs too small"; exit 1}}'
|
||||
```
|
||||
- Nessun installer residuo in `/tmp`
|
||||
|
||||
---
|
||||
|
||||
## Fase D Adattamento script CI
|
||||
|
||||
- [ ] **`scripts/_Transport.psm1`** nuovo modulo con interfaccia comune WinRM/SSH:
|
||||
- [ ] **`scripts/_Transport.psm1`** nuovo modulo SSH-only per il branch Linux.
|
||||
Gli script Windows esistenti NON vengono modificati ora; il refactoring WinRM e' rinviato.
|
||||
```powershell
|
||||
function Invoke-RemoteCommand { param($Target, $Command, [ValidateSet('WinRM','SSH')] $Transport, ...) }
|
||||
function Copy-RemoteItem { param($Source, $Dest, $Target, $Direction, $Transport, ...) }
|
||||
function Test-RemoteReady { param($Target, $TimeoutSec, $Transport, ...) }
|
||||
function Invoke-SshCommand { param($IP, $User, $KeyPath, $Command, ...) }
|
||||
function Copy-SshItem { param($Source, $Dest, $IP, $User, $KeyPath, [ValidateSet('ToGuest','FromGuest')] $Direction, ...) }
|
||||
function Test-SshReady { param($IP, $User, $KeyPath, $TimeoutSec, ...) }
|
||||
```
|
||||
Gli script CI (`Invoke-CIJob`, `Invoke-RemoteBuild`, `Get-BuildArtifacts`) chiameranno
|
||||
queste funzioni nel branch Linux senza toccare il branch WinRM esistente.
|
||||
|
||||
- [ ] **`scripts/Invoke-CIJob.ps1`** aggiungere parametro `-GuestOS Windows|Linux`
|
||||
- Auto-detect da VMX `guestOS` field se non fornito
|
||||
|
||||
Reference in New Issue
Block a user