Skip to content

Bechtel-Innovation-Design-Center/SmartFacilityNodeMgr

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.

sbc-mgr library and command line utility

Data model

In memory

The Node class holds the current state of all Nodes the system is managing. The goal is to efficiently be able to manipulate them. Parents hold dict MAC:Node of children as a child has no meaninful name. If image=True its an image, else its a child.

Sanity checks:

  • If not an image, must exist in someones children list. If not, is an orphan which requires cleaning up
  • If an image it must not be in someones children's dict. If it is, then it requires fixing

On disk

In the system each Node is a folder in a single directory. Each folder contains:

  • config.json - A json dump of the Node in this directory
  • root.img - A sparse file to be mounted as root
  • boot/ - A boot directory containing the boot.scr and assoc files to boot the system

Commands

  1. root create: Create an root
    1. No MAC assigned yet, so no DHCP or NBD link yet
    2. allocate a disk image file of size X
    3. create a boot folder
  2. root allocate: Allocate a MAC to an image
    1. Assign an IP from the name
    2. Assign MAC
    3. Setup DHCP / TFTP
    4. Setup NBD
  3. root deallocate: Remove a MAC from an image
    1. Remove IP
    2. Remove MAC
    3. Remove DHCP /TFTP
    4. Remove NBD
    5. Send reboot to node (if there even is one)
  4. root clone: Copy an image (live or not) to create an unallocated root
  5. root delete: Delete an image if its not allocated and has no children
  6. root export/import: Create a tar of node content/import a tar of root content to a new name
    1. Update config.json on input to new paths and name, create one if it does not exist or is broken
  7. leaf create: Given an existing, deallocated root create leaf nodes for each MAC supplied
  8. leaf delete: Given an existing root with children delete all leaf nodes

About

Python program/libraries to manage and deploy images to the diskless SBC nodes

Resources

License

Stars

Watchers

Forks

Releases

No releases published