6. Add a system to cobbler

Next we will create a system using our centos7-x86_64 profile.

[root@master ~]# cobbler system add --name=c01 --profile=centos7-x86_64

You can verify the system exists, with cobbler system list and cobbler system report:

[root@master ~]# cobbler system list
   c01
[root@master ~]# cobbler system report --name=c01
Name                           : c01
TFTP Boot Files                : {}
Comment                        :
Enable gPXE?                   : <<inherit>>
Fetchable Files                : {}
Gateway                        :
Hostname                       :
Image                          :
IPv6 Autoconfiguration         : False
IPv6 Default Device            :
Kernel Options                 : {}
Kernel Options (Post Install)  : {}
Kickstart                      : <<inherit>>
Kickstart Metadata             : {}
LDAP Enabled                   : False
LDAP Management Type           : authconfig
Management Classes             : <<inherit>>
Management Parameters          : <<inherit>>
Monit Enabled                  : False
Name Servers                   : []
Name Servers Search Path       : []
Netboot Enabled                : True
Owners                         : <<inherit>>
Power Management Address       :
Power Management ID            :
Power Management Password      :
Power Management Type          : ipmitool
Power Management Username      :
Profile                        : centos7-x86_64
Internal proxy                 : <<inherit>>
Red Hat Management Key         : <<inherit>>
Red Hat Management Server      : <<inherit>>
Repos Enabled                  : False
Server Override                : <<inherit>>
Status                         : production
Template Files                 : {}
Virt Auto Boot                 : <<inherit>>
Virt CPUs                      : <<inherit>>
Virt Disk Driver Type          : <<inherit>>
Virt File Size(GB)             : <<inherit>>
Virt Path                      : <<inherit>>
Virt PXE Boot                  : 0
Virt RAM (MB)                  : <<inherit>>
Virt Type                      : <<inherit>>

Cobbler supports many configuration options, including provisioning virtual machines. That is why the output of this might be a bit convoluted. But rest assured, we will only use a fraction of this capability.

Let’s assign our system a hostname which it should use after installation:

[root@master ~]# cobbler system edit --name=c01 --hostname=c01

We want cobbler to manage the network configuration via DHCP and DNS. For this, it needs to know the interface information for each system.

6.1. Configure the management network interface

[root@master ~]# cobbler system edit --name="c01" --interface=ipmi --dhcp-tag=ipmi --ip-address="192.168.1.1" --subnet="255.255.240.0" --dns-name="c01.mgmt" --mac-address="f0:4d:a2:06:80:77"

If you execute cobbler system report afterwards, you will see the added Interface portion:

[root@master ~]# cobbler system report --name=c01
...
Interface =====                : ipmi
Bonding Opts                   :
Bridge Opts                    :
CNAMES                         : []
InfiniBand Connected Mode      : False
DHCP Tag                       : ipmi
DNS Name                       : c01.mgmt
Per-Interface Gateway          :
Master Interface               :
Interface Type                 :
IP Address                     : 192.168.1.1
IPv6 Address                   :
IPv6 Default Gateway           :
IPv6 MTU                       :
IPv6 Prefix                    :
IPv6 Secondaries               : []
IPv6 Static Routes             : []
MAC Address                    : f0:4d:a2:06:80:77
Management Interface           : False
MTU                            :
Subnet Mask                    : 255.255.240.0
Static                         : False
Static Routes                  : []
Virt Bridge

Execute cobbler sync and have a look what influence it has on various configuration files.

You will notice that while the DHCP configuration file has changed, however, the DNS configuration is still missing.

...
# group for Cobbler DHCP tag: default
group {
}
# group for Cobbler DHCP tag: ipmi
group {
    host c01.mgmt-ipmi {
        hardware ethernet f0:4d:a2:06:80:77;
        fixed-address 192.168.1.1;
        option subnet-mask 255.255.240.0;
        filename "/pxelinux.0";
        next-server 192.168.16.1;
    }
}

At this point you should be able to ping the BMC through its IP after some time.

[root@master ~]# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.489 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.460 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.451 ms
^C
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.451/0.466/0.489/0.029 m

6.2. Configure the cluster network interface

Add the cluster network interface to the cobbler configuration of the system c01. Note that this interface has management=true set, which means it is the interface cobbler uses for network installation.

Warning

There is an inconsistency between cobbler and our course. Cobbler calls the network interface used for provisioning the “management interface”. For us, it is connected to our “cluster network”. The “management network” for us is the one connected to the BMCs used for IPMI.

[root@master ~]# cobbler system edit --name="c01" --interface="eno2" --dhcp-tag=hpc --management=true --ip-address="192.168.17.1" --subnet="255.255.240.0" --dns-name="c01.hpc" --mac-address="f0:4d:a2:06:80:71"

Your dhcpd.conf file should have something similar to the following after running cobbler sync:

# group for Cobbler DHCP tag: default
group {
}
# group for Cobbler DHCP tag: ipmi
group {
    host c01.mgmt-ipmi {
        hardware ethernet f0:4d:a2:06:80:77;
        fixed-address 192.168.1.1;
        option subnet-mask 255.255.240.0;
        filename "/pxelinux.0";
        next-server 192.168.16.1;
    }
}
# group for Cobbler DHCP tag: hpc
group {
    host c01.hpc-eno2 {
        hardware ethernet f0:4d:a2:06:80:71;
        fixed-address 192.168.17.1;
        option subnet-mask 255.255.240.0;
        filename "/pxelinux.0";
        next-server 192.168.16.1;
    }
}

Challenge

Technically the filename and next-server entries are not needed in the management network host configuration. Can you modify the template to make them only appear if the DHCP tag is not equal to ipmi?