adamant-kite-43734
04/17/2026, 2:51 PMwitty-musician-14961
04/17/2026, 2:57 PMhappy-cat-90847
04/17/2026, 2:59 PMwitty-musician-14961
04/17/2026, 3:18 PMwitty-musician-14961
04/17/2026, 3:31 PMred-king-19196
04/17/2026, 3:31 PMwitty-musician-14961
04/17/2026, 3:34 PMred-king-19196
04/17/2026, 3:36 PMred-king-19196
04/17/2026, 3:36 PMred-king-19196
04/17/2026, 3:39 PMapiVersion: <http://network.harvesterhci.io/v1alpha1|network.harvesterhci.io/v1alpha1>
kind: VirtualMachineNetworkConfig
metadata:
labels:
<http://harvesterhci.io/vmName|harvesterhci.io/vmName>: <vm-name>
name: <name>
namespace: <namespace>
spec:
networkConfig:
- macAddress: <mac-address>
networkName: <network-namespaced-name>
vmName: <vm-name>red-king-19196
04/17/2026, 3:40 PMwitty-musician-14961
04/17/2026, 3:41 PMhappy-cat-90847
04/17/2026, 3:41 PMred-king-19196
04/17/2026, 3:43 PMred-king-19196
04/17/2026, 3:44 PMred-king-19196
04/17/2026, 3:47 PMwitty-musician-14961
04/17/2026, 3:49 PMvmnetcfg, the MAC needs to be known beforehand since DHCP mapping is MAC-based.
Just to confirm, is there any supported way to:
⢠Create a VM, have it obtain an IP dynamically from DHCP, and then ālock inā or persist that IP assignment afterward (without needing to predefine MAC or vmnetcfg upfront)?
Also, I still have a second related use case:
Some applications require a VIP that exists inside the application layer, not tied to any VM NIC. In this case:
⢠The IP still needs to come from the same DHCP pool
⢠But it is not associated with a VM interface or MAC address
⢠It behaves more like a logical/virtual IP owned by the application itselfred-king-19196
04/17/2026, 3:49 PMwitty-musician-14961
04/17/2026, 3:50 PMred-king-19196
04/17/2026, 3:50 PMred-king-19196
04/17/2026, 3:51 PMas a workaround for now do you recommend to keep appending exclude list of ip in the pool configs?which use cases are you referring to?
witty-musician-14961
04/17/2026, 3:51 PMred-king-19196
04/17/2026, 3:54 PMred-king-19196
04/17/2026, 3:55 PMCreate a VM, have it obtain an IP dynamically from DHCP, and then ālock inā or persist that IP assignment afterward (without needing to predefine MAC or vmnetcfg upfront)?Try removing the
OwnerReference part from the vmnetcfg. Itās similar to ālock inā a DHCP lease.red-king-19196
04/17/2026, 3:56 PM$ kubectl get virtualmachinenetworkconfigs.network test-vm -o yaml
apiVersion: network.harvesterhci.io/v1alpha1
kind: VirtualMachineNetworkConfig
metadata:
creationTimestamp: "2024-02-15T13:48:02Z"
finalizers:
- wrangler.cattle.io/vm-dhcp-vmnetcfg-controller
generation: 2
labels:
harvesterhci.io/vmName: test-vm
name: test-vm
namespace: default
ownerReferences:
- apiVersion: kubevirt.io/v1
kind: VirtualMachine
name: test-vm
uid: a9f8ce12-fd6c-4bd2-b266-245d8e77dae3
resourceVersion: "826809"
uid: 556440c7-eeeb-4daf-9c98-60ab39688ba8
spec:
networkConfig:
- macAddress: ca:70:82:e6:84:6e
networkName: default/net-48
vmName: test-vm
status:
conditions:
- lastUpdateTime: "2024-02-15T13:48:20Z"
status: "True"
type: Allocated
- lastUpdateTime: "2024-02-15T13:48:02Z"
status: "False"
type: Disabled
networkConfig:
- allocatedIPAddress: 192.168.48.84
macAddress: ca:70:82:e6:84:6e
networkName: default/net-48
state: Allocated
Remove the following from the above makes it an orphan resource so it wonāt be GCād
ownerReferences:
- apiVersion: kubevirt.io/v1
kind: VirtualMachine
name: test-vm
uid: a9f8ce12-fd6c-4bd2-b266-245d8e77dae3witty-musician-14961
04/17/2026, 4:04 PMThe VIP must be assigned to some interfaces in the VM, right?Not always. In some implementations (like HA/VRRP setups), a VIP is assigned to a VM interface and temporarily exists on that active nodeās NIC. However, in other architectures such as load balancers or service-based systems, the VIP is not bound to any VM interface at all and is handled at a higher abstraction layer. So a VIP does not inherently need to be tied to a VM interfaceāit depends on the design and implementation.
witty-musician-14961
04/17/2026, 4:05 PMred-king-19196
04/17/2026, 4:12 PMwitty-musician-14961
04/17/2026, 4:12 PMwitty-musician-14961
04/17/2026, 4:12 PMhappy-cat-90847
04/17/2026, 4:13 PMhappy-cat-90847
04/17/2026, 4:13 PMwitty-musician-14961
04/17/2026, 4:14 PMwitty-musician-14961
04/17/2026, 4:15 PMwitty-musician-14961
04/17/2026, 4:16 PMred-king-19196
04/17/2026, 4:23 PMred-king-19196
04/17/2026, 4:26 PMwitty-musician-14961
04/17/2026, 4:32 PMSo the VIP does not need to be assigned by a DHCP server?Yes, thatās correct ā in our case both VM IPs and VIPs must come from the same subnet/network pool. Thatās exactly why Iām trying to understand the right mechanism here. If VIPs are taken from the same DHCP-managed pool, then DHCP still needs to be aware of those IPs somehow to prevent reallocation. From what I understand so far, DHCP only protects IPs it explicitly knows about (via MAC/vmnetcfg reservation or pool exclusion). So Iām trying to confirm whether VIPs are expected to also be represented as some form of reservation object (like vmnetcfg without a real VM), or if there is another supported pattern for this within the current design.
red-king-19196
04/17/2026, 4:35 PMexclude field is for.witty-musician-14961
04/17/2026, 6:07 PMDeploy VM
ā
VM boots, gets a random IP (e.g. 192.168.48.84) by DHCP, auto MAC assigned
ā
Controller auto-creates vmnetcfg with that MAC + IP
ā
I have recorded the MAC and IP and remove owneref
kubectl patch vmnetcfg to remove ownerRef ā the "lock in" step
ā
Delete VM ā vmnetcfg SURVIVES (no ownerRef, GC ignored it)
IP stays reserved in the dhcp pool
ā
Redeploy VM with the same MAC hardcoded in spec with same VM name
ā same IP every timewitty-musician-14961
04/17/2026, 6:36 PMThis is exactly what thequestion - if add any thing infield is for.exclude
exclude list of ip pool , to take that into effect do i need to restart dhcp agent pod every time i modify pool configs? if so by restarting will it causes any issues.red-king-19196
04/18/2026, 1:23 AMacceptable-analyst-61974
04/20/2026, 2:55 AMacceptable-analyst-61974
04/20/2026, 2:55 AMwitty-musician-14961
04/20/2026, 2:59 AMacceptable-analyst-61974
04/20/2026, 3:21 AM