MAC Address out of sync
Hi all,
I have been working on this problem for some time now and it has just totally baffled me. I am hoping someone has some ideas to throw my way please. So I am using Hashicorp Packer and Ansible to create an Azure-arm image. Packer builds it and Ansible provisions with certain software packages required. When I build a new vm from this completed image in Azure I log in and can see that interface eth0 has a mac address that Azure has provided it via it's build process but in /etc/sysconfig/network-scripts/ifcfg.eth0 it has a variable of HWADDR which has the mac address which was used when I built the Azure image and it got packaged up. So I get a networking conflict and certain things fail to work out of the box! I might also add that the new vm is a product of ours and it kicks off a registration process upon first boot. If the machine is rebooted without this registration being complete will result in the vm's specific software failing. So rebooting is not an option whatsoever. I would just like to know how to get the mac addresses in line. I've tried certain blocks in Ansible to disable cloud-init or even try to stop it controlling the mac address assigning. I've also tried post-processor code blocks in Packer. All of which result in the vm being unusable and me not even being able to log into the thing to start the registration. OS used is Oracle Linux 8.x Error in /var/log/messages Code:
error="process update config file: could not save updated config for interface 'eth0': exit status 7: Error: Connection activation failed: No suitable device found for this connection (device eth0 not available because profile is not compatible with device (permanent MAC address doesn't match)) |
Why can't you use the MAC provided by Azure?
|
I want to use the Azure mac address but from the point of an image being created with the locked in mac address to the point where a new vm is created and Azure provisions a new mac address I am at a loss.
I have no idea how to approach this issue. As said before I have tried to disable all sorts of things in the build of the image to hopefully spit out something so a new image won't have a mac set. But this then stops the internal network from working and therefore I am unable to get to a browser page to start that registration. How can I enforce Azure to use the provided mac address in all new vm's created from the image? |
Quote:
OF course, you can take steps to ensure that these images always come up on different networks entirely and never on the same router. Why would you want to jump through those hoops? Where would be the advantage? |
All times are GMT -5. The time now is 05:10 PM. |