MAC Address out of sync
by fusion1275 from LinuxQuestions.org on (#6GY6V)
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))Thanks to anyone who has time to look at this and help. Much appreciated.
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))Thanks to anyone who has time to look at this and help. Much appreciated.