1. 08 Mar, 2004 2 commits
    • Robert Ricci's avatar
      Make the getbandwidth() function aware of node types - it takes as a · 5cb2e92f
      Robert Ricci authored
      parameter the virtual node it is being called for, and considers only
      bandwidths that can be supported by physical nodes that virtual node
      can be mapped to.
      
      This fixes some cases where we were mistakenly setting interfaces
      on slow links to 10Mbps, which does not work reliably.
      
      Not surpisingly, tracking down problems with vtypes was half the
      trouble with making this change.
      5cb2e92f
    • Leigh B. Stoller's avatar
      Converted os_load and node_reboot into libraries. Basically that meant · 9bfe3d61
      Leigh B. Stoller authored
      splitting the existing code between a frontend script that parses arguments
      and does taint checking, and a backend library where all the work is done
      (including permission checks). The interface to the libraries is simple
      right now (didn't want to spend a lot of time on designing interface
      without knowing if the approach would work long term).
      
      	use libreboot;
      	use libosload;
      
              nodereboot(\%reboot_args, \%reboot_results);
              osload(\%reload_args, \%reload_results);
      
      Arguments are passed to the libraries in the form of a hash. For example,
      in os_setup:
      
      	$reload_args{'debug'}     = $dbg;
      	$reload_args{'asyncmode'} = 1;
      	$reload_args{'imageid'}   = $imageid;
      	$reload_args{'nodelist'}  = [ @nodelist ];
      
      Results are passed back both as a return code (-1 means total failure right
      away, while a positive argument indicates the number of nodes that failed),
      and in the results hash which gives the status for each individual node. At
      the moment it is just success or failure (0 or 1), but in the future might
      be something more meaningful.
      
      os_setup can now find out about individual failures, both in reboot and
      reload, and alter how it operates afterwards. The main thing is to not wait
      for nodes that fail to reboot/reload, and to terminate with no retry when
      this happens, since at the moment it indicates an unusual failure, and it
      is better to terminate early. In the past an os_load failure would result
      in a tbswap retry, and another failure (multiple times). I have already
      tested this by trying to load images that have no file on disk; it is nice
      to see those failures caught early and the experiment failure to happen
      much quicker!
      
      A note about "asyncmode" above. In order to promote parallelism in
      os_setup, asyncmode tells the library to fork off a child and return
      immediately. Later, os_setup can block and wait for status by calling
      back into the library:
      
      	my $foo = nodereboot(\%reboot_args, \%reboot_results);
      	nodereboot_wait($foo);
      
      If you are wondering how the child reports individual node status back to
      the parent (so it can fill in the results hash), Perl really is a kitchen
      sink. I create a pipe with Perl's pipe function and then fork a child to so
      the work; the child writes the results to the pipe (status for each node),
      and the parent reads that back later when nodereboot_wait() is called,
      moving the results into the %reboot_results array. The parent meanwhile can
      go on and in the case of os_setup, make more calls to reboot/reload other
      nodes, later calling the wait() routines once all have been initiated.
      Also worth noting that in order to make the libraries "reentrant" I had to
      do some cleaning up and reorganizing of the code. Nothing too major though,
      just removal of lots of global variables. I also did some mild unrelated
      cleanup of code that had been run over once too many times with a tank.
      
      So how did this work out. Well, for os_setup/os_load it works rather
      nicely!
      
      node_reboot is another story. I probably should have left it alone, but
      since I had already climbed the curve on osload, I decided to go ahead and
      do reboot. The problem is that node_reboot needs to run as root (its a
      setuid script), which means it can only be used as a library from something
      that is already setuid. os_setup and os_load runs as the user. However,
      having a consistent library interface and the ability to cleanly figure out
      which individual nodes failed, is a very nice thing.
      
      So I came up with a suitable approach that is hidden in the library. When the
      library is entered without proper privs, it silently execs an instance of
      node_reboot (the setuid script), and then uses the same trick mentioned
      above to read back individual node status. I create the pipe in the parent
      before the exec, and set the no-close-on-exec flag. I pass the fileno along
      in an environment variable, and the library uses that to the write the
      results to, just like above. The result is that os_setup sees the same
      interface for both os_load and node_reboot, without having to worry that
      one or the other needs to be run setuid.
      9bfe3d61
  2. 04 Mar, 2004 5 commits
  3. 03 Mar, 2004 1 commit
    • Kirk Webb's avatar
      More plab updates/changes · d4a887e5
      Kirk Webb authored
      * implemented PLC slice renewal
      * restructured daemon code/startup
        - removed getfree daemon (replaced by plabdiscover; run from cron)
        - moved generic daemonizing code into libtestbed (class)
        - created plabrenewd - small script that utilizes daemonizing class
        - removed plabdaemon file.
        - updated bossnode startup scripts
      * changed slice prefix - PLC denies permission w/ anything other than "utah"
      * Minor semantic changes to module API to be more consistent with other parts.
      * Some bug fixes.
      d4a887e5
  4. 02 Mar, 2004 1 commit
    • Kirk Webb's avatar
      Some updates to plab support: · b7c376c3
      Kirk Webb authored
      * removed unused and not generally useful ping checking
      * reorganized node discovery and added node info updating
        - e.g., update IP, SITE, or HOSTNAME when they have changed
        - no longer part of the backend module as this is independent of
          which backend is used; may modularize it due to plab's new "trumpet"
          service, which is basically its node DB available via a decentralized
          transport/API.
      * introduced new method of getting node info - use plab sites.xml file
      * various other cleanups.
      b7c376c3
  5. 01 Mar, 2004 1 commit
  6. 26 Feb, 2004 4 commits
  7. 25 Feb, 2004 6 commits
  8. 23 Feb, 2004 4 commits
  9. 20 Feb, 2004 5 commits
  10. 17 Feb, 2004 1 commit
  11. 16 Feb, 2004 2 commits
  12. 13 Feb, 2004 2 commits
  13. 12 Feb, 2004 4 commits
    • Robert Ricci's avatar
      Check in a change I've had sitting around for a long time - add a '-o' · 67ca9eda
      Robert Ricci authored
      option to print the hostname Ganglia gave us, rather than the one in
      our database.
      67ca9eda
    • Leigh B. Stoller's avatar
      Fix problem with trivial links not getting lindelays. In the case that · 0dc661b1
      Leigh B. Stoller authored
      a 100Mb link is mapped to a trivial link, a linkdelay has to be
      inserted since the actual loopback bandwidth is much higher. The
      problem is that unlike other delays where requires_delay() will return
      true, this decision has to wait until after assign does the mapping
      and we find out that a link was mapped to a trivial link. When this
      happens, I insert a linkdelay "on the fly" when processing the link
      statements from assign.
      0dc661b1
    • Robert Ricci's avatar
      Unbreak vtypes by putting entries for them into the %node_type_linkbw · fa4f5764
      Robert Ricci authored
      hash.
      
      This means we have to call LoadVirtTypes() from a slightly different
      place, so that we have the virt types before calling LoadPhysInfo(),
      where %node_type_linkbw is built.
      fa4f5764
    • Leigh B. Stoller's avatar
      * Removed startexp, and merged its contents into batchexp. There has been · aef08532
      Leigh B. Stoller authored
        no reason for the separation for a long time, and it made maintence more
        difficult cause of duplication between batchexp and startexp (batch was
        the sole user of startexp). Cleaner solution.
      
      * Check argument processing for batchexp, swapexp, endexp to make sure the
        taint checks are correct. All three of these scripts will now be
        available from ops. I especially watch the filename processing, which was
        pretty loose before and could allow some to grab a file on boss by trying
        to use it as an NS file (scripts all runs as user of course). The web
        interface generates filenames that are hard to guess, so rather then
        wrapping these scripts when invoked from ops, just allow the usual paths
        (/proj, /groups, /users) but also /tmp/$uid-XXXXXX.nsfile pattern, which
        should be hard enough to guess that users will not be able to get
        anything they are not supposed to.
      
      * Add -w (waitmode) options to all three scripts. In waitmode, the backend
        detaches, but the parent remains waiting for the child to finish so it
        can exit with the appropriate status (for scripting). The user can
        interrupt (^C), but it has no effect on the backend; it just kills the
        parent side that is waiting (backend is in a new session ID). Log outout
        still goes to the file (available from web page) and is emailed.
      aef08532
  14. 11 Feb, 2004 2 commits