1

vSphere 7.0 + Ubuntu 18 / 20 (tried both)

I am trying the steps from this blog post:

I also tried this blog:

Both times all my cloned Ubuntu 18 (or Ubuntu 20) VMs all get the same IP:

Every 30.0s: govc find / -type m -name 'k8s*' | xargs govc vm.info | grep 'Name:\|IP'                                primary: Thu Jun 16 21:31:29 2022

Name: k8s-worker3 IP address: 192.168.3.73 Name: k8s-worker2 IP address: 192.168.3.73 Name: k8s-worker1 IP address: 192.168.3.73 Name: k8s-master IP address: 192.168.3.73

I'm thinking something must be wrong either with my setup or with my DHCP server itself (running on a Windows Server 2012 R2 VM). However, I have no DHCP reservation for this IP (192.168.3.73) at all, let alone a MAC for it.

I have tried the steps from this VMware KB: https://kb.vmware.com/s/article/82229

echo -n > /etc/machine-id
rm /var/lib/dbus/machine-id
ln -s /etc/machine-id /var/lib/dbus/machine-id

Nothing seems to work. Can someone please explain exactly how to get Cloud-Init to force the cloned Ubuntu VM to get a unique / new IP address?

1 Answers1

0

Finally found the fix - force Netplan to use the MAC to ensure DHCP assigns a unique IP:

https://unix.stackexchange.com/questions/419321/why-are-my-cloned-linux-vms-fighting-for-the-same-ip

root@Ubuntu-20:/etc/netplan# cat 01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    ens160:
      dhcp4: yes
      dhcp-identifier: mac

Last line was the fix