[Bug Report] key conflict message for create host by OMAPI

Steve van der Burg steve.vanderburg at lhsc.on.ca
Tue Nov 3 20:14:07 UTC 2015

Clodoaldo de Borba Lambiase <clodoaldo at cpd.ufrgs.br> wrote:
> The problem addressed is another. We are not expecting different devices in 
> different subnets that have the same MAC address. What we want to support is 
> registration of devices, so they can go from a network to another network and 
> use fixed addresses. So, we need host entries with the same MAC address in 
> different subnets.

Why are you assuming that this is done by creating multiple host definitions for the same MAC?

Do you mean that you need to be able to add something like this via OMAPI?

host ec-ff-cc-52-55-f1 {
  hardware ethernet ee:ff:cc:52:55:f1;

I add, modify and delete host containers on my DHCP servers with omshell and expect, and a little perl code to control it all.  When I first needed to specify multiple fixed addresses for a MAC, I ran into a limitation of either omshell or OMAPI.  Here's how I solved it:

# Deal with multiple IP addresses for the omshell "set ip-address" command:
# Multiple addresses can come in either as an array ref or packed in a string, separated by commas.
# To keep things simple, we treat single addresses as if they were multiple, and convert them also.
# We convert the addresses to hex, joined with ":", and then pass them back to the caller.
# This is because omshell can do
#      set ip-address=
# for setting one address in a host container, but needs to do
#      set ip-address=0a:0b:70:f0:0a:88:4c:f0
# to set more than one (two here).
sub make_ipstr {
   my $in = shift;

   if ( ref($in) ne 'ARRAY' ) {
      my @ipa = split(/,/,$in);
      $in = \@ipa;

   my @ho;
   foreach my $ipa ( @$in ) {
      my @oc = split(/\./,$ipa);
      push @ho,sprintf("%2.2x",$_) foreach @oc;

   return join(":", at ho);


Steve van der Burg
Information Technology Services
London Health Sciences Centre
& St. Joseph's Health Care London
(519) 685-8500 ext 35559
steve.vanderburg at lhsc.on.ca

This information is directed in confidence solely to the person named above and may contain confidential and/or privileged material. This information may not otherwise be distributed, copied or disclosed. If you have received this e-mail in error, please notify the sender immediately via a return e-mail and destroy original message. Thank you for your cooperation.

More information about the dhcp-users mailing list