Hello all,
I have a lab environment at home running esxi 5.5. I went to clone my Server 2012 VM and syspreped it before hand. I selected the option 'I copied it' and proceeded to clone the VM, however I was expecting the clone vm to have a new mac address but it's exactly the same as the original with the same IP. (Note server is set to static ip)
How do I safely change the IP address of the clone and is there a best practice method to clone a VM?
Thanks
"I copied" should have changed the MAC address.
I would power off the VM, remove it from inventory , manually delete the MAC address parameters from the vmx-file and then re-register the VM.
I will try that and let you know.
Thanks
Hi Continuum.
Unfortunately that didn't work. So I did as instructed, removed it from inventory, downloaded the vmx file, edited the parameters by removing the lines following the link below. (note I deleted the lines but left the " ") , uploaded the file back to the inventory and it's exactly the same.
https://kabri.uk/2008/07/16/force-vmware-to-generate-a-new-mac-address/
Did I do it right?
How do I check if the VM is getting the address via dhcp from my physical router?
Do an ipconfig /all and see if the DHCP Server IP address is the one from the router.
rightclix
I encountered this question as well~
I'm wondering did you find the solution?~
I found that the mac-address of the VMs are displayed differently,
and is also confirmed from ipconfig in the VM.
However, somehow the IPs are assigned as the same.
But the IPs are assigned as different if I create a new VM from scratch instead of cloning a VM.
Or you could clone the VM, remove the nic and re-add it again. That should give the VM a new mac address. Another option is to clone the VM and then convert it into a template. Then create a new VM from that template. That should also work.
We bought a Dell server with VMWare ESXi 6.5 in 2017.
I am very sure that the MAC-address are DIFFERENT between the original-VM and the cloned-VM.
(I used
vmkfstools -i "${PREFIX_DIR}/${FROM_VM}/${FROM_VM}_0.vmdk" "${PREFIX_DIR}/${TO_VM}/${TO_VM}_0.vmdk" -d thin
sed "s/${FROM_VM}/${TO_VM}/g" "${PREFIX_DIR}/${FROM_VM}/${FROM_VM}.vmx" > "${PREFIX_DIR}/${TO_VM}/${TO_VM}.vmx"
and clicked on "I copied the VM" to do the cloning.)
However, it seems like something happened in VM-network and both VMs received same IP from the
outside-DHCP-server.
It's possible that we need to use vSphere to do this cloning-feature though~
Are you sure that the IP address is not set in the guest OS? You actually see two leases in the DHCP server? I find that hard to believe. Most DHCP servers have a mechanisme to detect duplicate IP addresses. So please check again that the guest OS is using DHCP and that you see the leases in the DHCP server.
The guestOS that I am running is 18.04.2.
I am sure that the ip is assigned from the outside-DHCP-server.
It looks like something happened in VMNet and the 2 VMs are considered as the same outside the VMWare ESXi.
I just tested on 16.04 as well.
It looks the ip-allocation on 16.04 is perfectly great~
but not on 18.04
The cause of the problem could be that the built-in network config of Ubuntu 18.04 no longer uses the NIC Mac address as the default id for DHCP requests.
The traditional (and I believe "sensible") behavior can be restored by adding dhcp-identifier: mac
to the configuration in the /etc/netplan/xxx.yaml (cloud-init) file as follows:
network: renderer: networkd version: 2 ethernets: nicdevicename: dhcp4: true dhcp-identifier: mac
Where "nicdevicename" is the name of your network device
Use
sudo netplan apply
to try the new configuration. If you get any errors, please note that precise indentation is very important in .yaml files..
This is the solution!!!
Thanks @jburen for your contribution