User Tools

Site Tools


cluster:144

Warning: Undefined array key 19 in /usr/share/dokuwiki/inc/html.php on line 1453

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
cluster:144 [2015/12/08 14:18]
127.0.0.1 external edit
cluster:144 [2018/07/26 14:52] (current)
hmeij07 [Deploying]
Line 2: Line 2:
 **[[cluster:0|Back]]** **[[cluster:0|Back]]**
  
-===== Warewulf Stateless =====+===== Warewulf Golden Image =====
  
-  * [[http://warewulf.lbl.gov/trac]] Warewulf is a scalable systems management suite originally developed to manage large high-performance Linux clusters.  My Project Kusu replacement since IBM bought up Platform LSF and dished the hpccommunnity.org web sitegrrrh. (old info at https://dokuwiki.wesleyan.edu/doku.php?id=cluster:88)+Also read these pages and this page will make more sense: [[cluster:139|Warewulf Stateless]], [[cluster:143|Warewulf Statefull]].
  
-Get RPMs and install.+For some time now I have been looking for a provisioning tool. I've tried along the way ...
  
-<code>+  * Project Kusu, now defunct, but a great, simple template driven system. No fancy gui. 
 +  * HP's CMU, also a great tool, golden image approach. The nice feature of CMU is that master node can delegate hundreds of node to be image by a designated compute node relieving the master node. 
 +  * Bright Computing, a very complex tool that takes over every config file imaginable. Simple tasks become very burdensome, never achieved traction with this tool. 
 +  * xCAT, the behemoth of open source provisioning tools and more. It does it all, which means a huge learning curve.  
 +  * [[http://warewulf.lbl.gov/trac]] Warewulf. I settled on this for the reasons that it is simple and written in a language that's readable (Perl).
  
-[root@petaltail ~]# wget -O /etc/yum.repos.d/warewulf-rhel6.repo http://warewulf.lbl.gov/downloads/repo/warewulf-rhel6.repo +The requirements of the provisioning tool were two fold:
---2015-04-07 08:45:56--  http://warewulf.lbl.gov/downloads/repo/warewulf-rhel6.repo                                         +
-Resolving warewulf.lbl.gov... 128.3.7.27                                                                                    +
-Connecting to warewulf.lbl.gov|128.3.7.27|:80... connected.                                                                 +
-HTTP request sent, awaiting response... 200 OK                                                                              +
-Length: 126 [text/plain]                                                                                                    +
-Saving to: â/etc/yum.repos.d/warewulf-rhel6.repoâ                                                                         +
  
-100%[======================================================================================>] 126         --.-K/s   in 0s      +  * My HPCC environment is flooded with small jobs that run for weeks to months (no wall time) but have small memory requirements (< 1GB)Thus I want to design stateless compute nodes, or virtual compute nodes, and frequently tailor the config & setup to the scientific needs (mostly non graphical, just CPU compute bound jobs, very little IO). 
 +  * The HPCC also encounters very large jobs (for us that is 16-32 cores with memory requirements in the 256 GB range) utilizing X11, OpenGL, Nvidia and other large complex analyses software. In this case one compute node is build up to satisfaction, then we grab a "golden image" and deploy.
  
-2015-04-07 08:45:56 (22.9 MB/s) - â/etc/yum.repos.d/warewulf-rhel6.repoâsaved [126/126]+So I settled on Warewulf which does these two approaches and sports an active forum for questions.
  
-[root@petaltail ~]# yum install warewulf-common warewulf-cluster warewulf-provision +   
 +Not finding much on the "golden image" use of Warewulf, I've written up experiences. Hope it helps somebody. In this write we start with setting up stateless nodes, then we adept them to statefull using the "golden image" approach.
  
-Installed: +Install Warewulf and poke around the shell ''wwsh''Consult the stateless pageLets set up stateless node ''b6''The files have been loaded in the MySQL database. The "ww" files are template driven files whose contents will be populated by warewulf, like changing IPs and HWADDResI keep them in my centos-6 stateless chroot but use them in other chroots as well (/var/chgroot/centos-6/root/wwtemplates/).
-  warewulf-cluster.x86_64 0:3.6-1.el6          warewulf-common.noarch 0:3.6-1.el6        warewulf-icr.x86_64 0:3.6-1.el6 +
-  warewulf-provision.x86_64 0:3.6-1.el6+
  
-Dependency Installed: +<code>
-  dhcp.x86_64 12:4.1.1-43.P1.el6.centos.1    tftp-server.x86_64 0:0.49-7.el6    warewulf-provision-server.x86_64 0:3.6-1.el6 +
-  warewulf-vnfs.noarch 0:3.6-1.el6+
  
-Complete!+wwsh node new b6 --netdev=eth0 \ 
 +--hwaddr=00:00:00:00:00:00 --ipaddr=192.168.1.12 \ 
 +--netmask=255.255.0.0  --network=255.255.0.0 
 +--groups=wwnodes
  
-</code>+wwsh node set b6 --netdev=eth1 \ 
 +--hwaddr=00:00:00:00:00:00 --ipaddr=10.10.100.12 \ 
 +--netmask=255.255.0.0  --network=255.255.0.0
  
-Get and install MySQL and set mysql user root's password.+wwsh provision set b6 --fileadd passwd,shadow,group 
 +wwsh provision set b6 --fileadd hosts,bashrc,profile 
 +wwsh provision set b6 --fileadd network.ww,ifcfg-eth1.ww
  
-<code> 
-                                               
-[root@petaltail warewulf]# vi /etc/warewulf/database-root.conf  
-[root@petaltail warewulf]# service mysqld status 
- 
-mysql> set password for 'root'@'localhost' = PASSWORD('some_string'); 
-Query OK, 0 rows affected (0.00 sec)                                 
- 
-[root@petaltail warewulf]# chmod o-r /etc/warewulf/database-root.conf                                   
-      
 </code> </code>
  
-In the provision config file I turned dynamic_hostshostfile and localdomain off (I'll manage those manuallyand my private network is run over eth0 (192.168.0.0/255.255.0.0).+As opposed to the statelesswhich grabs it's OS content from the master node, in the "golden image" approach we are going to retrieve the content of a selected node (node b0 in this exampleto the Warewul master (node petaltail in this case).
  
-<code> +Set ''rsync'' to work between the two. Unmount any NFS file systems on the node. Adjust the exclusion selections in template file (ie after /home is unmounted on node I do want the mount point...scratch space, etc).
- +
-[root@petaltail warewulf]# vi /etc/warewulf/provision.conf  +
-[root@petaltail warewulf]# vi /etc/warewulf/provision.conf  +
- +
-</code>+
  
-Next comes a piece of mystery. When executing  ''wwinit ALL'' I ran into a lethal, no less, error. After much digging found the answer here and surprisingly found little in the documentation on this. 
  
-  * Lethal error thrown by module: /usr/libexec/warewulf/wwinit/91-vnfs.init 
-  * answer is here https://groups.google.com/a/lbl.gov/forum/#!topic/warewulf/5OhfZCf_eqE 
-  * quoting  
  
 <code> <code>
-What it appears you'll need to do initially is build out a chroot 
-directory. For example, for a Scientific Linux 6.x install, you'd do: 
  
-    wwmkchroot sl-6 /var/chroots/sl-6     (or whatever path you want +minder: all NFS file systems unmounted? 
-to store them at -- run wwmkchroot -h for the help)+# or add rsync excludes in 
 +/usr/libexec/warewulf/wwmkchroot/golden-system.tmpl
  
-  That will give the base chroot for the VNFS at /var/chroots/sl-6. +mkdir /var/chgroots/goldimages; cd /var/chgroots/goldimages
-You'll then set the environment variable CHROOTDIR when you execute +
-wwinit.+
  
-    # CHROOTDIR=/var/chroots/sl-6 wwinit VNFS+SOURCEADDR=b0 wwmkchroot golden-system /var/chroots/goldimages/b0.chroot 
  
-  I know when you use the 'icr' wwinit functions, it creates a base 
-chroot based upon the host OS. But none of the other wwinit scripts, 
-by default, create one; So you will need to build the chroot and 
-specify where the directory is. Then when the VNFS part of wwinit is 
-ran, it will build the VNFS and import it into the datastore at that 
-time, setting the one specified as the default VNFS in the 
-configuration. 
 </code> </code>
  
-So we start by making the chroot directoriesfirst we'll build a generic centos-6. Then we initialize the warewulf environment.+Nextmodify the properties of the node to image. 
 +[[http://warewulf.lbl.gov/trac/wiki/Recipes/StatefulProvisioning]]
  
 <code> <code>
  
-[root@petaltail ~]# wwmkchroot centos-6 /var/chroots/centos-6 +wwsh object modify -s bootloader=sda b6 
- +wwsh object modify -s diskformat=sda1,sda7 b6 
-[root@petaltail ~]# CHROOTDIR=/var/chroots/centos-6  wwinit ALL +wwsh object modify -s filesystems= \  
-database:     Checking /etc/rc.d/init.d/mysqld is installed                  OK +"mountpoint=/boot:dev=sda1:type=ext4:size=500, \  
-database:     Confirming mysqld is configured to start at boot: +dev=sda3:type=swap:size=2048, \ 
-database:      + chkconfig mysqld on                                         OK +mountpoint=/:dev=sda7:type=ext4:size=fill" 
-database:     Checking to see if MySQL needs to be started: +b6
-database:      + service mysqld start                                        OK +
-wwsh:         Confirming that wwsh accepts some basic commands +
-wwsh:          + wwsh quit                                                   OK +
-wwsh:          + wwsh help                                                   OK +
-wwsh:          + wwsh node new testnode0000                                  OK +
-wwsh:          + wwsh node list                                              OK +
-wwsh:          + wwsh node delete testnode0000                               OK +
-domain:       Setting default node domain to: "cluster"                      OK +
-authfiles:    Checking to see if /etc/passwd is in the WW Datastore          OK +
-authfiles   Checking if /etc/passwd is part of default node configuration +
-authfiles   Checking to see if /etc/group is in the WW Datastore           OK +
-authfiles   Checking if /etc/group is part of default node configuration +
-nfsd        Setting domain "cluster" for IDMAPD/NFSv4                      OK +
-nfsd         + chkconfig nfs on                                            OK +
-nfsd:          + service nfs restart                                         OK +
-nfsd:          + exportfs -a                                                 OK +
-ntpd:         Configured NTP services +
-ntpd:          + chkconfig ntpd on                                           OK +
-ntpd:          + service ntpd restart                                        OK +
-ssh_keys:     Checking ssh keys for root                                     OK +
-ssh_keys:     Checking root's ssh config                                     OK +
-ssh_keys:     Checking for default RSA1 host key for nodes                   OK +
-ssh_keys:     Checking for default RSA host key for nodes                    OK +
-ssh_keys:     Checking for default DSA host key for nodes                    OK +
-tftp:          + /sbin/chkconfig xinetd on                                   OK +
-tftp         + /sbin/chkconfig tftp on                                     OK +
-tftp         + /sbin/service xinetd restart                                OK +
-bootstrap:    Creating bootstrap for 2.6.32-504.8.1.el6.x86_64+
-bootstrap:     + wwbootstrap 2.6.32-504.8.1.el6.x86_64                       OK +
-vnfs:         Building the VNFS image and importing into Warewulf: +
-vnfs:          + wwvnfs -y --hybridpath=/var/chroots/centos-6 --chroot /var/ OK+
  
 +# see note below on filesystems....
  
 </code> </code>
  
-Next restart MySQLhttpd and xinetdOpen your firewall on the private network.+More on the ''filesystems'' option later. In this example I want to set up //boot and swapSizes in MB. Only one hard drive on this node (sda).
  
-  * edit /etc/sysconfig/iptables and restart iptables+Next we need to get the node booted and trasnfer the VNFS image made from the node b0 contents. At this time look on your master node in /var/lib/mysql and make sure you have enough disk space (these VNFS images will be around 1 GB as observed). Also, back up that database with ''mysqldump''.
  
 <code> <code>
  
-local allow +make the image, takes 10 minutes or so 
--A INPUT -i eth0 -d 192.168.0.0/16 -p tcp --dport 0:65535 -j ACCEPT +wwvnfs --chroot=/var/chroots/goldimages/b0.chroot 
--A INPUT -i eth0 -d 192.168.0.0/16 -p udp --dport 0:65535 -j ACCEPT+
  
-</code>+# switch node to image VNFS 
 +wwsh provision set b6 --vnfs=b0.chroot
  
-Next restart some warewulf services. I had to edit the /etc/warewulf/dhcpd-template.conf several times and hardcoded the values in for networknetmask and ipaddr because I realized this server is my virtualization KVM test host and eth0 is bridged to br0 and warewulf is looking at the first ethernet and picks up eth1.+# Rajil adds for GPU 
 +# Keep in mind that nouveau should be disabled, 
 +wwsh provision set c038 --kargs=\ 
 +"acpi_pad.disable=1 console=ttyS0,115200 rd.driver.blacklist=nouveau nouveau.modeset=0" 
  
-<code>+# just to be prudent 
 +wwsh pxe update 
 +wwsh dhcp update 
 +service dhcpd restart
  
-[root@petaltail ~]wwsh dhcp update +check the configs 
-Rebuilding the DHCP configuration +wwsh object print b6 -p :all 
-Done.+wwsh provision list
  
-[root@petaltail ~]wwsh pxe update +next for provisioning (just to sure) on first PXE boot 
-No nodes found+wwsh provision set --bootlocal=UNDEF b6
  
-[root@petaltail ~]wwsh +turn the node on
-Warewulf> node new b51 --netdev=eth0 --hwaddr=00:00:00:00:00:00 --ipaddr=192.168.1.5 --groups=wwnodes +
-Warewulf> provision set --lookup groups wwnodes --vnfs=centos-6 --bootstrap=2.6.32-504.8.1.el6.x86_64 +
-Are you sure you want to make the following changes to 1 node(s):+
  
-     SET: BOOTSTRAP            = 2.6.32-504.8.1.el6.x86_64 +</code>
-     SET: VNFS                 = centos-6+
  
-Yes/No> y +The console of the target node will now show the IP being assigned, the ''getvnfs'' process (be patient) and finally the root login. Check around the node for improvements, tweeks, then adjust and recreate the VNFS.
-Warewulf> quit+
  
-</code> +After all that is done, disable provisioning so that the master ignores the PXE boot and the target node boots of local disk.
- +
-Booting the node we observe the eth0 MAC address being picked up by DHCPd followed by the tftpboot process.  The node boots, et voila, CentOS 6.6 //stateless// compute node. Next import files we want the same on all nodes and associate them with the nodes.+
  
 <code> <code>
  
-[root@petaltail ~]# wwsh file import /etc/passwd+ignore PXE boot 
 +wwsh provision set --bootlocal=EXIT b6
  
-[root@petaltail ~]# wwsh file list +</code>
-dynamic_hosts           : -rw-r--r-- 0   root root            10174 /etc/hosts +
-group                   : -rw-r--r-- 1   root root             6247 /etc/group +
-passwd                  : -rw-r--r-- 1   root root            20094 /etc/passwd +
-shadow                  : ---------- 1   root root            23663 /etc/shadow+
  
-[root@petaltail ~]# wwsh provision set b[0-51] --fileadd passwd+**filesystems**
  
-[root@petaltail ~]# wwsh provision print +This is currently not working as expectedIn my first attempts I'd specify sda1 (size=500), sda2 (size=2048type=swap) and sda3 (size=fill) but what I end up with is a standard layout it looks like Any sizes are also ignoredSo for now I just pick the ones I want (sda1, sda3, sda7).
-#### b51.cluster ############################################################## +
-    b51.cluster: BOOTSTRAP        2.6.32-504.8.1.el6.x86_64 +
-    b51.cluster: VNFS             centos-6 +
-    b51.cluster: FILES            = dynamic_hosts,group,passwd,shadow +
-    b51.cluster: PRESHELL         FALSE +
-    b51.cluster: POSTSHELL        FALSE +
-    b51.cluster: CONSOLE          = UNDEF +
-    b51.cluster: PXELINUX         = UNDEF +
-    b51.cluster: SELINUX          = DISABLED +
-    b51.cluster: KARGS            = "quiet" +
-    b51.cluster: BOOTLOCAL        = FALSE +
-...+
  
-</code>+Note: this problem turns out to be hardware related, it is not appearing on newer hardware 
 + --- //[[hmeij@wesleyan.edu|Henk]] 2017/09/13 08:11//
  
-Next build a hybrid VNFSthis is the way to add packages to the nodes.  For example NTP.+ 
 +This also happens after I remove any UUID references in /etc/fstabclean up /etc/mtab and clean any and all files in /dev/disk/by-uuid and rebuild VNFS.
  
 <code> <code>
  
-cd /var/chroots/centos-6/ +fdisk -l
-mkdir vnfs+
  
-vi etc/fstab (inside of chroot areaedit) +Disk /dev/sda: 80.0 GB80026361856 bytes 
-192.168.1.217:/var/chroots/centos-6 /vnfs nfs defaults 0 0+ 255 heads, 63 sectors/track, 9729 cylinders 
 + Units = cylinders of 16065 * 512 = 8225280 bytes 
 + Sector size (logical/physical)512 bytes 512 bytes 
 + I/O size (minimum/optimal): 512 bytes 512 bytes 
 + Disk identifier: 0x000ce092
  
-wwvnfs --chroot /var/chroots/centos-6 --hybridpath=/vnfs +    Device Boot      Start         End      Blocks   Id  System 
-Overwrite original: y+ /dev/sda1                      13      104391   83  Linux 
 + /dev/sda2              14        1543    12289725   83  Linux 
 + /dev/sda3            1544        1798     2048287+  82  Linux swap / Solaris 
 + /dev/sda4            1799        9729    63705757+    Extended 
 + /dev/sda5            1799        2053     2048256   83  Linux 
 + /dev/sda6            2054        2184     1052226   83  Linux 
 + /dev/sda7            2185        9729    60605181   83  Linux
  
-# reboot node, observe mount, then add NTP to chgroot+df -h
  
-yum --tolerant --installroot /var/chroots/centos-6 -y install ntp+ Filesystem      Size  Used Avail Use% Mounted on 
 + /dev/sda7        57G  1.9G   53G   4% / 
 + tmpfs            12G       12G   0% /dev/shm 
 + /dev/sda1        95M   49M   42M  54% /boot
  
-vi etc/init.d/ntpd (inside of chroot, edit) +</code>
-# chkconfig: 35 58 74+
  
-# then make the following links in etc/rc[3|5].d/S58ntpd pointing to ../init.d/ntpd+Warewulf 3.6.99 and CentOS 6.5
  
-vi etc/ntp.conf (inside of chroot, sole contents are, IP is master on private network) +==== Part 2 ====
-restrict default ignore +
-restrict 127.0.0.0 +
-server 192.168.1.217 +
-restrict 192.168.1.217 nomodify+
  
-wwvnfs --chroot /var/chroots/centos-6 --hybridpath=/vnfs -y +To avoid the problems detailed above I started over with a fresh node.  First I installed CentOS 6.7 vanilla on the hard disk with partitions sda1 (/boot, 500 MB), sd2 (2048 MB, swap) and sda3 (/, size=fill). Since I had a new kernel now we need to make a new bootstrap image and provision it. 
-VNFS 'centos-6 has been imported+ 
 +<code>
  
-# reboot node+  wwbootstrap --chroot=/var/chroots/goldimages/n0.chroot 2.6.32-573.12.1.el6.x86_64 
 +  wwsh provision set n22 --vnfs=n0.chroot --bootstrap=2.6.32-573.12.1.el6.x86_64 
  
 </code> </code>
  
-Then build the node up:+Before we create the n0.chroot VNFS image edit the file and comment out these lines, with a golden image approach we do not have a hybridization path but we want these file systems included.
  
-  * use yum to install the openlava 2.2.1 RPM (pulls in tcl) +<code>
-    * copy the openlava config files into the centos-6 are +
-  * use yum to install postfix  +
-    * add links in rc3.d and rc5.d +
-    * remove sendmail links +
-  * yum install perl +
-  * yum install munge +
-    * build RPMs from tar ball +
-  * rebuild the VNFS and reboot+
  
-Sometimes you can edit the files in the chroot directly, sometimes you must modify the installtoot directly.  It's easiest to just do the latter all the time.+# /etc/warewul/vnfs.conf
  
-<code>+# comment out for golden image 
 +#hybridize += /usr/X11R6 
 +#hybridize += /usr/lib/locale 
 +#hybridize += /usr/lib64/locale 
 +#hybridize += /usr/include
  
-[root@petaltail ~]# cd /var/chroots +</code>
-[root@petaltail chroots]# chroot centos-6 +
-[root@petaltail /]# pwd                   +
-/                          <--- inside of installroot               +
-[root@petaltail /]# mkdir /var/log/munge  +
-[root@petaltail /]# chown munge:munge /var/log/munge +
-[root@petaltail /]# mkdir /var/log/slurm +
-[root@petaltail /]# chown slurm:munge /var/log/slurm +
-chown: invalid user: `slurm:munge'+
  
-# since the passwd|shadow|group files come from database you need to create the relevant lines+I also cleaned the following files inside the chroot environment:
  
-[root@petaltail /]# chown slurm:munge /var/log/slurm +<code>
-[root@petaltail /]# exit +
-exit +
-[root@petaltail chroots]# ls +
-centos-6+
  
-outside edit commenting out rc.local directives making these dirs etc +/etc/fstab, edited (clean also mtab and remove files /dev/disk/by-uuid/
-[root@petaltail chroots]# vi centos-6/etc/rc.local+tmpfs                   /dev/shm                tmpfs   defaults        0 0 
 +devpts                  /dev/pts                devpts  gid=5,mode=620  0 0 
 +sysfs                   /sys                    sysfs   defaults        0 0 
 +proc                    /proc                   proc    defaults        0 0 
 +10.11.103.42:/home /home nfs tcp,soft,intr,bg 
 +10.11.103.42:/sanscratch /sanscratch nfs tcp,soft,intr,bg
  
-and don't forget +/boot/grub/device.map 
-[root@petaltail chroots]wwvnfs --chroot /var/chroots/centos-6 --hybridpath=/vnfs  -y+This file was written by Warewulf bootstrap (capability setup-filesystems) 
 +(hd0) /dev/sda
  
-reboot node +# /etc/grub.conf 
-</code>+# This file was written by Warewulf bootstrap (capability setup-filesystems) 
 +serial --speed= --unit= --word= --parity= 
 +terminal_input console serial; terminal_output console serial 
 +default 0 
 +timeout 10 
 +root (hd0,0)
  
 +title CentOS release 6.7 - 2.6.32-573.12.1.el6.x86_64
 +    kernel /vmlinuz-2.6.32-573.12.1.el6.x86_64 ro root=/dev/sda3 rhgb quiet
 +    initrd /initramfs-2.6.32-573.12.1.el6.x86_64.img
  
-To build short hostnames you can create a template inside of the chroot environment.+</code>
  
-<code>+Now when first provisioning happens the right partitions are created and the node imaged. With bootload=EXIT or simply shutting down the warewulf master dhcpd process, the node is now booting from local disk.
  
-#--- build file CHROOT/root/wwtemplates/network.ww +Yea.
- NETWORKING=yes +
- HOSTNAME=%{NODENAME} +
-#--- end +
  
-# add that file (using wwsh provision) to the nodes.+==== Deploying ====
  
-[root@]# wwsh file import /var/chroot/centos-6/root/wwtemplates/network.ww \ +As part of my deployment I edited out any device information in file ''/etc/udev/rules.d/70-persistent-net.rules'', that information will be filled in on boot. Remade my VNFS. The reason for this is that in migrating from RHEL 5.5 to CentOS 6.7 I observed the order of the NICs to reverse themselves (but not always). Not sure why but will tell me what NIC eth0 will be.
- --path=/etc/sysconfig/network --name=network.ww+
  
-[root@]# wwsh provision set n[00-15] --fileadd=network.ww+Then we build a template file with node specs in it like so:
  
 +<code>
 +# HP blades reverses HWADDR (don't ask)
 + # use nic port bottom (no changes)
 + # set both ipaddr/hwaddr then PXEboot, wait...ww times out but images
 + # post edit
 + #   /etc/udev/rules.d fix eth? entries per below, then startup scripts
 + #   eth0 down CC 10.10.x.x onboot=no
 + #   eth1 up   CD 192.168.x.x onboot=yes
 + # reboot (with bootload=EXIT)
 + n1  1C:C1:DE:1C:82:D5 192.168.102.10 1C:C1:DE:1C:82:D4 10.10.102.10 10.11.103.10
 + n2  1C:C1:DE:1C:81:01 192.168.102.11 1C:C1:DE:1C:81:00 10.10.102.11 10.11.103.11
 +...
 </code> </code>
  
-Second interface: create a template inside of the chroot environment.+My deploy script (give an entire line from above as arguments)
  
 <code> <code>
  
-wwsh node set b49 --netdev=eth1 \ +#!/bin/bash
---hwaddr=00:00:00:00:00:00 --ipaddr=10.10.1.55 \ +
---netmask=255.255.0.0  --network=255.255.0.0+
  
-#--- build file CHROOT/root/wwtemplates/ifcfg-eth1.ww + deploy a n0.chroot node via PXE golden image transfer 
-DEVICE=eth1 + # dynamic files are always in stateless CHROOT/centos-6/root/wwtemplates 
-BOOTPROTO=static + node=$1 
-ONBOOT=yes + hwaddr0=$2 
-HWADDR=%{NETDEVS::ETH1::HWADDR} + ipaddr0=$3 
-IPADDR=%{NETDEVS::ETH1::IPADDR} + hwaddr1=$4 
-NETMASK=%{NETDEVS::ETH1::NETMASK} + ipaddr1=$5 
-NETWORK=%{NETDEVS::ETH1::NETWORK} + ipaddri=$6
-#--- end +
  
-add that file (using wwsh provision) to the nodes.+ if [ $!= 6 ]; then 
 +         echo "missing args: node hwaddr0 ipaddr0 hwaddr1 ipaddr1 ipaddri" 
 +         exit 
 + fi
  
-[root@]# wwsh file import /var/chroot/centos-6/root/wwtemplates/ifcfg-eth1.ww \ + wwsh object delete $node - 
- --path=/etc/sysconfig/network-scripts/ifcfg-eth1 --name=ifcfg-eth1.ww+ sleep 3
  
-[root@]# wwsh provision set n[00-15] --fileadd=ifcfg-eth1.ww+ wwsh node new $node --netdev=eth0 \ 
 + --hwaddr=$hwaddr0 --ipaddr=$ipaddr0 \ 
 + --netmask=255.255.0.0  --network=255.255.0.0 -y
  
-</code>+ wwsh node set $node --netdev=eth1 \ 
 + --hwaddr=$hwaddr1 --ipaddr=$ipaddr1 \ 
 + --netmask=255.255.0.0  --network=255.255.0.0 -y
  
-Now, lets put it all together which can form the basis for a script.+ wwsh node set $node --netdev=ib0 \ 
 + --ipaddr=$ipaddri \ 
 + --netmask=255.255.0.0  --network=255.255.0.0 -y
  
-<code>+ wwsh provision set $node --fileadd passwd,shadow,group -y 
 + wwsh provision set $node --fileadd hosts,bashrc,profile -y 
 + wwsh provision set $node --fileadd network.ww,ifcfg-eth1.ww,ifcfg-ib0.ww -y
  
-make sure it boots across networkalter BIOS settings+note: no diskpartitionalready exists and fails on this hardware, 
 +# otherwise add diskpartion=sda so that "mkbootable" succeeds
  
-wwsh node new b6 --netdev=eth0 \ + wwsh object modify -s bootloader=sda $node -y 
---hwaddr=00:00:00:00:00:00 --ipaddr=192.168.1.12 \ + wwsh object modify -s diskformat=sda1,sda4 $node -y
---netmask=255.255.0.0  --network=255.255.0.0 +
---groups=wwnodes+
  
-wwsh node set b6 --netdev=eth1 \ + if [ "$node== 'n22' ]; then 
---hwaddr=00:00:00:00:00:00 --ipaddr=10.10.100.12 \ + # golden images with 3 partitions 
---netmask=255.255.0.0  --network=255.255.0.0+ wwsh object modify -s filesystems="mountpoint=/boot:dev=sda1:type=ext4:size=1024,dev=sda2:type=swap:size=6144,mountpoint=/:dev=sda3:type=ext4:size=+" $node -
 + else 
 + # hp blade 4 partitions 
 + wwsh object modify -s filesystems="mountpoint=/boot:dev=sda1:type=ext4:size=1024,dev=sda2:type=swap:size=6144,mountpoint=/:dev=sda4:type=ext4:size=+" $node -y 
 + fi
  
-wwsh provision set b6 --fileadd passwd,shadow,group + wwsh provision set $node --vnfs=n0.chroot -y 
-wwsh provision set b6 --fileadd hosts,bashrc,profile + wwsh provision set $node --bootstrap=2.6.32-573.12.1.el6.x86_64 -y
-wwsh provision set b6 --fileadd network.ww,ifcfg-eth1.ww+
  
 + wwsh provision set --bootlocal=UNDEF $node -y
  
-</code>+ wwsh pxe update 
 + wwsh dhcp update 
 + service dhcpd restart 
 + service httpd restart
  
 + echo "now reboot: $node"
  
-Useful links+ echo "wwsh provision set --bootlocal=EXIT $node -y" 
 + 
 + 
 +</code>
  
-  * [[http://www.admin-magazine.com/HPC/Articles/Warewulf-Cluster-Manager-Master-and-Compute-Nodes]] 
-  * [[http://www.admin-magazine.com/HPC/Articles/warewulf_cluster_manager_completing_the_environment]] 
-  * http://warewulf.lbl.gov/trac/wiki/Documentation 
  
 \\ \\
 **[[cluster:0|Back]]** **[[cluster:0|Back]]**
cluster/144.1449602284.txt.gz · Last modified: 2015/12/10 16:10 (external edit)