EnsureCustomerVms
Orchestrates per-host VM provisioning during netsetup update. Dispatches each target VM to NixOS or Windows provisioning. Per-VM failures are captured and the final call throws NETSetupException listing failed VMs.
public static class EnsureCustomerVms
1. Methods
1.1. Classify(SystemManagement.Entities.Machine)
Classifies machine into a dispatch kind for provisioning.
public static VmProvisionKind Classify(SystemManagement.Entities.Machine machine)
| Name | Type | Description |
|---|---|---|
machine |
SystemManagement.Entities.Machine |
Returns: VmProvisionKind
1.2. Run(ISystemHost, NETSetupConfig, IServiceProvider)
Production facade — wired by UpdateMethods.RunProxmoxUpdate. Must invoke real deps: NETSetup.Helpers.EnsureNixosIso.EnsureNixosIsoOnProxmoxHost(ISystemHost,IFileProvider), Stages._5_NETSetupLinux.ProvisionNixosVm.Run, NETSetup.Stages._5_NETSetupLinux.ProvisionWindowsVmOnProxmox.Run(Host,osisa.SystemManagement.Entities.Machine,NETSetup.Entities.NETSetupConfig,ISystemHost,IServiceProvider) — NOT log stubs.
public static void Run(ISystemHost host, NETSetupConfig config, IServiceProvider services)
| Name | Type | Description |
|---|---|---|
host |
ISystemHost |
|
config |
NETSetupConfig |
|
services |
IServiceProvider |
1.3. RunCore(IReadOnlyList<SystemManagement.Entities.Machine>, Action, Action, Action<SystemManagement.Entities.Machine>, Action<SystemManagement.Entities.Machine>, Action<SystemManagement.Entities.Machine>, ILogger)
Testable core — delegates supply each external action so unit tests can stub them. Iterates orderedVms DC-first, dispatches by NETSetup.Helpers.EnsureCustomerVms.Classify(osisa.SystemManagement.Entities.Machine), logs + continues on per-VM failure, throws aggregate on any failure.
public static EnsureCustomerVmsResult RunCore(IReadOnlyList<SystemManagement.Entities.Machine> orderedVms, Action ensureNixosIso, Action ensureOpnsenseImage, Action<SystemManagement.Entities.Machine> provisionNix, Action<SystemManagement.Entities.Machine> provisionWindows, Action<SystemManagement.Entities.Machine> provisionOpnsense, ILogger logger)
| Name | Type | Description |
|---|---|---|
orderedVms |
IReadOnlyList<SystemManagement.Entities.Machine> |
|
ensureNixosIso |
Action |
|
ensureOpnsenseImage |
Action |
|
provisionNix |
Action<SystemManagement.Entities.Machine> |
|
provisionWindows |
Action<SystemManagement.Entities.Machine> |
|
provisionOpnsense |
Action<SystemManagement.Entities.Machine> |
|
logger |
ILogger |
Returns: EnsureCustomerVmsResult