Permalink
Cannot retrieve contributors at this time
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?
SmartFacilityNodeMgr/README.md
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
45 lines (37 sloc)
1.8 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
1. allocate a disk image file of size X | |
1. create a boot folder | |
1. root allocate: Allocate a MAC to an image | |
1. Assign an IP from the name | |
1. Assign MAC | |
1. Setup DHCP / TFTP | |
1. Setup NBD | |
1. root deallocate: Remove a MAC from an image | |
1. Remove IP | |
1. Remove MAC | |
1. Remove DHCP /TFTP | |
1. Remove NBD | |
1. Send reboot to node (if there even is one) | |
1. root clone: Copy an image (live or not) to create an unallocated root | |
1. root delete: Delete an image if its not allocated and has no children | |
1. 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 | |
1. leaf create: Given an existing, deallocated root create leaf nodes for each MAC supplied | |
1. leaf delete: Given an existing root with children delete all leaf nodes |