feat(hypervisor): add optional explicit mac to NICConfigDict

Lets a caller pin a NIC's MAC address ahead of VM creation, needed to
create a matching DHCP static reservation before the VM even exists.
This commit is contained in:
2026-07-08 09:09:14 +02:00
parent 6c4ff65710
commit f5c286a713
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -583,7 +583,9 @@ class HypervisorDriver(DeviceTypeDriver):
nics (list[NICConfigDict]) - list of network interface configurations.
First NIC is primary (DHCP by default); subsequent NICs are optional.
Each entry specifies bridge, optional vlan_tag (access) or trunk_vlan_tags,
and dhcp flag.
dhcp flag, and an optional explicit mac address (omit to let the
hypervisor auto-generate one; needed when a caller must know the
MAC ahead of time, e.g. to create a matching DHCP reservation).
cloud_init_config (dict) - user-data dict (will be rendered to YAML).
Should include hostname, bootstrap_token, runcmd, and any custom config.
image_checksum (string | None) - expected checksum of the downloaded
+1
View File
@@ -713,6 +713,7 @@ class NICConfigDict(TypedDict):
vlan_tag: NotRequired[int | None] # Access VLAN (None = untagged)
trunk_vlan_tags: NotRequired[list[int]] # Trunk VLAN list (alternative to vlan_tag)
dhcp: NotRequired[bool] # Enable DHCP (default True for first NIC, False for others)
mac: NotRequired[str] # Explicit MAC address (omit to let the hypervisor auto-generate one)
class VMProvisionResultDict(TypedDict):