2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2024-11-21 17:11:52 +00:00
15 The mini design of syncfiles for cumulus
yangsong edited this page 2018-04-19 17:35:53 +08:00
  1. The generation of cumulus osimage: copycds /iso/cumulus-3.5.2-armel/cumulus-linux-3.5.2-bcm-armel.bin determine the file ./cumulus-linux-3.5.2-bcm-armel.bin, if the output is data, it will perform the following 3 steps:

    a. run “cumulus-linux-3.5.2-bcm-armel.bin” and get the binary information and generate the osimage name

     # ./cumulus-linux-3.5.2-bcm-armel.bin
     Verifying image checksum ...OK.
     Preparing image archive ... OK.
     Control File Contents
     =====================
     Description: Cumulus Linux 3.5.2
     Release: 3.5.2
     Architecture: armel
     Switch-Architecture: bcm-armel
     Build-Id: bab9bc5z1d1b1f3
     Build-Date: 2018-01-31T00:41:00+0000
     Build-User: clbuilder
     Homepage: http://www.cumulusnetworks.com/
     Min-Disk-Size: 1073741824
     Min-Ram-Size: 536870912
     mkimage-version: cl3u13
    

    b. copy the binary to the /install/cumulus3.5.2/cumulus-3.5.2-armel/

    c. create the the following osimage definition

    [root@c910f03c05k21 cumulus_mlx]# lsdef -t osimage -o cumulus3.5.2-armel
    Object name: cumulus3.5.2-armel
        imagetype=linux
        osarch=armel
        osvers=cumulus3.5.2
        pkgdir=/install/cumulus3.5.2/armel/cumulus-linux-3.5.2-bcm-armel.bin  #<<< might be a comma separated list, the 1st should be the full path to the bin file
        synclists=/tmp/compute.synclist #<<<<<<<synclist specified here>>>>>>>>>>>>
        postscripts=xxxx
        postbootscripts=xxxx
    
  2. nodeset mid05tor12 osimage=cumulus3.5.2-armel

    [root@briggs01 ~]# lsdef mid05tor12
    Object name: mid05tor12
        groups=switch,edge_switch
        ip=172.11.205.12
        mac=xx:xx:xx:xx:xx:xx
        mgt=switch
        netboot=onie
    

    nodeset performs the following operations:

    (1) find the "*.bin" file under the first entry in osimage.pkgdir, then copy the "*.bin" to /install/osimages/cumulus3.5.2-armel

    (2)assign the node.provmethod to the osimage name

    (3)run "makedhcp -a ", generate the dhcp lease with full path to the bin file in default-url option

  3. add an option -r [the full path to scp or rsync] for updatenode to select scp/rsync, refine the code logic in updatenode and xdcp to enable this

    # updatenode mid05tor12 -F -r /usr/bin/scp
    # xdcp mid05tor12 -F -r /usr/bin/scp
    
  4. refine the code logic in startsyncfiles.awk , add an option -r to select the scp or rsync, the compute node can select the scp/rsync according to the existence of the 2 executables

    # syncfiles -r usr/bin/scp