VMware Migration and Cloning IP/DHCP/DNS Issues "FIX"

cshill

Member
May 8, 2024
62
8
8
Hi Proxmox Community,

I know this is a long post but I'm trying to be as detailed as possible with the steps I have taken.

I have some live VMs on a VMware product as I'm trying to move over to Proxmox for everything. I'm running some VMs on Ubuntu OS for websites using Apache2 and I took a backup of the VMs by using the vmware migration tool to move it over to my Proxmox cluster. I changed the name, IP address set to DHCP, virtual host files of the website, the website name, etc. By all accounts the VMs backed up are now different VMs entirely besides the files that are stored. I made some clones as I'm testing some upgrade options for the software running on the VMs that are in production. This is where I started having a problem.

I noticed that when I had two of the clones from the VM1 backup, first clone for testing version X of software and the second for testing version Y, that they would randomly send me to the original website name that was recorded in the DNS. I thought that maybe I was being an idiot and double checked the configuration and by all accounts the VMs were unique, except for the IP address. I noticed the IP address was the same for the two clones but they were set by the DHCP.

I did a dive on Proxmox and found this forum post from 2022 that discussed that the problem is that the DHCP server is going by Client ID and not by the MAC address.
https://forum.proxmox.com/threads/cloned-vm-has-same-ip-address-as-original.117169/
>
I had this issue. If I understand the root cause correctly, some DHCP servers are using client ID, not MAC address to assign IP addresses. You will need to reset the machine id before cloning. I used the commands below and it worked for me:

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


The code above does in fact wipe out the machine-id and upon reboot it generates a new one. The problem here is that you can clone but do not reboot the machine as it will generate a new machine-id and you're back at square one where you will be cloning the same machine ID again. It's fine to clone VMs just remember you have to run the above command. Once that is completed I restarted the DHCP service and rebooted the VMs and now they have an IP address.

So I was able to figure out that the VMware Migration tool pulls the VM as a clone so anytime you do this treat that machine as a clone that can hamper production if the production machines are on DHCP. What I don't understand is how the machine-id also hampers the DNS.

I was using a host file on my machine to check against my entries before reaching out to the DNS for an IP/Name resolution. I was not trying to run both cloned VMs of VM1 and putting the identical IP addresses connected to different names. I would tinker with clone one from VM1 in production and tinker with clone one from VM2 in production. The problem was that I would keep being redirected back to the VM1/VM2 website. I always knew DNS as IP is now related to the FQDN of the machine. I guess not though as putting in the IP address in the URL will send me to the old website. Putting in the virtual host website name MIGHT get me to the right place but there's a conflict occurring. T
his means the machine ID is also conflicting with DNS records and this machine-id duplication has caused me so many problems. Basically it wiped most of my day out trying to determine the problem as if it was networking, apache virtual host, duplicating the software, etc. I didn't know the culprit so I kind of just went one by one until I figured this out.

This has become more of a "I hope this will help you not bang your head against a wall" post and I don't know if the Proxmox team is capable of inputting a code to provide any migrated computer a new machine-id or not but that would be very helpful. Same with if it's possible during a migration from VMware that there's an option for the QEMU agent to be installed.

 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!