Topics: Agent Phases

Agent Phases

The FluxDeploy boot agent executes deployment phases in strict sequential order. Any fatal error halts the process immediately and reports the error code to the server.

Phase Sequence

Phase 1: WinPE Driver Loading

Load embedded WinPE drivers from X:\WinPEDrivers\ via drvload.exe. Once network connectivity is established, fetch additional drivers from the server if available.

Phase 2: Pre-Flight Checks

Validate deployment prerequisites:

  • Disk presence (at least one eligible local disk)
  • NIC detection (at least one enabled network adapter)
  • DHCP lease acquisition (60-second timeout)
  • Gateway ping (verify network path to server)

Phase 3: Agent Password

If the server requires a boot password, the agent prompts for it with masked input. The agent would honour an agentPassword field in agent.config.json if one were present, but no boot image builder writes one - the password is always typed by the technician. Skipped if the server does not require authentication.

Phase 4: Hardware Detection & Registration

Collect hardware information via WMI (Win32_PnPEntity, Win32_DiskDrive, Win32_ComputerSystem) and POST to /api/deployment/check-in. The server auto-assigns a recipe if only one is active. If multiple active recipes exist, a numbered selection menu is displayed.

Phase 5: Disk Selection

USB, FireWire, SD and MMC disks, and the disk the boot environment itself is running from, are never candidates. The remaining internal disks are ranked by bus - NVMe, then RAID/SAS, then SATA, then anything else - and largest first within a kind. A single eligible disk is selected automatically; otherwise the technician picks from the list - in unattended mode too, where the deployment console shows the machine is waiting for a disk choice. The ranking is the display order only; nothing is pre-selected. No answer within an hour, or an invalid one, halts with AMBIGUOUS_DISK and nothing is wiped.

Phase 6: Wipe Confirmation

Display the target disk (number, model, size, bus and serial) and require the operator to type yes (case-insensitive, 1-hour timeout). Unattended deployment needs two consents: a boot image built as unattended AND a recipe that allows unattended deployment (Recipes > Overview > Unattended deployment). With both, the agent shows a 30-second countdown naming the disk instead, and any key aborts with WIPE_ABORTED. With only the boot image's consent, the technician is asked as above.

Immediately before partitioning, the agent re-reads the disk list and stops with DISK_CHANGED if the selected disk number no longer has the same model, size and serial.

Phase 7: GPT Partitioning

Execute diskpart to create the GPT partition layout:

Partition Size Format Letter Purpose
ESP 100 MB FAT32 S: EFI System Partition
MSR 16 MB - - Microsoft Reserved
Windows Remainder NTFS W: Operating system
WinRE 750 MB NTFS R: Windows Recovery

Custom Steps: PreImaging

Execute any task sequence steps assigned to the PreImaging phase.

Phase 8: Image Application

  1. Stream the WIM from the server with progress reporting (throttled to every 10 MB)
  2. Verify SHA-256 hash against the expected value
  3. Apply the image via dism /Apply-Image /Index:{n} /ApplyDir:W:\ with progress streamed at 5% intervals

Phase 9: Boot Configuration

Run bcdboot W:\Windows /s S: /f UEFI /l {locale} to configure the UEFI boot entry.

Custom Steps: PostImaging

Execute PostImaging task sequence steps.

Phase 10: Secure Boot Detection

Detect and log the Secure Boot state. Informational only - does not affect deployment.

Custom Steps: PreDriverInjection

Execute PreDriverInjection task sequence steps.

Phase 11: Offline Driver Injection

Inject deployment drivers via dism /Image:W:\ /Add-Driver /Recurse per package in priority order (DriverPack > Storage > Chipset > Network > Video > Audio). Uses Manual or Auto mode based on the recipe's driver selection setting.

Custom Steps: PostDriverInjection

Execute PostDriverInjection task sequence steps.

Custom Steps: PreAnswerFile

Execute PreAnswerFile task sequence steps.

Phase 12: Answer File

Request the rendered unattend.xml from the server and write it to W:\Windows\Panther\unattend.xml.

Custom Steps: PostAnswerFile

Execute PostAnswerFile task sequence steps. Last opportunity for modifications before reboot.

FirstBoot Setup

Write FirstBoot task sequence steps to W:\FluxDeploy\FirstBoot\ with a master batch script. Register via offline RunOnce registry entry (reg.exe LOAD/ADD/UNLOAD on W:\Windows\System32\config\SOFTWARE).

Completion

POST /api/deployment/{id}/complete to the server, then execute wpeutil reboot to restart the machine into Windows.