warewulf_CentOS7_Master - alex-aleyan/linux_wiki GitHub Wiki

systemctl isolate graphical.target

export ntp_server=$(hostname)
export server_ww_nic="enp0s8"
export ${server_ww_nic_ip}="192.168.1.10"
export ${server_ww_nic_mask}="255.255.255.0"

Setup the repos:

install_centos7_repos.sh

Disable firewall (interferes with warewulf)

  • chkconfig firewalld off
    chkconfig firewalld status
    chkconfig firewalld --list
    
  • systemctl stop firewalld
    systemctl disable firewalld
    systemctl status firewalld
    
  • perl -pi -e "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config

install warewulf:

  • yum -y install ohpc-base
  • yum -y install ohpc-warewulf

Configure ntpd utility:

  • systemctl enable ntpd.service
  • echo "server ${${server_ww_nic_ip}}" >> /etc/ntp.conf
  • systemctl restart ntpd

Configure nics, database, http and dhcp services:

  • perl -pi -e "s/device = eth1/device = ${server_ww_nic}/" /etc/warewulf/provision.conf
  • perl -pi -e "s/^\s+disable\s+= yes/ disable = no/" /etc/xinetd.d/tftp
  • ifconfig ${server_ww_nic} ${${server_ww_nic_ip}} netmask ${server_ww_nic_mask} up
    • vim /etc/sysconfig/network-scripts/ifcfg-${server_ww_nic}
      TYPE=Ethernet
      BOOTPROTO=static
      NAME=${server_ww_nic}
      IPADDR=${server_ww_nic_ip}
      NETMASK=${server_ww_nic_mask}
      NM_CONTROLLED=no
      DEVICE=${server_ww_nic}
      ONBOOT=yes
      
  • echo "DHCPDARGS="${server_ww_nic}";" >> /etc/dhcp/dhcpd.conf
  • systemctl restart xinetd
  • systemctl enable mariadb.service
  • systemctl restart mariadb
  • systemctl enable httpd.service
  • systemctl restart httpd
  • systemctl enable dhcpd.service

Build BOS (Base OS) image (other OS')

  • echo 'export CHROOT=/opt/ohpc/admin/images/centos7' >> /etc/bashrc
  • mkdir -p $CHROOT
  • wwmkchroot centos-7 $CHROOT

Import Files:

  • wwsh file import /etc/passwd
  • wwsh file import /etc/group
  • wwsh file import /etc/shadow

Assemble bootstrap image:

  • export WW_CONF=/etc/warewulf/bootstrap.conf
  • echo "drivers += updates/kernel/" >> $WW_CONF
  • echo "drivers += overlay" >> $WW_CONF
  • wwbootstrap $(uname -r)
  • wwvnfs --chroot $CHROOT

Adding a node

  • echo "GATEWAYDEV=${server_ww_nic}" > /etc/sysconfig/network
  • wwsh -y file import /etc/sysconfig/network
  • wwsh node new node01 --ipaddr=192.168.1.11 --hwaddr=<YOU_MAC_HERE> -D eth0
  • add this file to provision
    • Create this file
      DEVICE=eth0
      BOOTPROTO=static
      IPADDR=%{NETDEVS::ETH0::IPADDR}
      NETMASK=%{NETDEVS::ETH0::NETMASK}
      GATEWAY=%{NETDEVS::ETH0::GATEWAY}
      MTU=%{NETDEVS::ETH0::MTU}
      ONBOOT=yes
      
    • wwsh file import /path/to/that/file/ifcfg-eth0 --path=/etc/sysconfig/network-scripts/ifcfg-eth0
    • wwsh provision set --fileadd=ifcfg-eth0 node01
  • wwsh -y provision set node01" --vnfs=centos7 --bootstrap=$(uname -r) \
    --files=dynamic_hosts,passwd,group,shadow,network
    
  • systemctl restart dhcpd
  • wwsh pxe update