LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-06-2023, 04:23 AM   #1
fusion1275
Member
 
Registered: Jul 2007
Location: Knaphill, Surrey
Distribution: Linux Mint
Posts: 310

Rep: Reputation: 36
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))
Thanks to anyone who has time to look at this and help. Much appreciated.
 
Old 12-06-2023, 09:15 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,153

Rep: Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265
Why can't you use the MAC provided by Azure?
 
Old 12-06-2023, 10:00 AM   #3
fusion1275
Member
 
Registered: Jul 2007
Location: Knaphill, Surrey
Distribution: Linux Mint
Posts: 310

Original Poster
Rep: Reputation: 36
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?
 
Old 12-06-2023, 12:07 PM   #4
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,714

Rep: Reputation: 2732Reputation: 2732Reputation: 2732Reputation: 2732Reputation: 2732Reputation: 2732Reputation: 2732Reputation: 2732Reputation: 2732Reputation: 2732Reputation: 2732
Quote:
Originally Posted by fusion1275 View Post
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?
No sane network engineer would want to do that. If you were to bring two images up on the same network with the same MAC the network routing would freak. Depending upon your network devices, it could shut the entire network down. More likely one the the images would simply not network because the routing would only route packets to the first or last path containing that MAC. Remember: at the hardware/firmware level it is the MAC that packets are directed to, not the IP address. Duplication can be BAD in this case.

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?
 
  


Reply

Tags
ansible, network confguration, oracle linux, packer



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change mac address to multicast mac address ubuntuv Linux - Networking 5 01-16-2019 07:21 AM
how do I find what MAC address web pages see as my MAC address rob.rice General 20 05-29-2010 02:08 AM
Linux / UNIX OS for Motorola RAZR v3 -- Sync it with OpenBSD 4.2/Mac 10.5/Mac 10.3 Doctorzongo Linux - Laptop and Netbook 0 04-30-2008 01:27 AM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 04:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration