ProxmoxNodeIdentity
Derives the deterministic NIC MAC and the matching machine SerialNumber for a Proxmox node from its vmid. The serial is computed by the SAME netbase routine the WinPE guest uses (WindowsComputerHardware.BuildSerialNumberFromMacs), so the MapFile / online map key (the config machine serial) equals the serial the guest computes from its pinned NIC MAC. That alignment is what lets netsetup install find its config inside WinPE, where Win32_BIOS / Win32_BaseBoard serials are empty and the guest therefore falls back to the MAC-concat serial. Used by the reusable-ISO provisioning path (ProvisionWindowsVmOnProxmox) and the standalone Win11 node tests.
public static class ProxmoxNodeIdentity
1. Methods
1.1. DeriveMacAddress(int)
Deterministic unicast NIC MAC for vmId: Proxmox OUI + the vmid as the lower 3 octets. Proxmox vmid range fits in 6 hex, so there is no truncation or overflow.
public static MAC DeriveMacAddress(int vmId)
| Name | Type | Description |
|---|---|---|
vmId |
int |
Returns: MAC
1.2. DeriveSerialNumber(int)
Machine serial the WinPE guest will compute from the pinned NIC MAC. Calls the real netbase routine so the format is byte-identical to the guest’s own computation (uppercased, separators stripped, distinct, ordinal-sorted, truncated to 32 chars).
public static SerialNumber DeriveSerialNumber(int vmId)
| Name | Type | Description |
|---|---|---|
vmId |
int |
Returns: SerialNumber
1.3. TryGetVmIdFromSerial(SerialNumber, int)
Reverses DeriveSerialNumber(int): recovers the vmid encoded in a reusable-node serial. The reusable serial IS the guest-computed MAC-concat value (ProxmoxOui + vmid as 6 uppercase hex, no separators, e.g. "BC241100232B" for vmid 9003). Strips the OUI prefix and hex-parses the remaining 6 chars back to the vmid. Rejects any serial that is not exactly the shape this class emits (wrong length, wrong prefix, non-hex, or failing the round-trip guard), so non-reusable serials (real hardware, hosted "{vmid}@0") are cleanly refused. Guarantees TryGetVmIdFromSerial(DeriveSerialNumber(v), out var r) && r == v.
public static bool TryGetVmIdFromSerial(SerialNumber serial, out int vmId)
| Name | Type | Description |
|---|---|---|
serial |
SerialNumber |
|
vmId |
int |
Returns: bool