Project

General

Profile

Actions

Bug #5589

closed

auto-generated hostnames fail w/ libvirt dhcp

Added by Scott Seago almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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.

Actions #1

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

Actions #2

Updated by Greg Sutcliffe almost 10 years ago

  • Status changed from New to Ready For Testing
Actions #3

Updated by Greg Sutcliffe almost 10 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF