custom hw_detect script not working due to biosdevname
Jagga Soorma <[email protected]> Sun, 15 Feb 2015 11:34:35 -0800
| Newsgroups | gmane.comp.python.cheetah |
|---|---|
| Message-ID | <CAKyjK52DBg9eMAYSsnqfpUXZQnUwRjRMzgZ-Ya0XbA8ycg_J9g@mail.gmail.com> |
Hi All,
We have been using cobbler to provision servers for a few weeks now on
hp hardware without any issues. We just got one dell server and all
of a sudden my networking is screwed up and looks like it is due to
how dell servers behave due to the biosdevname package by default. On
the dell server my interface is setup as em1 instead of eth0 and this
is what I am doing in one of my cobbler snippets that is now broken
due to me looking explicitly for eth0:
--
$ cat centos66/hw-detect
#set $mac = $getVar('$mac_address_eth0')
#if $mac
#set $mac_prefix = $mac[0:8]
#if $mac_prefix == "00:0c:29" or $mac_prefix == "00:05:69" or
$mac_prefix == "00:50:56"
#set global $machinetype='virtual'
#else
#set global $machinetype='physical'
#end if
#end if
--
This is just a quick way for me to detect if it is a virtual or
physical machine. How can I test for the existence of em1 instead?
So basically it would check eth0 if that is what is being defined by
the user or em1 if that is what is being added on the "cobbler system
add" command.
I tried just using $getVar("mac_address") but that does not seem to
work. Any help would be greatly appreciated.
Thanks!
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/