Closed fabian-born closed 2 years ago
Could this be a systemd-networkd issue not a proxmox issue? Ubuntu server for instance switched to using systemd-networkd April of 2020 - what this means is that for the DHCP request of MAC address is not being broadcast but the machine-id is being broadcast. If you have a single template that you deploy from -- you are broadcasting the same machine-id each time -- the DHCP server will think it is the same machine asking for an IP address and give the same one out each time.
Two ways to attack this -- in your /etc/netplan config file you can add the item dhcp-identifier: mac and also delete your the file /etc/machine-id before you finish making your template -- that way the machine-id will be generated uniquely for each image on first boot.
I solved the problem with sysctl -w net.ipv4.ip_forward=1
on the pve host.
I solved the problem with
sysctl -w net.ipv4.ip_forward=1
on the pve host.
where do you guys copy and paste this code? it's at least 2y old and breaks a lot o thing
# not sure exactly what this is for. presumably something about MAC addresses and ignore network changes during the life of the VM
lifecycle {
ignore_changes = [
network,
]
}
remove it and be sure that you template has a cloud init agent installed and it has a machine-id "clean"
I found this in an older howto. I removed it now.
@fabian-born
Hello, I have the same problem with multiple VM per DHCP and I can't find solution.
Please can you share with me how can I use that command sysctl -w net.ipv4.ip_forward=1
with Terraform & Proxmox?
Thank you.
I get it.
Create your cloud-init and after install qemu-guest-agent
run
virt-customize -a $IMAGE_NAME --run-command "echo -n > /etc/machine-id"
Good morning,
I'm still using the proxmox terraform provider to deploy my golden image.
The problem is, that PVE generates a new MAC address for the interfaces, but all VMs gets the same ip from the DHCP Server. For example: I deploy four servers and every has the ip 192.168.69.108. The DHCP server has a lease-time of 600 seconds. Guest Agend is installed
Any idea why I got everytime the same IP?