Actions
Bug #5589
closedauto-generated hostnames fail w/ libvirt dhcp
Description
The auto-generated hostnames for discovery are hex numbers that often begin with a digit. Libvirt dhcp can't handle hostnames that begin with a digit, so the discovery hostnames need to be prefixed with one or more letters.
Updated by Lukas Zapletal almost 10 years ago
Hey,
I wrote a tiny little concept of pronouncable MAC addresses, something like:
ruby -Ilib bin/pmac 3c:97:0e:b1:3e:b7
nahedimonino
The string will be longer, there's a bug in the code I need to solve eventually. If I count right, it will be twice as long :-( That's maybe too much, but I want not to drop bits, it must be 1:1 mapping. I could make this optional in Foreman, the question is - would you like the idea?
cat lib/pmac.rb class PMAC # source sets VOWELS = 'aeiouy' CONSONANTS = 'bcdfghjklmnpqrstvwxz' PAIRS = CONSONANTS.split('').product(VOWELS.split('')).collect{|a,b| a+b} * 2 def initialize mac @mac = mac end def pmac @mac.split(/[:-]/).collect{|x| x.to_i(16)}.collect{|c| PAIRS[c.ord]}.join('') end end
Updated by Greg Sutcliffe almost 10 years ago
- Status changed from New to Ready For Testing
Updated by Greg Sutcliffe almost 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset e5d073565c1b755bacfd747f9c0c5acf84ce55fa.
Actions