EnsureCustomerLxcs

Orchestrates per-host LXC provisioning during netsetup update. Currently dispatches PMG LXCs only (NixMail/NixDns are VMs handled by EnsureCustomerVms). Per-LXC failures are captured and the final call throws NETSetupException listing failed LXCs.

public static class EnsureCustomerLxcs

1. Methods

1.1. Classify(SystemManagement.Entities.Machine)

Classifies machine into a dispatch kind for LXC provisioning.

public static LxcProvisionKind Classify(SystemManagement.Entities.Machine machine)
Table 1. Parameters
Name Type Description

machine

SystemManagement.Entities.Machine

Returns: LxcProvisionKind

1.2. GetOrderedLxcsForHost(NETSetupConfig, SerialNumber)

Filters and orders machines from config whose serial suffix matches hostSerial AND classify as LXC targets (currently PMG).

public static IReadOnlyList<SystemManagement.Entities.Machine> GetOrderedLxcsForHost(NETSetupConfig config, SerialNumber hostSerial)
Table 2. Parameters
Name Type Description

config

NETSetupConfig

hostSerial

SerialNumber

Returns: IReadOnlyList<SystemManagement.Entities.Machine>

1.3. Run(ISystemHost, NETSetupConfig, IServiceProvider)

Production facade - wired by UpdateMethods.RunProxmoxUpdate. Resolves Proxmox from DI and invokes NETSetup.Stages._5_NETSetupLinux.ProvisionPmgLxc.Run(Host,osisa.SystemManagement.Entities.Machine,NETSetup.Entities.NETSetupConfig,ISystemHost) per matched machine.

public static void Run(ISystemHost host, NETSetupConfig config, IServiceProvider services)
Table 3. Parameters
Name Type Description

host

ISystemHost

config

NETSetupConfig

services

IServiceProvider

1.4. RunCore(IReadOnlyList<SystemManagement.Entities.Machine>, Action<SystemManagement.Entities.Machine>, ILogger)

Testable core - dispatches each LXC by NETSetup.Helpers.EnsureCustomerLxcs.Classify(osisa.SystemManagement.Entities.Machine), captures per-LXC failures, throws aggregate NETSetupException on any failure.

public static EnsureCustomerLxcsResult RunCore(IReadOnlyList<SystemManagement.Entities.Machine> orderedLxcs, Action<SystemManagement.Entities.Machine> provisionPmg, ILogger logger)
Table 4. Parameters
Name Type Description

orderedLxcs

IReadOnlyList<SystemManagement.Entities.Machine>

provisionPmg

Action<SystemManagement.Entities.Machine>

logger

ILogger

Returns: EnsureCustomerLxcsResult