NOTE: I do notice that I cant do this against another system record because of the configuration in my settings file, but duplicates in the same system record does not seem right to me.  

[root@init2 etc]# cobbler system edit --name=template-hp --interface=eth0 --subnet=255.255.255.0
Can't save system template-hp.  The hostname (foo) is already used by system foo (eth1)


On Wed, Nov 26, 2008 at 2:17 PM, Christopher Johnston <cjohnstonwork@gmail.com> wrote:
I am running the latest cobbler 1.3.1.  I have /etc/cobbler/settings setup to not allow duplicate mac addresses and hostname.

[root@init2 etc]# grep allow_dupl /etc/cobbler/settings
allow_duplicate_hostnames: 0
allow_duplicate_ips: 0
allow_duplicate_macs: 0

If we are relying on cobbler to manage DHCP addresses this could be a bad thing if you have duplicate entries (for ip mac, etc) within a single system record.  Since I am currently using cobbler to stateless boot initrd/vmlinuz to my systems in a large number of clusters I will rely heavily on cobbler to maintain unique information for all my systems which includes their network interfaces.  Using the copy feature is convenient if we want to mimic one system record to another, but sounds like its more suited for using it to copy a system record as a template (minimal information in the record thats static, ie kopts, profile, etc).  I noticed if I insert duplicate entries into a system record it ends up overwriting other valid entries on my dhcp server.

Could something like this be a configuration option that does stricter checking, ie you do a copy of one system record to another and --mac --ip --subnet --hostname (dns-name) is considered a mandatory field to be entered?  Might even be something that gets checked when you run cobbler sync.  Am I missing something here?

On Wed, Nov 26, 2008 at 5:11 AM, Michael DeHaan <mdehaan@redhat.com> wrote:
Christopher Johnston wrote:
> Should this be allowed?  Seems like this is not the appropriate
> behaviour given I could have multiple interfaces on a host, no?

Duplicate hostname prevention is a feature in 1.2.X Cobbler, it is
disabled/enabled at the top of your settings file.
I believe multiple hostnames on the same system are exempt from those
restrictions.

What version of cobbler are you running?  (rpm -q cobbler) ?

You mention a copy seems to be allowed.   Yes, it is.   This is one of
those things that is pretty much required to make the copy easy to use,
since it's hard to copy everything and supply correct arguments on the
command line.    Enforcing the check at the copy time is one of the
limitations of the duplicate hostname supression feature.  It's there as
a safeguard, but it's not flawless.   A good tactic is to name your
systems after your hostname parameters and make sure they match.   (You
could probably even write some clever cobbler triggers to do more checks
if you wanted)

Also, I should point out in 1.3, the hostname field per interface has
been renamed to "--dns-name" and there is a global --hostname
that will set the /etc/sysconfig/network hostname.    Configurations
will be migrated automatically so this is not something users will
need to worry about.

--Michael
>
> [root@init2 dhcpd]# cobbler system edit --name=foo --interface=eth0
> --hostname=foo
> [root@init2 dhcpd]# cobbler system edit --name=foo --interface=eth1
> --hostname=foo
> [root@init2 dhcpd]# cobbler system edit --name=foo --interface=eth2
> --hostname=foo
> [root@init2 dhcpd]# cobbler sync
> [root@init2 dhcpd]#
>
> [root@init2 dhcpd]# cobbler system edit --name=foo --interface=eth0
> --hostname=foo --ip=1.2.3.4 <http://1.2.3.4> --subnet=255.255.255.0
> <http://255.255.255.0>
> [root@init2 dhcpd]# cobbler system edit --name=foo --interface=eth1
> --hostname=foo --ip=1.2.3.4 <http://1.2.3.4> --subnet=255.255.255.0
> <http://255.255.255.0>
> [root@init2 dhcpd]# cobbler system edit --name=foo --interface=eth2
> --hostname=foo --ip=1.2.3.4 <http://1.2.3.4> --subnet=255.255.255.0
> <http://255.255.255.0>
> [root@init2 dhcpd]# cobbler sync
>
> [root@init2 dhcpd]# cobbler system report --name=foo
> system                : foo
> profile               : Legacy-Image-v1.0
> comment               :
> created               : Wed Nov 26 05:13:46 2008
> image                 :
> kernel options        : {}
> kernel options post   : {}
> kickstart             : <<inherit>>
> ks metadata           : {}
> mgmt classes          : []
> modified              : Wed Nov 26 05:18:03 2008
> netboot enabled?      : True
> owners                : ['admin']
> server                : <<inherit>>
> template files        : {}
> virt cpus             : <<inherit>>
> virt file size        : <<inherit>>
> virt path             : <<inherit>>
> virt ram              : <<inherit>>
> virt type             : <<inherit>>
> power type            : ipmitool
> power address         :
> power user            :
> power password        :
> power id              :
> interface        : eth0
>   bonding        :
>   bonding_master :
>   bonding_opts   :
>   dhcp tag       :
>   gateway        :
>   hostname       : foo
>   ip address     : 1.2.3.4 <http://1.2.3.4>
>   is static?     : False
>   mac address    : 00:00:00:12:34:56
>   subnet         : 255.255.255.0 <http://255.255.255.0>
>   virt bridge    :
> interface        : eth1
>   bonding        :
>   bonding_master :
>   bonding_opts   :
>   dhcp tag       :
>   gateway        :
>   hostname       : foo
>   ip address     : 1.2.3.4 <http://1.2.3.4>
>   is static?     : False
>   mac address    : 00:00:00:12:34:56
>   subnet         : 255.255.255.0 <http://255.255.255.0>
>   virt bridge    :
> interface        : eth2
>   bonding        :
>   bonding_master :
>   bonding_opts   :
>   dhcp tag       :
>   gateway        :
>   hostname       : foo
>   ip address     : 1.2.3.4 <http://1.2.3.4>
>   is static?     : False
>   mac address    : 00:00:00:12:34:56
>   subnet         : 255.255.255.0 <http://255.255.255.0>
>   virt bridge    :
>
>
> [root@init2 dhcpd]# grep duplicate /etc/cobbler/settings
> # if 1, cobbler will allow insertions of system records that duplicate
> allow_duplicate_hostnames: 0
> # if 1, cobbler will allow insertions of system records that duplicate
> allow_duplicate_ips: 0
> # if 1, cobbler will allow insertions of system records that duplicate
> allow_duplicate_macs: 0
>
> Also a copy of a system record seems to be allowed, but not forcing me
> to change any of the unique data in the record such as ip, hostname or
> mac address.  See below.
>
> system                : foo
> profile               : Legacy-Image-v1.0
> comment               :
> created               : Wed Nov 26 05:13:46 2008
> image                 :
> kernel options        : {}
> kernel options post   : {}
> kickstart             : <<inherit>>
> ks metadata           : {}
> mgmt classes          : []
> modified              : Wed Nov 26 05:18:03 2008
> netboot enabled?      : True
> owners                : ['admin']
> server                : <<inherit>>
> template files        : {}
> virt cpus             : <<inherit>>
> virt file size        : <<inherit>>
> virt path             : <<inherit>>
> virt ram              : <<inherit>>
> virt type             : <<inherit>>
> power type            : ipmitool
> power address         :
> power user            :
> power password        :
> power id              :
> interface        : eth0
>   bonding        :
>   bonding_master :
>   bonding_opts   :
>   dhcp tag       :
>   gateway        :
>   hostname       : foo
>   ip address     : 1.2.3.4 <http://1.2.3.4>
>   is static?     : False
>   mac address    : 00:00:00:12:34:56
>   subnet         : 255.255.255.0 <http://255.255.255.0>
>   virt bridge    :
> interface        : eth1
>   bonding        :
>   bonding_master :
>   bonding_opts   :
>   dhcp tag       :
>   gateway        :
>   hostname       : foo
>   ip address     : 1.2.3.4 <http://1.2.3.4>
>   is static?     : False
>   mac address    : 00:00:00:12:34:56
>   subnet         : 255.255.255.0 <http://255.255.255.0>
>   virt bridge    :
> interface        : eth2
>   bonding        :
>   bonding_master :
>   bonding_opts   :
>   dhcp tag       :
>   gateway        :
>   hostname       : foo
>   ip address     : 1.2.3.4 <http://1.2.3.4>
>   is static?     : False
>   mac address    : 00:00:00:12:34:56
>   subnet         : 255.255.255.0 <http://255.255.255.0>
>   virt bridge    :
>
> system                : foo1
> profile               : Legacy-Image-v1.0
> comment               :
> created               : Wed Nov 26 05:13:46 2008
> image                 :
> kernel options        : {}
> kernel options post   : {}
> kickstart             : <<inherit>>
> ks metadata           : {}
> mgmt classes          : []
> modified              : Wed Nov 26 05:22:00 2008
> netboot enabled?      : True
> owners                : ['admin']
> server                : <<inherit>>
> template files        : {}
> virt cpus             : <<inherit>>
> virt file size        : <<inherit>>
> virt path             : <<inherit>>
> virt ram              : <<inherit>>
> virt type             : <<inherit>>
> power type            : ipmitool
> power address         :
> power user            :
> power password        :
> power id              :
> interface        : eth0
>   bonding        :
>   bonding_master :
>   bonding_opts   :
>   dhcp tag       :
>   gateway        :
>   hostname       : foo
>   ip address     : 1.2.3.4 <http://1.2.3.4>
>   is static?     : False
>   mac address    : 00:00:00:12:34:56
>   subnet         : 255.255.255.0 <http://255.255.255.0>
>   virt bridge    :
> interface        : eth1
>   bonding        :
>   bonding_master :
>   bonding_opts   :
>   dhcp tag       :
>   gateway        :
>   hostname       : foo
>   ip address     : 1.2.3.4 <http://1.2.3.4>
>   is static?     : False
>   mac address    : 00:00:00:12:34:56
>   subnet         : 255.255.255.0 <http://255.255.255.0>
>   virt bridge    :
> interface        : eth2
>   bonding        :
>   bonding_master :
>   bonding_opts   :
>   dhcp tag       :
>   gateway        :
>   hostname       : foo
>   ip address     : 1.2.3.4 <http://1.2.3.4>
>   is static?     : False
>   mac address    : 00:00:00:12:34:56
>   subnet         : 255.255.255.0 <http://255.255.255.0>
>   virt bridge    :
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> cobbler mailing list
> cobbler@lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/cobbler
>

_______________________________________________
cobbler mailing list
cobbler@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler