racksdb − Explore Yaml database of datacenter infrastructures
racksdb [GENERAL OPTIONS] COMMAND [COMMAND OPTIONS]
−h, −−help
Show this help message and exit.
−v, −−version
Show RacksDB version number and exit.
−−debug
Enable debug mode with more messages in output.
−b, −−db=DB
Path to database. Both files and directories paths are accepted. If the path is a directory, all YAML files in this directory are loaded, recursively. If the path does not exist, an error is reported. Default value is /var/lib/racksdb/ directory.
−s, −−schema=SCHEMA
Path to RacksDB schema YAML file. If the file does not exist, an error is reported. Default value is /usr/share/racksdb/schemas/racksdb.yml.
−e, −−ext=EXT
Path to optional RacksDB schema extensions. If the file does not exist, it is silently ignored by RacksDB. Default value is /etc/racksdb/extensions.yml.
All commands accept −h, −−help option to get details about available option for this particular command (ex: racksdb nodes −−help). Commands are grouped by functional purpose, and listed in lexicographical order inside each group.
dump
Dump raw data loaded from database on standard output. The generated output can be reloaded by RackDB.
schema
Dump schema, including optional extensions, on standard output.
These commands are named after the entities to search in the database.
All search commands accepts the following options:
−−fold
Fold ranges of objects and names. By default, ranges objects and names are expanded. This option produces more concise results.
−−format=FORMAT
Select alternative format for command output. Possible values are yaml and json. The default value is yaml except when −l, −−list option is enabled (see below).
−l, −−list
List names of selected entities, without detailed information. When this option is enabled, the default output format is the raw list of names with one name per line. Alternative format can be selected with −−format option (see above). The list can also be folded with −−fold option (see above).
−−with−objects−types
Add object types names in detailed dumps. This option has no effect with −l, −−list.
The search commands available are the following:
datacenters
Dump information about datacenters.
This command accepts the following options:
−−name=NAME
Name of the datacenter to search.
−−tags=TAG [TAG]
Select the datacenters labelled with these tags.
infrastructures
Dump information about infrastructures.
This command accepts the following options:
−−name=NAME
Name of the infrastructure to search.
−−tags=TAG [TAG]
Select the infrastructures labelled with these tags.
nodes
Dump information about nodes.
This command accepts the following options:
−−infrastructure=INFRASTRUCTURE
Select the nodes in this infrastructure.
−−name=NAME
Name of the node to search.
−−tags=TAG [TAG]
Select the nodes labelled with these tags.
racks
Dump information about racks.
This command accepts the following options:
−−name=NAME
Name of the rack to search.
tags
Get associated to object in database.
This command accepts the following options:
−−node=NODE
Get tags associated to a specific node.
−−infrastructure=INFRASTRUCTURE
Get tags associated to a specific infrastructure. With −−on−nodes, get the tags associated to nodes in this infrastructure.
−−datacenter=DATACENTER
Get tags associated to a specific datacenter. With −−on−racks, get the tags associated to racks in this datacenter.
−−on−nodes
With −−infrastructure, get tags associated to nodes in an infrastructure.
−−on−racks
With −−datacenter, get tags associated to racks in a datacenter.
Either −−node, −−infrastructure or −−datacenter argument is required.
Examples
$ racksdb datacenters
Dump information about all the datacenters with their rooms and racks in YAML format.
$ racksdb datacenters −−tags tier2 −−format json
Dump information about all the datacenters that have the tier2 tag in JSON format.
$ racksdb infrastructures
Dump information about all the infrastructures with their parts and equipments.
$ racksdb infrastructures −−tags hpc cluster
Dump information about all the infrastructures that have both the hpc and cluster tags.
$ racksdb infrastructures −−list
List names of all infrastructures in database.
$ racksdb nodes −−name cn001
Dump information node named cn001.
$ racksdb nodes −−tags compute
Dump information of all nodes that have the compute tag.
$ racksdb nodes −−tags compute −−list −−fold
Folded names of all nodes that have the compute tag.
$ racksdb nodes −−infrastructure tiger −−tags server −−list −−format json
List of names of all nodes in tiger infrastructure that also have the server tag in JSON format.
$ racksdb racks
Dump information about all racks with their equipments.
$ racksdb racks −−name R7−06 −−fold
Dump information about rack R7−A06 with folded node range.
$ racksdb tags −−node cn001
Get all tags associated to node cn001.
$ racksdb tags −−infrastructure tiger
Get all tags associated to infrastructure tiger.
$ racksdb tags −−infrastructure tiger −−on−nodes
Get all tags associated to nodes in infrastructure tiger.
$ racksdb tags −−datacenter paris
Get all tags associated to datacenter paris.
$ racksdb tags −−datacenter paris −−on−racks
Get all tags associated to racks in datacenter paris.
The draw command is used to generate image file with graphical representations of database entities. This command is used in combination with a sub−command to indicate the type of database entity.
This command accepts the following options:
−−name=NAME
Name of the entity to represent. This option is required.
−−format=FORMAT
File format of the generated image file. Possible values are png, svg and pdf. Default value is png.
−−parameters=PARAMETERS
Path to YAML drawing parameters file. With special value −, drawings parameters are read on standard input.
−−drawings−schema=DRAWINGS_SCHEMA
Path to drawing parameters schema YAML file. Default value is /usr/share/racksdb/drawings.yml.
−c, −−coordinates=COORDINATES
Dump pixels coordinates of equipment and racks in the graphical representations in an additional file. The value of the option is the path of the generated coordiantes file. This value is optional. When this option is used without value, coordinates are dumped into a file named coordinates.FORMAT where FORMAT is the coordinates format (ex: json).
−−coordinates−format=COORDINATES_FORMAT
Format of coordinates files. Possible values are json and yaml. Default value is json.
The following sub−commands are available:
infrastructure
Draw racks of an infrastructure, grouped by rows. The front side of the racks are represented with the equipments of the infrastructure.
room
Draw datacenter room map with its racks. The room is represented from the top view with rows and racks at their position in this room.
Examples
$ racksdb draw room −−name=atlas
Generate the map of datacenter room atlas with all its racks in PNG image file atlas.png.
$ racksdb draw infrastructure −−name=tiger −−format=svg
Generate SVG image file tiger.svg with racks and equipments used in tiger infrastructure.
$ racksdb draw infrastructure −−name=tiger −−format=pdf −−parameters=custom.yaml
Generate PDF image file tiger.pdf with racks and equipments used in tiger infrastructure with custom drawing parameters defined in custom.yaml.
$ racksdb draw room −−name=noisy −−parameters=− < custom.yaml
Generate the map of datacenter room noisy with custom drawing parameters read on standard input fed with content of custom.yaml.
$ racksdb draw infrastructure −−name=mercury −−coordinates
Generate graphical representation of mercury infrastructure and dump coordinates of equipment in JSON format in a file named coordinates.json.
$ racksdb draw infrastructure −−name=tiger −−coordinates −−coordinates−format yaml
Generate graphical representation of tiger infrastructure and dump coordinates of equipment in YAML format in a file named coordinates.yaml.
$ racksdb draw room −−name=noisy −−coordinates=noisy−coordinates.json
Generate graphical representation of noisy datacenter room and dump coordinates of racks in JSON format in a file named noisy−coordinates.json.
0
racksdb has processed command with success.
1
racksdb encountered an error.
RacksDB web site: <https://github.com/rackslab/racksdb>
Copyright © 2022−2023 Rackslab: <https://rackslab.io>.
RacksDB is distributed under the terms of the GNU General Public License v3.0 or later (GPLv3+).
Rackslab: https://rackslab.io